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.ResourceCode;
018    
019    /**
020     * The persistence interface for the resource code 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 ResourceCodePersistenceImpl
028     * @see ResourceCodeUtil
029     * @generated
030     */
031    public interface ResourceCodePersistence extends BasePersistence<ResourceCode> {
032            /*
033             * NOTE FOR DEVELOPERS:
034             *
035             * 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.
036             */
037    
038            /**
039            * Caches the resource code in the entity cache if it is enabled.
040            *
041            * @param resourceCode the resource code
042            */
043            public void cacheResult(com.liferay.portal.model.ResourceCode resourceCode);
044    
045            /**
046            * Caches the resource codes in the entity cache if it is enabled.
047            *
048            * @param resourceCodes the resource codes
049            */
050            public void cacheResult(
051                    java.util.List<com.liferay.portal.model.ResourceCode> resourceCodes);
052    
053            /**
054            * Creates a new resource code with the primary key. Does not add the resource code to the database.
055            *
056            * @param codeId the primary key for the new resource code
057            * @return the new resource code
058            */
059            public com.liferay.portal.model.ResourceCode create(long codeId);
060    
061            /**
062            * Removes the resource code with the primary key from the database. Also notifies the appropriate model listeners.
063            *
064            * @param codeId the primary key of the resource code
065            * @return the resource code that was removed
066            * @throws com.liferay.portal.NoSuchResourceCodeException if a resource code with the primary key could not be found
067            * @throws SystemException if a system exception occurred
068            */
069            public com.liferay.portal.model.ResourceCode remove(long codeId)
070                    throws com.liferay.portal.NoSuchResourceCodeException,
071                            com.liferay.portal.kernel.exception.SystemException;
072    
073            public com.liferay.portal.model.ResourceCode updateImpl(
074                    com.liferay.portal.model.ResourceCode resourceCode, boolean merge)
075                    throws com.liferay.portal.kernel.exception.SystemException;
076    
077            /**
078            * Returns the resource code with the primary key or throws a {@link com.liferay.portal.NoSuchResourceCodeException} if it could not be found.
079            *
080            * @param codeId the primary key of the resource code
081            * @return the resource code
082            * @throws com.liferay.portal.NoSuchResourceCodeException if a resource code with the primary key could not be found
083            * @throws SystemException if a system exception occurred
084            */
085            public com.liferay.portal.model.ResourceCode findByPrimaryKey(long codeId)
086                    throws com.liferay.portal.NoSuchResourceCodeException,
087                            com.liferay.portal.kernel.exception.SystemException;
088    
089            /**
090            * Returns the resource code with the primary key or returns <code>null</code> if it could not be found.
091            *
092            * @param codeId the primary key of the resource code
093            * @return the resource code, or <code>null</code> if a resource code with the primary key could not be found
094            * @throws SystemException if a system exception occurred
095            */
096            public com.liferay.portal.model.ResourceCode fetchByPrimaryKey(long codeId)
097                    throws com.liferay.portal.kernel.exception.SystemException;
098    
099            /**
100            * Returns all the resource codes where companyId = &#63;.
101            *
102            * @param companyId the company ID
103            * @return the matching resource codes
104            * @throws SystemException if a system exception occurred
105            */
106            public java.util.List<com.liferay.portal.model.ResourceCode> findByCompanyId(
107                    long companyId)
108                    throws com.liferay.portal.kernel.exception.SystemException;
109    
110            /**
111            * Returns a range of all the resource codes where companyId = &#63;.
112            *
113            * <p>
114            * 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.
115            * </p>
116            *
117            * @param companyId the company ID
118            * @param start the lower bound of the range of resource codes
119            * @param end the upper bound of the range of resource codes (not inclusive)
120            * @return the range of matching resource codes
121            * @throws SystemException if a system exception occurred
122            */
123            public java.util.List<com.liferay.portal.model.ResourceCode> findByCompanyId(
124                    long companyId, int start, int end)
125                    throws com.liferay.portal.kernel.exception.SystemException;
126    
127            /**
128            * Returns an ordered range of all the resource codes where companyId = &#63;.
129            *
130            * <p>
131            * 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.
132            * </p>
133            *
134            * @param companyId the company ID
135            * @param start the lower bound of the range of resource codes
136            * @param end the upper bound of the range of resource codes (not inclusive)
137            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
138            * @return the ordered range of matching resource codes
139            * @throws SystemException if a system exception occurred
140            */
141            public java.util.List<com.liferay.portal.model.ResourceCode> findByCompanyId(
142                    long companyId, int start, int end,
143                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
144                    throws com.liferay.portal.kernel.exception.SystemException;
145    
146            /**
147            * Returns the first resource code in the ordered set where companyId = &#63;.
148            *
149            * <p>
150            * 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.
151            * </p>
152            *
153            * @param companyId the company ID
154            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
155            * @return the first matching resource code
156            * @throws com.liferay.portal.NoSuchResourceCodeException if a matching resource code could not be found
157            * @throws SystemException if a system exception occurred
158            */
159            public com.liferay.portal.model.ResourceCode findByCompanyId_First(
160                    long companyId,
161                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
162                    throws com.liferay.portal.NoSuchResourceCodeException,
163                            com.liferay.portal.kernel.exception.SystemException;
164    
165            /**
166            * Returns the last resource code in the ordered set where companyId = &#63;.
167            *
168            * <p>
169            * 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.
170            * </p>
171            *
172            * @param companyId the company ID
173            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
174            * @return the last matching resource code
175            * @throws com.liferay.portal.NoSuchResourceCodeException if a matching resource code could not be found
176            * @throws SystemException if a system exception occurred
177            */
178            public com.liferay.portal.model.ResourceCode findByCompanyId_Last(
179                    long companyId,
180                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
181                    throws com.liferay.portal.NoSuchResourceCodeException,
182                            com.liferay.portal.kernel.exception.SystemException;
183    
184            /**
185            * Returns the resource codes before and after the current resource code in the ordered set where companyId = &#63;.
186            *
187            * <p>
188            * 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.
189            * </p>
190            *
191            * @param codeId the primary key of the current resource code
192            * @param companyId the company ID
193            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
194            * @return the previous, current, and next resource code
195            * @throws com.liferay.portal.NoSuchResourceCodeException if a resource code with the primary key could not be found
196            * @throws SystemException if a system exception occurred
197            */
198            public com.liferay.portal.model.ResourceCode[] findByCompanyId_PrevAndNext(
199                    long codeId, long companyId,
200                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
201                    throws com.liferay.portal.NoSuchResourceCodeException,
202                            com.liferay.portal.kernel.exception.SystemException;
203    
204            /**
205            * Returns all the resource codes where name = &#63;.
206            *
207            * @param name the name
208            * @return the matching resource codes
209            * @throws SystemException if a system exception occurred
210            */
211            public java.util.List<com.liferay.portal.model.ResourceCode> findByName(
212                    java.lang.String name)
213                    throws com.liferay.portal.kernel.exception.SystemException;
214    
215            /**
216            * Returns a range of all the resource codes where name = &#63;.
217            *
218            * <p>
219            * 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.
220            * </p>
221            *
222            * @param name the name
223            * @param start the lower bound of the range of resource codes
224            * @param end the upper bound of the range of resource codes (not inclusive)
225            * @return the range of matching resource codes
226            * @throws SystemException if a system exception occurred
227            */
228            public java.util.List<com.liferay.portal.model.ResourceCode> findByName(
229                    java.lang.String name, int start, int end)
230                    throws com.liferay.portal.kernel.exception.SystemException;
231    
232            /**
233            * Returns an ordered range of all the resource codes where name = &#63;.
234            *
235            * <p>
236            * 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.
237            * </p>
238            *
239            * @param name the name
240            * @param start the lower bound of the range of resource codes
241            * @param end the upper bound of the range of resource codes (not inclusive)
242            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
243            * @return the ordered range of matching resource codes
244            * @throws SystemException if a system exception occurred
245            */
246            public java.util.List<com.liferay.portal.model.ResourceCode> findByName(
247                    java.lang.String name, int start, int end,
248                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
249                    throws com.liferay.portal.kernel.exception.SystemException;
250    
251            /**
252            * Returns the first resource code in the ordered set where name = &#63;.
253            *
254            * <p>
255            * 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.
256            * </p>
257            *
258            * @param name the name
259            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
260            * @return the first matching resource code
261            * @throws com.liferay.portal.NoSuchResourceCodeException if a matching resource code could not be found
262            * @throws SystemException if a system exception occurred
263            */
264            public com.liferay.portal.model.ResourceCode findByName_First(
265                    java.lang.String name,
266                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
267                    throws com.liferay.portal.NoSuchResourceCodeException,
268                            com.liferay.portal.kernel.exception.SystemException;
269    
270            /**
271            * Returns the last resource code in the ordered set where name = &#63;.
272            *
273            * <p>
274            * 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.
275            * </p>
276            *
277            * @param name the name
278            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
279            * @return the last matching resource code
280            * @throws com.liferay.portal.NoSuchResourceCodeException if a matching resource code could not be found
281            * @throws SystemException if a system exception occurred
282            */
283            public com.liferay.portal.model.ResourceCode findByName_Last(
284                    java.lang.String name,
285                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
286                    throws com.liferay.portal.NoSuchResourceCodeException,
287                            com.liferay.portal.kernel.exception.SystemException;
288    
289            /**
290            * Returns the resource codes before and after the current resource code in the ordered set where name = &#63;.
291            *
292            * <p>
293            * 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.
294            * </p>
295            *
296            * @param codeId the primary key of the current resource code
297            * @param name the name
298            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
299            * @return the previous, current, and next resource code
300            * @throws com.liferay.portal.NoSuchResourceCodeException if a resource code with the primary key could not be found
301            * @throws SystemException if a system exception occurred
302            */
303            public com.liferay.portal.model.ResourceCode[] findByName_PrevAndNext(
304                    long codeId, java.lang.String name,
305                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
306                    throws com.liferay.portal.NoSuchResourceCodeException,
307                            com.liferay.portal.kernel.exception.SystemException;
308    
309            /**
310            * Returns 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.
311            *
312            * @param companyId the company ID
313            * @param name the name
314            * @param scope the scope
315            * @return the matching resource code
316            * @throws com.liferay.portal.NoSuchResourceCodeException if a matching resource code could not be found
317            * @throws SystemException if a system exception occurred
318            */
319            public com.liferay.portal.model.ResourceCode findByC_N_S(long companyId,
320                    java.lang.String name, int scope)
321                    throws com.liferay.portal.NoSuchResourceCodeException,
322                            com.liferay.portal.kernel.exception.SystemException;
323    
324            /**
325            * Returns 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.
326            *
327            * @param companyId the company ID
328            * @param name the name
329            * @param scope the scope
330            * @return the matching resource code, or <code>null</code> if a matching resource code could not be found
331            * @throws SystemException if a system exception occurred
332            */
333            public com.liferay.portal.model.ResourceCode fetchByC_N_S(long companyId,
334                    java.lang.String name, int scope)
335                    throws com.liferay.portal.kernel.exception.SystemException;
336    
337            /**
338            * Returns 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.
339            *
340            * @param companyId the company ID
341            * @param name the name
342            * @param scope the scope
343            * @param retrieveFromCache whether to use the finder cache
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            * Returns 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            * Returns 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
368            * @param end the upper bound of the range of resource codes (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            * Returns 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
384            * @param end the upper bound of the range of resource codes (not inclusive)
385            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
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
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
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
416            * @param name the name
417            * @param scope the scope
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            * Returns the number of resource codes where companyId = &#63;.
434            *
435            * @param companyId the company ID
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            * Returns the number of resource codes where name = &#63;.
444            *
445            * @param name the name
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            * Returns the number of resource codes where companyId = &#63; and name = &#63; and scope = &#63;.
454            *
455            * @param companyId the company ID
456            * @param name the name
457            * @param scope the scope
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            * Returns the number of 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    }