001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import com.liferay.portal.model.Resource;
018    
019    /**
020     * The persistence interface for the resource service.
021     *
022     * <p>
023     * Caching information and settings can be found in <code>portal.properties</code>
024     * </p>
025     *
026     * @author Brian Wing Shun Chan
027     * @see ResourcePersistenceImpl
028     * @see ResourceUtil
029     * @generated
030     */
031    public interface ResourcePersistence extends BasePersistence<Resource> {
032            /*
033             * NOTE FOR DEVELOPERS:
034             *
035             * Never modify or reference this interface directly. Always use {@link ResourceUtil} to access the resource persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.
036             */
037    
038            /**
039            * Caches the resource in the entity cache if it is enabled.
040            *
041            * @param resource the resource
042            */
043            public void cacheResult(com.liferay.portal.model.Resource resource);
044    
045            /**
046            * Caches the resources in the entity cache if it is enabled.
047            *
048            * @param resources the resources
049            */
050            public void cacheResult(
051                    java.util.List<com.liferay.portal.model.Resource> resources);
052    
053            /**
054            * Creates a new resource with the primary key. Does not add the resource to the database.
055            *
056            * @param resourceId the primary key for the new resource
057            * @return the new resource
058            */
059            public com.liferay.portal.model.Resource create(long resourceId);
060    
061            /**
062            * Removes the resource with the primary key from the database. Also notifies the appropriate model listeners.
063            *
064            * @param resourceId the primary key of the resource
065            * @return the resource that was removed
066            * @throws com.liferay.portal.NoSuchResourceException if a resource with the primary key could not be found
067            * @throws SystemException if a system exception occurred
068            */
069            public com.liferay.portal.model.Resource remove(long resourceId)
070                    throws com.liferay.portal.NoSuchResourceException,
071                            com.liferay.portal.kernel.exception.SystemException;
072    
073            public com.liferay.portal.model.Resource updateImpl(
074                    com.liferay.portal.model.Resource resource, boolean merge)
075                    throws com.liferay.portal.kernel.exception.SystemException;
076    
077            /**
078            * Returns the resource with the primary key or throws a {@link com.liferay.portal.NoSuchResourceException} if it could not be found.
079            *
080            * @param resourceId the primary key of the resource
081            * @return the resource
082            * @throws com.liferay.portal.NoSuchResourceException if a resource with the primary key could not be found
083            * @throws SystemException if a system exception occurred
084            */
085            public com.liferay.portal.model.Resource findByPrimaryKey(long resourceId)
086                    throws com.liferay.portal.NoSuchResourceException,
087                            com.liferay.portal.kernel.exception.SystemException;
088    
089            /**
090            * Returns the resource with the primary key or returns <code>null</code> if it could not be found.
091            *
092            * @param resourceId the primary key of the resource
093            * @return the resource, or <code>null</code> if a resource with the primary key could not be found
094            * @throws SystemException if a system exception occurred
095            */
096            public com.liferay.portal.model.Resource fetchByPrimaryKey(long resourceId)
097                    throws com.liferay.portal.kernel.exception.SystemException;
098    
099            /**
100            * Returns all the resources where codeId = &#63;.
101            *
102            * @param codeId the code ID
103            * @return the matching resources
104            * @throws SystemException if a system exception occurred
105            */
106            public java.util.List<com.liferay.portal.model.Resource> findByCodeId(
107                    long codeId) throws com.liferay.portal.kernel.exception.SystemException;
108    
109            /**
110            * Returns a range of all the resources where codeId = &#63;.
111            *
112            * <p>
113            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
114            * </p>
115            *
116            * @param codeId the code ID
117            * @param start the lower bound of the range of resources
118            * @param end the upper bound of the range of resources (not inclusive)
119            * @return the range of matching resources
120            * @throws SystemException if a system exception occurred
121            */
122            public java.util.List<com.liferay.portal.model.Resource> findByCodeId(
123                    long codeId, int start, int end)
124                    throws com.liferay.portal.kernel.exception.SystemException;
125    
126            /**
127            * Returns an ordered range of all the resources where codeId = &#63;.
128            *
129            * <p>
130            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
131            * </p>
132            *
133            * @param codeId the code ID
134            * @param start the lower bound of the range of resources
135            * @param end the upper bound of the range of resources (not inclusive)
136            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
137            * @return the ordered range of matching resources
138            * @throws SystemException if a system exception occurred
139            */
140            public java.util.List<com.liferay.portal.model.Resource> findByCodeId(
141                    long codeId, int start, int end,
142                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
143                    throws com.liferay.portal.kernel.exception.SystemException;
144    
145            /**
146            * Returns the first resource in the ordered set where codeId = &#63;.
147            *
148            * <p>
149            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
150            * </p>
151            *
152            * @param codeId the code ID
153            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
154            * @return the first matching resource
155            * @throws com.liferay.portal.NoSuchResourceException if a matching resource could not be found
156            * @throws SystemException if a system exception occurred
157            */
158            public com.liferay.portal.model.Resource findByCodeId_First(long codeId,
159                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
160                    throws com.liferay.portal.NoSuchResourceException,
161                            com.liferay.portal.kernel.exception.SystemException;
162    
163            /**
164            * Returns the last resource in the ordered set where codeId = &#63;.
165            *
166            * <p>
167            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
168            * </p>
169            *
170            * @param codeId the code ID
171            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
172            * @return the last matching resource
173            * @throws com.liferay.portal.NoSuchResourceException if a matching resource could not be found
174            * @throws SystemException if a system exception occurred
175            */
176            public com.liferay.portal.model.Resource findByCodeId_Last(long codeId,
177                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
178                    throws com.liferay.portal.NoSuchResourceException,
179                            com.liferay.portal.kernel.exception.SystemException;
180    
181            /**
182            * Returns the resources before and after the current resource in the ordered set where codeId = &#63;.
183            *
184            * <p>
185            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
186            * </p>
187            *
188            * @param resourceId the primary key of the current resource
189            * @param codeId the code ID
190            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
191            * @return the previous, current, and next resource
192            * @throws com.liferay.portal.NoSuchResourceException if a resource with the primary key could not be found
193            * @throws SystemException if a system exception occurred
194            */
195            public com.liferay.portal.model.Resource[] findByCodeId_PrevAndNext(
196                    long resourceId, long codeId,
197                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
198                    throws com.liferay.portal.NoSuchResourceException,
199                            com.liferay.portal.kernel.exception.SystemException;
200    
201            /**
202            * Returns the resource where codeId = &#63; and primKey = &#63; or throws a {@link com.liferay.portal.NoSuchResourceException} if it could not be found.
203            *
204            * @param codeId the code ID
205            * @param primKey the prim key
206            * @return the matching resource
207            * @throws com.liferay.portal.NoSuchResourceException if a matching resource could not be found
208            * @throws SystemException if a system exception occurred
209            */
210            public com.liferay.portal.model.Resource findByC_P(long codeId,
211                    java.lang.String primKey)
212                    throws com.liferay.portal.NoSuchResourceException,
213                            com.liferay.portal.kernel.exception.SystemException;
214    
215            /**
216            * Returns the resource where codeId = &#63; and primKey = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
217            *
218            * @param codeId the code ID
219            * @param primKey the prim key
220            * @return the matching resource, or <code>null</code> if a matching resource could not be found
221            * @throws SystemException if a system exception occurred
222            */
223            public com.liferay.portal.model.Resource fetchByC_P(long codeId,
224                    java.lang.String primKey)
225                    throws com.liferay.portal.kernel.exception.SystemException;
226    
227            /**
228            * Returns the resource where codeId = &#63; and primKey = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
229            *
230            * @param codeId the code ID
231            * @param primKey the prim key
232            * @param retrieveFromCache whether to use the finder cache
233            * @return the matching resource, or <code>null</code> if a matching resource could not be found
234            * @throws SystemException if a system exception occurred
235            */
236            public com.liferay.portal.model.Resource fetchByC_P(long codeId,
237                    java.lang.String primKey, boolean retrieveFromCache)
238                    throws com.liferay.portal.kernel.exception.SystemException;
239    
240            /**
241            * Returns all the resources.
242            *
243            * @return the resources
244            * @throws SystemException if a system exception occurred
245            */
246            public java.util.List<com.liferay.portal.model.Resource> findAll()
247                    throws com.liferay.portal.kernel.exception.SystemException;
248    
249            /**
250            * Returns a range of all the resources.
251            *
252            * <p>
253            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
254            * </p>
255            *
256            * @param start the lower bound of the range of resources
257            * @param end the upper bound of the range of resources (not inclusive)
258            * @return the range of resources
259            * @throws SystemException if a system exception occurred
260            */
261            public java.util.List<com.liferay.portal.model.Resource> findAll(
262                    int start, int end)
263                    throws com.liferay.portal.kernel.exception.SystemException;
264    
265            /**
266            * Returns an ordered range of all the resources.
267            *
268            * <p>
269            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
270            * </p>
271            *
272            * @param start the lower bound of the range of resources
273            * @param end the upper bound of the range of resources (not inclusive)
274            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
275            * @return the ordered range of resources
276            * @throws SystemException if a system exception occurred
277            */
278            public java.util.List<com.liferay.portal.model.Resource> findAll(
279                    int start, int end,
280                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
281                    throws com.liferay.portal.kernel.exception.SystemException;
282    
283            /**
284            * Removes all the resources where codeId = &#63; from the database.
285            *
286            * @param codeId the code ID
287            * @throws SystemException if a system exception occurred
288            */
289            public void removeByCodeId(long codeId)
290                    throws com.liferay.portal.kernel.exception.SystemException;
291    
292            /**
293            * Removes the resource where codeId = &#63; and primKey = &#63; from the database.
294            *
295            * @param codeId the code ID
296            * @param primKey the prim key
297            * @throws SystemException if a system exception occurred
298            */
299            public void removeByC_P(long codeId, java.lang.String primKey)
300                    throws com.liferay.portal.NoSuchResourceException,
301                            com.liferay.portal.kernel.exception.SystemException;
302    
303            /**
304            * Removes all the resources from the database.
305            *
306            * @throws SystemException if a system exception occurred
307            */
308            public void removeAll()
309                    throws com.liferay.portal.kernel.exception.SystemException;
310    
311            /**
312            * Returns the number of resources where codeId = &#63;.
313            *
314            * @param codeId the code ID
315            * @return the number of matching resources
316            * @throws SystemException if a system exception occurred
317            */
318            public int countByCodeId(long codeId)
319                    throws com.liferay.portal.kernel.exception.SystemException;
320    
321            /**
322            * Returns the number of resources where codeId = &#63; and primKey = &#63;.
323            *
324            * @param codeId the code ID
325            * @param primKey the prim key
326            * @return the number of matching resources
327            * @throws SystemException if a system exception occurred
328            */
329            public int countByC_P(long codeId, java.lang.String primKey)
330                    throws com.liferay.portal.kernel.exception.SystemException;
331    
332            /**
333            * Returns the number of resources.
334            *
335            * @return the number of resources
336            * @throws SystemException if a system exception occurred
337            */
338            public int countAll()
339                    throws com.liferay.portal.kernel.exception.SystemException;
340    }