001    /**
002     * Copyright (c) 2000-2013 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            * @param codeId the code ID
149            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
150            * @return the first matching resource
151            * @throws com.liferay.portal.NoSuchResourceException if a matching resource could not be found
152            * @throws SystemException if a system exception occurred
153            */
154            public com.liferay.portal.model.Resource findByCodeId_First(long codeId,
155                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
156                    throws com.liferay.portal.NoSuchResourceException,
157                            com.liferay.portal.kernel.exception.SystemException;
158    
159            /**
160            * Returns the first resource in the ordered set where codeId = &#63;.
161            *
162            * @param codeId the code ID
163            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
164            * @return the first matching resource, or <code>null</code> if a matching resource could not be found
165            * @throws SystemException if a system exception occurred
166            */
167            public com.liferay.portal.model.Resource fetchByCodeId_First(long codeId,
168                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
169                    throws com.liferay.portal.kernel.exception.SystemException;
170    
171            /**
172            * Returns the last resource in the ordered set where codeId = &#63;.
173            *
174            * @param codeId the code ID
175            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
176            * @return the last matching resource
177            * @throws com.liferay.portal.NoSuchResourceException if a matching resource could not be found
178            * @throws SystemException if a system exception occurred
179            */
180            public com.liferay.portal.model.Resource findByCodeId_Last(long codeId,
181                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
182                    throws com.liferay.portal.NoSuchResourceException,
183                            com.liferay.portal.kernel.exception.SystemException;
184    
185            /**
186            * Returns the last resource in the ordered set where codeId = &#63;.
187            *
188            * @param codeId the code ID
189            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
190            * @return the last matching resource, or <code>null</code> if a matching resource could not be found
191            * @throws SystemException if a system exception occurred
192            */
193            public com.liferay.portal.model.Resource fetchByCodeId_Last(long codeId,
194                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
195                    throws com.liferay.portal.kernel.exception.SystemException;
196    
197            /**
198            * Returns the resources before and after the current resource in the ordered set where codeId = &#63;.
199            *
200            * @param resourceId the primary key of the current resource
201            * @param codeId the code ID
202            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
203            * @return the previous, current, and next resource
204            * @throws com.liferay.portal.NoSuchResourceException if a resource with the primary key could not be found
205            * @throws SystemException if a system exception occurred
206            */
207            public com.liferay.portal.model.Resource[] findByCodeId_PrevAndNext(
208                    long resourceId, long codeId,
209                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
210                    throws com.liferay.portal.NoSuchResourceException,
211                            com.liferay.portal.kernel.exception.SystemException;
212    
213            /**
214            * Returns all the resources where primKey = &#63;.
215            *
216            * @param primKey the prim key
217            * @return the matching resources
218            * @throws SystemException if a system exception occurred
219            */
220            public java.util.List<com.liferay.portal.model.Resource> findByPrimKey(
221                    java.lang.String primKey)
222                    throws com.liferay.portal.kernel.exception.SystemException;
223    
224            /**
225            * Returns a range of all the resources where primKey = &#63;.
226            *
227            * <p>
228            * 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.
229            * </p>
230            *
231            * @param primKey the prim key
232            * @param start the lower bound of the range of resources
233            * @param end the upper bound of the range of resources (not inclusive)
234            * @return the range of matching resources
235            * @throws SystemException if a system exception occurred
236            */
237            public java.util.List<com.liferay.portal.model.Resource> findByPrimKey(
238                    java.lang.String primKey, int start, int end)
239                    throws com.liferay.portal.kernel.exception.SystemException;
240    
241            /**
242            * Returns an ordered range of all the resources where primKey = &#63;.
243            *
244            * <p>
245            * 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.
246            * </p>
247            *
248            * @param primKey the prim key
249            * @param start the lower bound of the range of resources
250            * @param end the upper bound of the range of resources (not inclusive)
251            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
252            * @return the ordered range of matching resources
253            * @throws SystemException if a system exception occurred
254            */
255            public java.util.List<com.liferay.portal.model.Resource> findByPrimKey(
256                    java.lang.String primKey, int start, int end,
257                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
258                    throws com.liferay.portal.kernel.exception.SystemException;
259    
260            /**
261            * Returns the first resource in the ordered set where primKey = &#63;.
262            *
263            * @param primKey the prim key
264            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
265            * @return the first matching resource
266            * @throws com.liferay.portal.NoSuchResourceException if a matching resource could not be found
267            * @throws SystemException if a system exception occurred
268            */
269            public com.liferay.portal.model.Resource findByPrimKey_First(
270                    java.lang.String primKey,
271                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
272                    throws com.liferay.portal.NoSuchResourceException,
273                            com.liferay.portal.kernel.exception.SystemException;
274    
275            /**
276            * Returns the first resource in the ordered set where primKey = &#63;.
277            *
278            * @param primKey the prim key
279            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
280            * @return the first matching resource, or <code>null</code> if a matching resource could not be found
281            * @throws SystemException if a system exception occurred
282            */
283            public com.liferay.portal.model.Resource fetchByPrimKey_First(
284                    java.lang.String primKey,
285                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
286                    throws com.liferay.portal.kernel.exception.SystemException;
287    
288            /**
289            * Returns the last resource in the ordered set where primKey = &#63;.
290            *
291            * @param primKey the prim key
292            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
293            * @return the last matching resource
294            * @throws com.liferay.portal.NoSuchResourceException if a matching resource could not be found
295            * @throws SystemException if a system exception occurred
296            */
297            public com.liferay.portal.model.Resource findByPrimKey_Last(
298                    java.lang.String primKey,
299                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
300                    throws com.liferay.portal.NoSuchResourceException,
301                            com.liferay.portal.kernel.exception.SystemException;
302    
303            /**
304            * Returns the last resource in the ordered set where primKey = &#63;.
305            *
306            * @param primKey the prim key
307            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
308            * @return the last matching resource, or <code>null</code> if a matching resource could not be found
309            * @throws SystemException if a system exception occurred
310            */
311            public com.liferay.portal.model.Resource fetchByPrimKey_Last(
312                    java.lang.String primKey,
313                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
314                    throws com.liferay.portal.kernel.exception.SystemException;
315    
316            /**
317            * Returns the resources before and after the current resource in the ordered set where primKey = &#63;.
318            *
319            * @param resourceId the primary key of the current resource
320            * @param primKey the prim key
321            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
322            * @return the previous, current, and next resource
323            * @throws com.liferay.portal.NoSuchResourceException if a resource with the primary key could not be found
324            * @throws SystemException if a system exception occurred
325            */
326            public com.liferay.portal.model.Resource[] findByPrimKey_PrevAndNext(
327                    long resourceId, java.lang.String primKey,
328                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
329                    throws com.liferay.portal.NoSuchResourceException,
330                            com.liferay.portal.kernel.exception.SystemException;
331    
332            /**
333            * Returns the resource where codeId = &#63; and primKey = &#63; or throws a {@link com.liferay.portal.NoSuchResourceException} if it could not be found.
334            *
335            * @param codeId the code ID
336            * @param primKey the prim key
337            * @return the matching resource
338            * @throws com.liferay.portal.NoSuchResourceException if a matching resource could not be found
339            * @throws SystemException if a system exception occurred
340            */
341            public com.liferay.portal.model.Resource findByC_P(long codeId,
342                    java.lang.String primKey)
343                    throws com.liferay.portal.NoSuchResourceException,
344                            com.liferay.portal.kernel.exception.SystemException;
345    
346            /**
347            * Returns the resource where codeId = &#63; and primKey = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
348            *
349            * @param codeId the code ID
350            * @param primKey the prim key
351            * @return the matching resource, or <code>null</code> if a matching resource could not be found
352            * @throws SystemException if a system exception occurred
353            */
354            public com.liferay.portal.model.Resource fetchByC_P(long codeId,
355                    java.lang.String primKey)
356                    throws com.liferay.portal.kernel.exception.SystemException;
357    
358            /**
359            * 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.
360            *
361            * @param codeId the code ID
362            * @param primKey the prim key
363            * @param retrieveFromCache whether to use the finder cache
364            * @return the matching resource, or <code>null</code> if a matching resource could not be found
365            * @throws SystemException if a system exception occurred
366            */
367            public com.liferay.portal.model.Resource fetchByC_P(long codeId,
368                    java.lang.String primKey, boolean retrieveFromCache)
369                    throws com.liferay.portal.kernel.exception.SystemException;
370    
371            /**
372            * Returns all the resources.
373            *
374            * @return the resources
375            * @throws SystemException if a system exception occurred
376            */
377            public java.util.List<com.liferay.portal.model.Resource> findAll()
378                    throws com.liferay.portal.kernel.exception.SystemException;
379    
380            /**
381            * Returns a range of all the resources.
382            *
383            * <p>
384            * 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.
385            * </p>
386            *
387            * @param start the lower bound of the range of resources
388            * @param end the upper bound of the range of resources (not inclusive)
389            * @return the range of resources
390            * @throws SystemException if a system exception occurred
391            */
392            public java.util.List<com.liferay.portal.model.Resource> findAll(
393                    int start, int end)
394                    throws com.liferay.portal.kernel.exception.SystemException;
395    
396            /**
397            * Returns an ordered range of all the resources.
398            *
399            * <p>
400            * 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.
401            * </p>
402            *
403            * @param start the lower bound of the range of resources
404            * @param end the upper bound of the range of resources (not inclusive)
405            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
406            * @return the ordered range of resources
407            * @throws SystemException if a system exception occurred
408            */
409            public java.util.List<com.liferay.portal.model.Resource> findAll(
410                    int start, int end,
411                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
412                    throws com.liferay.portal.kernel.exception.SystemException;
413    
414            /**
415            * Removes all the resources where codeId = &#63; from the database.
416            *
417            * @param codeId the code ID
418            * @throws SystemException if a system exception occurred
419            */
420            public void removeByCodeId(long codeId)
421                    throws com.liferay.portal.kernel.exception.SystemException;
422    
423            /**
424            * Removes all the resources where primKey = &#63; from the database.
425            *
426            * @param primKey the prim key
427            * @throws SystemException if a system exception occurred
428            */
429            public void removeByPrimKey(java.lang.String primKey)
430                    throws com.liferay.portal.kernel.exception.SystemException;
431    
432            /**
433            * Removes the resource where codeId = &#63; and primKey = &#63; from the database.
434            *
435            * @param codeId the code ID
436            * @param primKey the prim key
437            * @return the resource that was removed
438            * @throws SystemException if a system exception occurred
439            */
440            public com.liferay.portal.model.Resource removeByC_P(long codeId,
441                    java.lang.String primKey)
442                    throws com.liferay.portal.NoSuchResourceException,
443                            com.liferay.portal.kernel.exception.SystemException;
444    
445            /**
446            * Removes all the resources from the database.
447            *
448            * @throws SystemException if a system exception occurred
449            */
450            public void removeAll()
451                    throws com.liferay.portal.kernel.exception.SystemException;
452    
453            /**
454            * Returns the number of resources where codeId = &#63;.
455            *
456            * @param codeId the code ID
457            * @return the number of matching resources
458            * @throws SystemException if a system exception occurred
459            */
460            public int countByCodeId(long codeId)
461                    throws com.liferay.portal.kernel.exception.SystemException;
462    
463            /**
464            * Returns the number of resources where primKey = &#63;.
465            *
466            * @param primKey the prim key
467            * @return the number of matching resources
468            * @throws SystemException if a system exception occurred
469            */
470            public int countByPrimKey(java.lang.String primKey)
471                    throws com.liferay.portal.kernel.exception.SystemException;
472    
473            /**
474            * Returns the number of resources where codeId = &#63; and primKey = &#63;.
475            *
476            * @param codeId the code ID
477            * @param primKey the prim key
478            * @return the number of matching resources
479            * @throws SystemException if a system exception occurred
480            */
481            public int countByC_P(long codeId, java.lang.String primKey)
482                    throws com.liferay.portal.kernel.exception.SystemException;
483    
484            /**
485            * Returns the number of resources.
486            *
487            * @return the number of resources
488            * @throws SystemException if a system exception occurred
489            */
490            public int countAll()
491                    throws com.liferay.portal.kernel.exception.SystemException;
492    }