001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import com.liferay.portal.model.ResourceCode;
018    
019    /**
020     * The persistence interface for the resource code service.
021     *
022     * <p>
023     * Never modify or reference this interface directly. Always use {@link ResourceCodeUtil} to access the resource code persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.
024     * </p>
025     *
026     * <p>
027     * Caching information and settings can be found in <code>portal.properties</code>
028     * </p>
029     *
030     * @author Brian Wing Shun Chan
031     * @see ResourceCodePersistenceImpl
032     * @see ResourceCodeUtil
033     * @generated
034     */
035    public interface ResourceCodePersistence extends BasePersistence<ResourceCode> {
036            /**
037            * Caches the resource code in the entity cache if it is enabled.
038            *
039            * @param resourceCode the resource code to cache
040            */
041            public void cacheResult(com.liferay.portal.model.ResourceCode resourceCode);
042    
043            /**
044            * Caches the resource codes in the entity cache if it is enabled.
045            *
046            * @param resourceCodes the resource codes to cache
047            */
048            public void cacheResult(
049                    java.util.List<com.liferay.portal.model.ResourceCode> resourceCodes);
050    
051            /**
052            * Creates a new resource code with the primary key. Does not add the resource code to the database.
053            *
054            * @param codeId the primary key for the new resource code
055            * @return the new resource code
056            */
057            public com.liferay.portal.model.ResourceCode create(long codeId);
058    
059            /**
060            * Removes the resource code with the primary key from the database. Also notifies the appropriate model listeners.
061            *
062            * @param codeId the primary key of the resource code to remove
063            * @return the resource code that was removed
064            * @throws com.liferay.portal.NoSuchResourceCodeException if a resource code with the primary key could not be found
065            * @throws SystemException if a system exception occurred
066            */
067            public com.liferay.portal.model.ResourceCode remove(long codeId)
068                    throws com.liferay.portal.NoSuchResourceCodeException,
069                            com.liferay.portal.kernel.exception.SystemException;
070    
071            public com.liferay.portal.model.ResourceCode updateImpl(
072                    com.liferay.portal.model.ResourceCode resourceCode, boolean merge)
073                    throws com.liferay.portal.kernel.exception.SystemException;
074    
075            /**
076            * Finds the resource code with the primary key or throws a {@link com.liferay.portal.NoSuchResourceCodeException} if it could not be found.
077            *
078            * @param codeId the primary key of the resource code to find
079            * @return the resource code
080            * @throws com.liferay.portal.NoSuchResourceCodeException if a resource code with the primary key could not be found
081            * @throws SystemException if a system exception occurred
082            */
083            public com.liferay.portal.model.ResourceCode findByPrimaryKey(long codeId)
084                    throws com.liferay.portal.NoSuchResourceCodeException,
085                            com.liferay.portal.kernel.exception.SystemException;
086    
087            /**
088            * Finds the resource code with the primary key or returns <code>null</code> if it could not be found.
089            *
090            * @param codeId the primary key of the resource code to find
091            * @return the resource code, or <code>null</code> if a resource code with the primary key could not be found
092            * @throws SystemException if a system exception occurred
093            */
094            public com.liferay.portal.model.ResourceCode fetchByPrimaryKey(long codeId)
095                    throws com.liferay.portal.kernel.exception.SystemException;
096    
097            /**
098            * Finds all the resource codes where companyId = &#63;.
099            *
100            * @param companyId the company id to search with
101            * @return the matching resource codes
102            * @throws SystemException if a system exception occurred
103            */
104            public java.util.List<com.liferay.portal.model.ResourceCode> findByCompanyId(
105                    long companyId)
106                    throws com.liferay.portal.kernel.exception.SystemException;
107    
108            /**
109            * Finds a range of all the resource codes where companyId = &#63;.
110            *
111            * <p>
112            * 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.
113            * </p>
114            *
115            * @param companyId the company id to search with
116            * @param start the lower bound of the range of resource codes to return
117            * @param end the upper bound of the range of resource codes to return (not inclusive)
118            * @return the range of matching resource codes
119            * @throws SystemException if a system exception occurred
120            */
121            public java.util.List<com.liferay.portal.model.ResourceCode> findByCompanyId(
122                    long companyId, int start, int end)
123                    throws com.liferay.portal.kernel.exception.SystemException;
124    
125            /**
126            * Finds an ordered range of all the resource codes where companyId = &#63;.
127            *
128            * <p>
129            * 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.
130            * </p>
131            *
132            * @param companyId the company id to search with
133            * @param start the lower bound of the range of resource codes to return
134            * @param end the upper bound of the range of resource codes to return (not inclusive)
135            * @param orderByComparator the comparator to order the results by
136            * @return the ordered range of matching resource codes
137            * @throws SystemException if a system exception occurred
138            */
139            public java.util.List<com.liferay.portal.model.ResourceCode> findByCompanyId(
140                    long companyId, int start, int end,
141                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
142                    throws com.liferay.portal.kernel.exception.SystemException;
143    
144            /**
145            * Finds the first resource code in the ordered set where companyId = &#63;.
146            *
147            * <p>
148            * 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.
149            * </p>
150            *
151            * @param companyId the company id to search with
152            * @param orderByComparator the comparator to order the set by
153            * @return the first matching resource code
154            * @throws com.liferay.portal.NoSuchResourceCodeException if a matching resource code could not be found
155            * @throws SystemException if a system exception occurred
156            */
157            public com.liferay.portal.model.ResourceCode findByCompanyId_First(
158                    long companyId,
159                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
160                    throws com.liferay.portal.NoSuchResourceCodeException,
161                            com.liferay.portal.kernel.exception.SystemException;
162    
163            /**
164            * Finds the last resource code in the ordered set where companyId = &#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 companyId the company id to search with
171            * @param orderByComparator the comparator to order the set by
172            * @return the last matching resource code
173            * @throws com.liferay.portal.NoSuchResourceCodeException if a matching resource code could not be found
174            * @throws SystemException if a system exception occurred
175            */
176            public com.liferay.portal.model.ResourceCode findByCompanyId_Last(
177                    long companyId,
178                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
179                    throws com.liferay.portal.NoSuchResourceCodeException,
180                            com.liferay.portal.kernel.exception.SystemException;
181    
182            /**
183            * Finds the resource codes before and after the current resource code in the ordered set where companyId = &#63;.
184            *
185            * <p>
186            * 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.
187            * </p>
188            *
189            * @param codeId the primary key of the current resource code
190            * @param companyId the company id to search with
191            * @param orderByComparator the comparator to order the set by
192            * @return the previous, current, and next resource code
193            * @throws com.liferay.portal.NoSuchResourceCodeException if a resource code with the primary key could not be found
194            * @throws SystemException if a system exception occurred
195            */
196            public com.liferay.portal.model.ResourceCode[] findByCompanyId_PrevAndNext(
197                    long codeId, long companyId,
198                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
199                    throws com.liferay.portal.NoSuchResourceCodeException,
200                            com.liferay.portal.kernel.exception.SystemException;
201    
202            /**
203            * Finds all the resource codes where name = &#63;.
204            *
205            * @param name the name to search with
206            * @return the matching resource codes
207            * @throws SystemException if a system exception occurred
208            */
209            public java.util.List<com.liferay.portal.model.ResourceCode> findByName(
210                    java.lang.String name)
211                    throws com.liferay.portal.kernel.exception.SystemException;
212    
213            /**
214            * Finds a range of all the resource codes where name = &#63;.
215            *
216            * <p>
217            * 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.
218            * </p>
219            *
220            * @param name the name to search with
221            * @param start the lower bound of the range of resource codes to return
222            * @param end the upper bound of the range of resource codes to return (not inclusive)
223            * @return the range of matching resource codes
224            * @throws SystemException if a system exception occurred
225            */
226            public java.util.List<com.liferay.portal.model.ResourceCode> findByName(
227                    java.lang.String name, int start, int end)
228                    throws com.liferay.portal.kernel.exception.SystemException;
229    
230            /**
231            * Finds an ordered range of all the resource codes where name = &#63;.
232            *
233            * <p>
234            * 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.
235            * </p>
236            *
237            * @param name the name to search with
238            * @param start the lower bound of the range of resource codes to return
239            * @param end the upper bound of the range of resource codes to return (not inclusive)
240            * @param orderByComparator the comparator to order the results by
241            * @return the ordered range of matching resource codes
242            * @throws SystemException if a system exception occurred
243            */
244            public java.util.List<com.liferay.portal.model.ResourceCode> findByName(
245                    java.lang.String name, int start, int end,
246                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
247                    throws com.liferay.portal.kernel.exception.SystemException;
248    
249            /**
250            * Finds the first resource code in the ordered set where name = &#63;.
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 name the name to search with
257            * @param orderByComparator the comparator to order the set by
258            * @return the first matching resource code
259            * @throws com.liferay.portal.NoSuchResourceCodeException if a matching resource code could not be found
260            * @throws SystemException if a system exception occurred
261            */
262            public com.liferay.portal.model.ResourceCode findByName_First(
263                    java.lang.String name,
264                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
265                    throws com.liferay.portal.NoSuchResourceCodeException,
266                            com.liferay.portal.kernel.exception.SystemException;
267    
268            /**
269            * Finds the last resource code in the ordered set where name = &#63;.
270            *
271            * <p>
272            * 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.
273            * </p>
274            *
275            * @param name the name to search with
276            * @param orderByComparator the comparator to order the set by
277            * @return the last matching resource code
278            * @throws com.liferay.portal.NoSuchResourceCodeException if a matching resource code could not be found
279            * @throws SystemException if a system exception occurred
280            */
281            public com.liferay.portal.model.ResourceCode findByName_Last(
282                    java.lang.String name,
283                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
284                    throws com.liferay.portal.NoSuchResourceCodeException,
285                            com.liferay.portal.kernel.exception.SystemException;
286    
287            /**
288            * Finds the resource codes before and after the current resource code in the ordered set where name = &#63;.
289            *
290            * <p>
291            * 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.
292            * </p>
293            *
294            * @param codeId the primary key of the current resource code
295            * @param name the name to search with
296            * @param orderByComparator the comparator to order the set by
297            * @return the previous, current, and next resource code
298            * @throws com.liferay.portal.NoSuchResourceCodeException if a resource code with the primary key could not be found
299            * @throws SystemException if a system exception occurred
300            */
301            public com.liferay.portal.model.ResourceCode[] findByName_PrevAndNext(
302                    long codeId, java.lang.String name,
303                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
304                    throws com.liferay.portal.NoSuchResourceCodeException,
305                            com.liferay.portal.kernel.exception.SystemException;
306    
307            /**
308            * Finds the resource code where companyId = &#63; and name = &#63; and scope = &#63; or throws a {@link com.liferay.portal.NoSuchResourceCodeException} if it could not be found.
309            *
310            * @param companyId the company id to search with
311            * @param name the name to search with
312            * @param scope the scope to search with
313            * @return the matching resource code
314            * @throws com.liferay.portal.NoSuchResourceCodeException if a matching resource code could not be found
315            * @throws SystemException if a system exception occurred
316            */
317            public com.liferay.portal.model.ResourceCode findByC_N_S(long companyId,
318                    java.lang.String name, int scope)
319                    throws com.liferay.portal.NoSuchResourceCodeException,
320                            com.liferay.portal.kernel.exception.SystemException;
321    
322            /**
323            * Finds the resource code where companyId = &#63; and name = &#63; and scope = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
324            *
325            * @param companyId the company id to search with
326            * @param name the name to search with
327            * @param scope the scope to search with
328            * @return the matching resource code, or <code>null</code> if a matching resource code could not be found
329            * @throws SystemException if a system exception occurred
330            */
331            public com.liferay.portal.model.ResourceCode fetchByC_N_S(long companyId,
332                    java.lang.String name, int scope)
333                    throws com.liferay.portal.kernel.exception.SystemException;
334    
335            /**
336            * Finds the resource code where companyId = &#63; and name = &#63; and scope = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
337            *
338            * @param companyId the company id to search with
339            * @param name the name to search with
340            * @param scope the scope to search with
341            * @return the matching resource code, or <code>null</code> if a matching resource code could not be found
342            * @throws SystemException if a system exception occurred
343            */
344            public com.liferay.portal.model.ResourceCode fetchByC_N_S(long companyId,
345                    java.lang.String name, int scope, boolean retrieveFromCache)
346                    throws com.liferay.portal.kernel.exception.SystemException;
347    
348            /**
349            * Finds all the resource codes.
350            *
351            * @return the resource codes
352            * @throws SystemException if a system exception occurred
353            */
354            public java.util.List<com.liferay.portal.model.ResourceCode> findAll()
355                    throws com.liferay.portal.kernel.exception.SystemException;
356    
357            /**
358            * Finds a range of all the resource codes.
359            *
360            * <p>
361            * 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.
362            * </p>
363            *
364            * @param start the lower bound of the range of resource codes to return
365            * @param end the upper bound of the range of resource codes to return (not inclusive)
366            * @return the range of resource codes
367            * @throws SystemException if a system exception occurred
368            */
369            public java.util.List<com.liferay.portal.model.ResourceCode> findAll(
370                    int start, int end)
371                    throws com.liferay.portal.kernel.exception.SystemException;
372    
373            /**
374            * Finds an ordered range of all the resource codes.
375            *
376            * <p>
377            * 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.
378            * </p>
379            *
380            * @param start the lower bound of the range of resource codes to return
381            * @param end the upper bound of the range of resource codes to return (not inclusive)
382            * @param orderByComparator the comparator to order the results by
383            * @return the ordered range of resource codes
384            * @throws SystemException if a system exception occurred
385            */
386            public java.util.List<com.liferay.portal.model.ResourceCode> findAll(
387                    int start, int end,
388                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
389                    throws com.liferay.portal.kernel.exception.SystemException;
390    
391            /**
392            * Removes all the resource codes where companyId = &#63; from the database.
393            *
394            * @param companyId the company id to search with
395            * @throws SystemException if a system exception occurred
396            */
397            public void removeByCompanyId(long companyId)
398                    throws com.liferay.portal.kernel.exception.SystemException;
399    
400            /**
401            * Removes all the resource codes where name = &#63; from the database.
402            *
403            * @param name the name to search with
404            * @throws SystemException if a system exception occurred
405            */
406            public void removeByName(java.lang.String name)
407                    throws com.liferay.portal.kernel.exception.SystemException;
408    
409            /**
410            * Removes the resource code where companyId = &#63; and name = &#63; and scope = &#63; from the database.
411            *
412            * @param companyId the company id to search with
413            * @param name the name to search with
414            * @param scope the scope to search with
415            * @throws SystemException if a system exception occurred
416            */
417            public void removeByC_N_S(long companyId, java.lang.String name, int scope)
418                    throws com.liferay.portal.NoSuchResourceCodeException,
419                            com.liferay.portal.kernel.exception.SystemException;
420    
421            /**
422            * Removes all the resource codes from the database.
423            *
424            * @throws SystemException if a system exception occurred
425            */
426            public void removeAll()
427                    throws com.liferay.portal.kernel.exception.SystemException;
428    
429            /**
430            * Counts all the resource codes where companyId = &#63;.
431            *
432            * @param companyId the company id to search with
433            * @return the number of matching resource codes
434            * @throws SystemException if a system exception occurred
435            */
436            public int countByCompanyId(long companyId)
437                    throws com.liferay.portal.kernel.exception.SystemException;
438    
439            /**
440            * Counts all the resource codes where name = &#63;.
441            *
442            * @param name the name to search with
443            * @return the number of matching resource codes
444            * @throws SystemException if a system exception occurred
445            */
446            public int countByName(java.lang.String name)
447                    throws com.liferay.portal.kernel.exception.SystemException;
448    
449            /**
450            * Counts all the resource codes where companyId = &#63; and name = &#63; and scope = &#63;.
451            *
452            * @param companyId the company id to search with
453            * @param name the name to search with
454            * @param scope the scope to search with
455            * @return the number of matching resource codes
456            * @throws SystemException if a system exception occurred
457            */
458            public int countByC_N_S(long companyId, java.lang.String name, int scope)
459                    throws com.liferay.portal.kernel.exception.SystemException;
460    
461            /**
462            * Counts all the resource codes.
463            *
464            * @return the number of resource codes
465            * @throws SystemException if a system exception occurred
466            */
467            public int countAll()
468                    throws com.liferay.portal.kernel.exception.SystemException;
469    }