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