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.ResourcePermission;
018    
019    /**
020     * The persistence interface for the resource permission service.
021     *
022     * <p>
023     * Never modify or reference this interface directly. Always use {@link ResourcePermissionUtil} to access the resource permission 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 ResourcePermissionPersistenceImpl
032     * @see ResourcePermissionUtil
033     * @generated
034     */
035    public interface ResourcePermissionPersistence extends BasePersistence<ResourcePermission> {
036            /**
037            * Caches the resource permission in the entity cache if it is enabled.
038            *
039            * @param resourcePermission the resource permission to cache
040            */
041            public void cacheResult(
042                    com.liferay.portal.model.ResourcePermission resourcePermission);
043    
044            /**
045            * Caches the resource permissions in the entity cache if it is enabled.
046            *
047            * @param resourcePermissions the resource permissions to cache
048            */
049            public void cacheResult(
050                    java.util.List<com.liferay.portal.model.ResourcePermission> resourcePermissions);
051    
052            /**
053            * Creates a new resource permission with the primary key. Does not add the resource permission to the database.
054            *
055            * @param resourcePermissionId the primary key for the new resource permission
056            * @return the new resource permission
057            */
058            public com.liferay.portal.model.ResourcePermission create(
059                    long resourcePermissionId);
060    
061            /**
062            * Removes the resource permission with the primary key from the database. Also notifies the appropriate model listeners.
063            *
064            * @param resourcePermissionId the primary key of the resource permission to remove
065            * @return the resource permission that was removed
066            * @throws com.liferay.portal.NoSuchResourcePermissionException if a resource permission with the primary key could not be found
067            * @throws SystemException if a system exception occurred
068            */
069            public com.liferay.portal.model.ResourcePermission remove(
070                    long resourcePermissionId)
071                    throws com.liferay.portal.NoSuchResourcePermissionException,
072                            com.liferay.portal.kernel.exception.SystemException;
073    
074            public com.liferay.portal.model.ResourcePermission updateImpl(
075                    com.liferay.portal.model.ResourcePermission resourcePermission,
076                    boolean merge)
077                    throws com.liferay.portal.kernel.exception.SystemException;
078    
079            /**
080            * Finds the resource permission with the primary key or throws a {@link com.liferay.portal.NoSuchResourcePermissionException} if it could not be found.
081            *
082            * @param resourcePermissionId the primary key of the resource permission to find
083            * @return the resource permission
084            * @throws com.liferay.portal.NoSuchResourcePermissionException if a resource permission with the primary key could not be found
085            * @throws SystemException if a system exception occurred
086            */
087            public com.liferay.portal.model.ResourcePermission findByPrimaryKey(
088                    long resourcePermissionId)
089                    throws com.liferay.portal.NoSuchResourcePermissionException,
090                            com.liferay.portal.kernel.exception.SystemException;
091    
092            /**
093            * Finds the resource permission with the primary key or returns <code>null</code> if it could not be found.
094            *
095            * @param resourcePermissionId the primary key of the resource permission to find
096            * @return the resource permission, or <code>null</code> if a resource permission with the primary key could not be found
097            * @throws SystemException if a system exception occurred
098            */
099            public com.liferay.portal.model.ResourcePermission fetchByPrimaryKey(
100                    long resourcePermissionId)
101                    throws com.liferay.portal.kernel.exception.SystemException;
102    
103            /**
104            * Finds all the resource permissions where roleId = &#63;.
105            *
106            * @param roleId the role id to search with
107            * @return the matching resource permissions
108            * @throws SystemException if a system exception occurred
109            */
110            public java.util.List<com.liferay.portal.model.ResourcePermission> findByRoleId(
111                    long roleId) throws com.liferay.portal.kernel.exception.SystemException;
112    
113            /**
114            * Finds a range of all the resource permissions where roleId = &#63;.
115            *
116            * <p>
117            * 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.
118            * </p>
119            *
120            * @param roleId the role id to search with
121            * @param start the lower bound of the range of resource permissions to return
122            * @param end the upper bound of the range of resource permissions to return (not inclusive)
123            * @return the range of matching resource permissions
124            * @throws SystemException if a system exception occurred
125            */
126            public java.util.List<com.liferay.portal.model.ResourcePermission> findByRoleId(
127                    long roleId, int start, int end)
128                    throws com.liferay.portal.kernel.exception.SystemException;
129    
130            /**
131            * Finds an ordered range of all the resource permissions where roleId = &#63;.
132            *
133            * <p>
134            * 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.
135            * </p>
136            *
137            * @param roleId the role id to search with
138            * @param start the lower bound of the range of resource permissions to return
139            * @param end the upper bound of the range of resource permissions to return (not inclusive)
140            * @param orderByComparator the comparator to order the results by
141            * @return the ordered range of matching resource permissions
142            * @throws SystemException if a system exception occurred
143            */
144            public java.util.List<com.liferay.portal.model.ResourcePermission> findByRoleId(
145                    long roleId, int start, int end,
146                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
147                    throws com.liferay.portal.kernel.exception.SystemException;
148    
149            /**
150            * Finds the first resource permission in the ordered set where roleId = &#63;.
151            *
152            * <p>
153            * 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.
154            * </p>
155            *
156            * @param roleId the role id to search with
157            * @param orderByComparator the comparator to order the set by
158            * @return the first matching resource permission
159            * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found
160            * @throws SystemException if a system exception occurred
161            */
162            public com.liferay.portal.model.ResourcePermission findByRoleId_First(
163                    long roleId,
164                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
165                    throws com.liferay.portal.NoSuchResourcePermissionException,
166                            com.liferay.portal.kernel.exception.SystemException;
167    
168            /**
169            * Finds the last resource permission in the ordered set where roleId = &#63;.
170            *
171            * <p>
172            * 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.
173            * </p>
174            *
175            * @param roleId the role id to search with
176            * @param orderByComparator the comparator to order the set by
177            * @return the last matching resource permission
178            * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found
179            * @throws SystemException if a system exception occurred
180            */
181            public com.liferay.portal.model.ResourcePermission findByRoleId_Last(
182                    long roleId,
183                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
184                    throws com.liferay.portal.NoSuchResourcePermissionException,
185                            com.liferay.portal.kernel.exception.SystemException;
186    
187            /**
188            * Finds the resource permissions before and after the current resource permission in the ordered set where roleId = &#63;.
189            *
190            * <p>
191            * 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.
192            * </p>
193            *
194            * @param resourcePermissionId the primary key of the current resource permission
195            * @param roleId the role id to search with
196            * @param orderByComparator the comparator to order the set by
197            * @return the previous, current, and next resource permission
198            * @throws com.liferay.portal.NoSuchResourcePermissionException if a resource permission with the primary key could not be found
199            * @throws SystemException if a system exception occurred
200            */
201            public com.liferay.portal.model.ResourcePermission[] findByRoleId_PrevAndNext(
202                    long resourcePermissionId, long roleId,
203                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
204                    throws com.liferay.portal.NoSuchResourcePermissionException,
205                            com.liferay.portal.kernel.exception.SystemException;
206    
207            /**
208            * Finds all the resource permissions where roleId = &#63; and scope = &#63;.
209            *
210            * @param roleId the role id to search with
211            * @param scope the scope to search with
212            * @return the matching resource permissions
213            * @throws SystemException if a system exception occurred
214            */
215            public java.util.List<com.liferay.portal.model.ResourcePermission> findByR_S(
216                    long roleId, int scope)
217                    throws com.liferay.portal.kernel.exception.SystemException;
218    
219            /**
220            * Finds a range of all the resource permissions where roleId = &#63; and scope = &#63;.
221            *
222            * <p>
223            * 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.
224            * </p>
225            *
226            * @param roleId the role id to search with
227            * @param scope the scope to search with
228            * @param start the lower bound of the range of resource permissions to return
229            * @param end the upper bound of the range of resource permissions to return (not inclusive)
230            * @return the range of matching resource permissions
231            * @throws SystemException if a system exception occurred
232            */
233            public java.util.List<com.liferay.portal.model.ResourcePermission> findByR_S(
234                    long roleId, int scope, int start, int end)
235                    throws com.liferay.portal.kernel.exception.SystemException;
236    
237            /**
238            * Finds an ordered range of all the resource permissions where roleId = &#63; and scope = &#63;.
239            *
240            * <p>
241            * 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.
242            * </p>
243            *
244            * @param roleId the role id to search with
245            * @param scope the scope to search with
246            * @param start the lower bound of the range of resource permissions to return
247            * @param end the upper bound of the range of resource permissions to return (not inclusive)
248            * @param orderByComparator the comparator to order the results by
249            * @return the ordered range of matching resource permissions
250            * @throws SystemException if a system exception occurred
251            */
252            public java.util.List<com.liferay.portal.model.ResourcePermission> findByR_S(
253                    long roleId, int scope, int start, int end,
254                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
255                    throws com.liferay.portal.kernel.exception.SystemException;
256    
257            /**
258            * Finds the first resource permission in the ordered set where roleId = &#63; and scope = &#63;.
259            *
260            * <p>
261            * 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.
262            * </p>
263            *
264            * @param roleId the role id to search with
265            * @param scope the scope to search with
266            * @param orderByComparator the comparator to order the set by
267            * @return the first matching resource permission
268            * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found
269            * @throws SystemException if a system exception occurred
270            */
271            public com.liferay.portal.model.ResourcePermission findByR_S_First(
272                    long roleId, int scope,
273                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
274                    throws com.liferay.portal.NoSuchResourcePermissionException,
275                            com.liferay.portal.kernel.exception.SystemException;
276    
277            /**
278            * Finds the last resource permission in the ordered set where roleId = &#63; and scope = &#63;.
279            *
280            * <p>
281            * 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.
282            * </p>
283            *
284            * @param roleId the role id to search with
285            * @param scope the scope to search with
286            * @param orderByComparator the comparator to order the set by
287            * @return the last matching resource permission
288            * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found
289            * @throws SystemException if a system exception occurred
290            */
291            public com.liferay.portal.model.ResourcePermission findByR_S_Last(
292                    long roleId, int scope,
293                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
294                    throws com.liferay.portal.NoSuchResourcePermissionException,
295                            com.liferay.portal.kernel.exception.SystemException;
296    
297            /**
298            * Finds the resource permissions before and after the current resource permission in the ordered set where roleId = &#63; and scope = &#63;.
299            *
300            * <p>
301            * 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.
302            * </p>
303            *
304            * @param resourcePermissionId the primary key of the current resource permission
305            * @param roleId the role id to search with
306            * @param scope the scope to search with
307            * @param orderByComparator the comparator to order the set by
308            * @return the previous, current, and next resource permission
309            * @throws com.liferay.portal.NoSuchResourcePermissionException if a resource permission with the primary key could not be found
310            * @throws SystemException if a system exception occurred
311            */
312            public com.liferay.portal.model.ResourcePermission[] findByR_S_PrevAndNext(
313                    long resourcePermissionId, long roleId, int scope,
314                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
315                    throws com.liferay.portal.NoSuchResourcePermissionException,
316                            com.liferay.portal.kernel.exception.SystemException;
317    
318            /**
319            * Finds all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63;.
320            *
321            * @param companyId the company id to search with
322            * @param name the name to search with
323            * @param scope the scope to search with
324            * @return the matching resource permissions
325            * @throws SystemException if a system exception occurred
326            */
327            public java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S(
328                    long companyId, java.lang.String name, int scope)
329                    throws com.liferay.portal.kernel.exception.SystemException;
330    
331            /**
332            * Finds a range of all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63;.
333            *
334            * <p>
335            * 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.
336            * </p>
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            * @param start the lower bound of the range of resource permissions to return
342            * @param end the upper bound of the range of resource permissions to return (not inclusive)
343            * @return the range of matching resource permissions
344            * @throws SystemException if a system exception occurred
345            */
346            public java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S(
347                    long companyId, java.lang.String name, int scope, int start, int end)
348                    throws com.liferay.portal.kernel.exception.SystemException;
349    
350            /**
351            * Finds an ordered range of all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63;.
352            *
353            * <p>
354            * 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.
355            * </p>
356            *
357            * @param companyId the company id to search with
358            * @param name the name to search with
359            * @param scope the scope to search with
360            * @param start the lower bound of the range of resource permissions to return
361            * @param end the upper bound of the range of resource permissions to return (not inclusive)
362            * @param orderByComparator the comparator to order the results by
363            * @return the ordered range of matching resource permissions
364            * @throws SystemException if a system exception occurred
365            */
366            public java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S(
367                    long companyId, java.lang.String name, int scope, int start, int end,
368                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
369                    throws com.liferay.portal.kernel.exception.SystemException;
370    
371            /**
372            * Finds the first resource permission in the ordered set where companyId = &#63; and name = &#63; and scope = &#63;.
373            *
374            * <p>
375            * 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.
376            * </p>
377            *
378            * @param companyId the company id to search with
379            * @param name the name to search with
380            * @param scope the scope to search with
381            * @param orderByComparator the comparator to order the set by
382            * @return the first matching resource permission
383            * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found
384            * @throws SystemException if a system exception occurred
385            */
386            public com.liferay.portal.model.ResourcePermission findByC_N_S_First(
387                    long companyId, java.lang.String name, int scope,
388                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
389                    throws com.liferay.portal.NoSuchResourcePermissionException,
390                            com.liferay.portal.kernel.exception.SystemException;
391    
392            /**
393            * Finds the last resource permission in the ordered set where companyId = &#63; and name = &#63; and scope = &#63;.
394            *
395            * <p>
396            * 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.
397            * </p>
398            *
399            * @param companyId the company id to search with
400            * @param name the name to search with
401            * @param scope the scope to search with
402            * @param orderByComparator the comparator to order the set by
403            * @return the last matching resource permission
404            * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found
405            * @throws SystemException if a system exception occurred
406            */
407            public com.liferay.portal.model.ResourcePermission findByC_N_S_Last(
408                    long companyId, java.lang.String name, int scope,
409                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
410                    throws com.liferay.portal.NoSuchResourcePermissionException,
411                            com.liferay.portal.kernel.exception.SystemException;
412    
413            /**
414            * Finds the resource permissions before and after the current resource permission in the ordered set where companyId = &#63; and name = &#63; and scope = &#63;.
415            *
416            * <p>
417            * 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.
418            * </p>
419            *
420            * @param resourcePermissionId the primary key of the current resource permission
421            * @param companyId the company id to search with
422            * @param name the name to search with
423            * @param scope the scope to search with
424            * @param orderByComparator the comparator to order the set by
425            * @return the previous, current, and next resource permission
426            * @throws com.liferay.portal.NoSuchResourcePermissionException if a resource permission with the primary key could not be found
427            * @throws SystemException if a system exception occurred
428            */
429            public com.liferay.portal.model.ResourcePermission[] findByC_N_S_PrevAndNext(
430                    long resourcePermissionId, long companyId, java.lang.String name,
431                    int scope,
432                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
433                    throws com.liferay.portal.NoSuchResourcePermissionException,
434                            com.liferay.portal.kernel.exception.SystemException;
435    
436            /**
437            * Finds all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63;.
438            *
439            * @param companyId the company id to search with
440            * @param name the name to search with
441            * @param scope the scope to search with
442            * @param primKey the prim key to search with
443            * @return the matching resource permissions
444            * @throws SystemException if a system exception occurred
445            */
446            public java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S_P(
447                    long companyId, java.lang.String name, int scope,
448                    java.lang.String primKey)
449                    throws com.liferay.portal.kernel.exception.SystemException;
450    
451            /**
452            * Finds a range of all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63;.
453            *
454            * <p>
455            * 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.
456            * </p>
457            *
458            * @param companyId the company id to search with
459            * @param name the name to search with
460            * @param scope the scope to search with
461            * @param primKey the prim key to search with
462            * @param start the lower bound of the range of resource permissions to return
463            * @param end the upper bound of the range of resource permissions to return (not inclusive)
464            * @return the range of matching resource permissions
465            * @throws SystemException if a system exception occurred
466            */
467            public java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S_P(
468                    long companyId, java.lang.String name, int scope,
469                    java.lang.String primKey, int start, int end)
470                    throws com.liferay.portal.kernel.exception.SystemException;
471    
472            /**
473            * Finds an ordered range of all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63;.
474            *
475            * <p>
476            * 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.
477            * </p>
478            *
479            * @param companyId the company id to search with
480            * @param name the name to search with
481            * @param scope the scope to search with
482            * @param primKey the prim key to search with
483            * @param start the lower bound of the range of resource permissions to return
484            * @param end the upper bound of the range of resource permissions to return (not inclusive)
485            * @param orderByComparator the comparator to order the results by
486            * @return the ordered range of matching resource permissions
487            * @throws SystemException if a system exception occurred
488            */
489            public java.util.List<com.liferay.portal.model.ResourcePermission> findByC_N_S_P(
490                    long companyId, java.lang.String name, int scope,
491                    java.lang.String primKey, int start, int end,
492                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
493                    throws com.liferay.portal.kernel.exception.SystemException;
494    
495            /**
496            * Finds the first resource permission in the ordered set where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63;.
497            *
498            * <p>
499            * 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.
500            * </p>
501            *
502            * @param companyId the company id to search with
503            * @param name the name to search with
504            * @param scope the scope to search with
505            * @param primKey the prim key to search with
506            * @param orderByComparator the comparator to order the set by
507            * @return the first matching resource permission
508            * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found
509            * @throws SystemException if a system exception occurred
510            */
511            public com.liferay.portal.model.ResourcePermission findByC_N_S_P_First(
512                    long companyId, java.lang.String name, int scope,
513                    java.lang.String primKey,
514                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
515                    throws com.liferay.portal.NoSuchResourcePermissionException,
516                            com.liferay.portal.kernel.exception.SystemException;
517    
518            /**
519            * Finds the last resource permission in the ordered set where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63;.
520            *
521            * <p>
522            * 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.
523            * </p>
524            *
525            * @param companyId the company id to search with
526            * @param name the name to search with
527            * @param scope the scope to search with
528            * @param primKey the prim key to search with
529            * @param orderByComparator the comparator to order the set by
530            * @return the last matching resource permission
531            * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found
532            * @throws SystemException if a system exception occurred
533            */
534            public com.liferay.portal.model.ResourcePermission findByC_N_S_P_Last(
535                    long companyId, java.lang.String name, int scope,
536                    java.lang.String primKey,
537                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
538                    throws com.liferay.portal.NoSuchResourcePermissionException,
539                            com.liferay.portal.kernel.exception.SystemException;
540    
541            /**
542            * Finds the resource permissions before and after the current resource permission in the ordered set where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63;.
543            *
544            * <p>
545            * 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.
546            * </p>
547            *
548            * @param resourcePermissionId the primary key of the current resource permission
549            * @param companyId the company id to search with
550            * @param name the name to search with
551            * @param scope the scope to search with
552            * @param primKey the prim key to search with
553            * @param orderByComparator the comparator to order the set by
554            * @return the previous, current, and next resource permission
555            * @throws com.liferay.portal.NoSuchResourcePermissionException if a resource permission with the primary key could not be found
556            * @throws SystemException if a system exception occurred
557            */
558            public com.liferay.portal.model.ResourcePermission[] findByC_N_S_P_PrevAndNext(
559                    long resourcePermissionId, long companyId, java.lang.String name,
560                    int scope, java.lang.String primKey,
561                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
562                    throws com.liferay.portal.NoSuchResourcePermissionException,
563                            com.liferay.portal.kernel.exception.SystemException;
564    
565            /**
566            * Finds the resource permission where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63; and roleId = &#63; or throws a {@link com.liferay.portal.NoSuchResourcePermissionException} if it could not be found.
567            *
568            * @param companyId the company id to search with
569            * @param name the name to search with
570            * @param scope the scope to search with
571            * @param primKey the prim key to search with
572            * @param roleId the role id to search with
573            * @return the matching resource permission
574            * @throws com.liferay.portal.NoSuchResourcePermissionException if a matching resource permission could not be found
575            * @throws SystemException if a system exception occurred
576            */
577            public com.liferay.portal.model.ResourcePermission findByC_N_S_P_R(
578                    long companyId, java.lang.String name, int scope,
579                    java.lang.String primKey, long roleId)
580                    throws com.liferay.portal.NoSuchResourcePermissionException,
581                            com.liferay.portal.kernel.exception.SystemException;
582    
583            /**
584            * Finds the resource permission where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63; and roleId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
585            *
586            * @param companyId the company id to search with
587            * @param name the name to search with
588            * @param scope the scope to search with
589            * @param primKey the prim key to search with
590            * @param roleId the role id to search with
591            * @return the matching resource permission, or <code>null</code> if a matching resource permission could not be found
592            * @throws SystemException if a system exception occurred
593            */
594            public com.liferay.portal.model.ResourcePermission fetchByC_N_S_P_R(
595                    long companyId, java.lang.String name, int scope,
596                    java.lang.String primKey, long roleId)
597                    throws com.liferay.portal.kernel.exception.SystemException;
598    
599            /**
600            * Finds the resource permission where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63; and roleId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
601            *
602            * @param companyId the company id to search with
603            * @param name the name to search with
604            * @param scope the scope to search with
605            * @param primKey the prim key to search with
606            * @param roleId the role id to search with
607            * @return the matching resource permission, or <code>null</code> if a matching resource permission could not be found
608            * @throws SystemException if a system exception occurred
609            */
610            public com.liferay.portal.model.ResourcePermission fetchByC_N_S_P_R(
611                    long companyId, java.lang.String name, int scope,
612                    java.lang.String primKey, long roleId, boolean retrieveFromCache)
613                    throws com.liferay.portal.kernel.exception.SystemException;
614    
615            /**
616            * Finds all the resource permissions.
617            *
618            * @return the resource permissions
619            * @throws SystemException if a system exception occurred
620            */
621            public java.util.List<com.liferay.portal.model.ResourcePermission> findAll()
622                    throws com.liferay.portal.kernel.exception.SystemException;
623    
624            /**
625            * Finds a range of all the resource permissions.
626            *
627            * <p>
628            * 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.
629            * </p>
630            *
631            * @param start the lower bound of the range of resource permissions to return
632            * @param end the upper bound of the range of resource permissions to return (not inclusive)
633            * @return the range of resource permissions
634            * @throws SystemException if a system exception occurred
635            */
636            public java.util.List<com.liferay.portal.model.ResourcePermission> findAll(
637                    int start, int end)
638                    throws com.liferay.portal.kernel.exception.SystemException;
639    
640            /**
641            * Finds an ordered range of all the resource permissions.
642            *
643            * <p>
644            * 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.
645            * </p>
646            *
647            * @param start the lower bound of the range of resource permissions to return
648            * @param end the upper bound of the range of resource permissions to return (not inclusive)
649            * @param orderByComparator the comparator to order the results by
650            * @return the ordered range of resource permissions
651            * @throws SystemException if a system exception occurred
652            */
653            public java.util.List<com.liferay.portal.model.ResourcePermission> findAll(
654                    int start, int end,
655                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
656                    throws com.liferay.portal.kernel.exception.SystemException;
657    
658            /**
659            * Removes all the resource permissions where roleId = &#63; from the database.
660            *
661            * @param roleId the role id to search with
662            * @throws SystemException if a system exception occurred
663            */
664            public void removeByRoleId(long roleId)
665                    throws com.liferay.portal.kernel.exception.SystemException;
666    
667            /**
668            * Removes all the resource permissions where roleId = &#63; and scope = &#63; from the database.
669            *
670            * @param roleId the role id to search with
671            * @param scope the scope to search with
672            * @throws SystemException if a system exception occurred
673            */
674            public void removeByR_S(long roleId, int scope)
675                    throws com.liferay.portal.kernel.exception.SystemException;
676    
677            /**
678            * Removes all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; from the database.
679            *
680            * @param companyId the company id to search with
681            * @param name the name to search with
682            * @param scope the scope to search with
683            * @throws SystemException if a system exception occurred
684            */
685            public void removeByC_N_S(long companyId, java.lang.String name, int scope)
686                    throws com.liferay.portal.kernel.exception.SystemException;
687    
688            /**
689            * Removes all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63; from the database.
690            *
691            * @param companyId the company id to search with
692            * @param name the name to search with
693            * @param scope the scope to search with
694            * @param primKey the prim key to search with
695            * @throws SystemException if a system exception occurred
696            */
697            public void removeByC_N_S_P(long companyId, java.lang.String name,
698                    int scope, java.lang.String primKey)
699                    throws com.liferay.portal.kernel.exception.SystemException;
700    
701            /**
702            * Removes the resource permission where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63; and roleId = &#63; from the database.
703            *
704            * @param companyId the company id to search with
705            * @param name the name to search with
706            * @param scope the scope to search with
707            * @param primKey the prim key to search with
708            * @param roleId the role id to search with
709            * @throws SystemException if a system exception occurred
710            */
711            public void removeByC_N_S_P_R(long companyId, java.lang.String name,
712                    int scope, java.lang.String primKey, long roleId)
713                    throws com.liferay.portal.NoSuchResourcePermissionException,
714                            com.liferay.portal.kernel.exception.SystemException;
715    
716            /**
717            * Removes all the resource permissions from the database.
718            *
719            * @throws SystemException if a system exception occurred
720            */
721            public void removeAll()
722                    throws com.liferay.portal.kernel.exception.SystemException;
723    
724            /**
725            * Counts all the resource permissions where roleId = &#63;.
726            *
727            * @param roleId the role id to search with
728            * @return the number of matching resource permissions
729            * @throws SystemException if a system exception occurred
730            */
731            public int countByRoleId(long roleId)
732                    throws com.liferay.portal.kernel.exception.SystemException;
733    
734            /**
735            * Counts all the resource permissions where roleId = &#63; and scope = &#63;.
736            *
737            * @param roleId the role id to search with
738            * @param scope the scope to search with
739            * @return the number of matching resource permissions
740            * @throws SystemException if a system exception occurred
741            */
742            public int countByR_S(long roleId, int scope)
743                    throws com.liferay.portal.kernel.exception.SystemException;
744    
745            /**
746            * Counts all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63;.
747            *
748            * @param companyId the company id to search with
749            * @param name the name to search with
750            * @param scope the scope to search with
751            * @return the number of matching resource permissions
752            * @throws SystemException if a system exception occurred
753            */
754            public int countByC_N_S(long companyId, java.lang.String name, int scope)
755                    throws com.liferay.portal.kernel.exception.SystemException;
756    
757            /**
758            * Counts all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63;.
759            *
760            * @param companyId the company id to search with
761            * @param name the name to search with
762            * @param scope the scope to search with
763            * @param primKey the prim key to search with
764            * @return the number of matching resource permissions
765            * @throws SystemException if a system exception occurred
766            */
767            public int countByC_N_S_P(long companyId, java.lang.String name, int scope,
768                    java.lang.String primKey)
769                    throws com.liferay.portal.kernel.exception.SystemException;
770    
771            /**
772            * Counts all the resource permissions where companyId = &#63; and name = &#63; and scope = &#63; and primKey = &#63; and roleId = &#63;.
773            *
774            * @param companyId the company id to search with
775            * @param name the name to search with
776            * @param scope the scope to search with
777            * @param primKey the prim key to search with
778            * @param roleId the role id to search with
779            * @return the number of matching resource permissions
780            * @throws SystemException if a system exception occurred
781            */
782            public int countByC_N_S_P_R(long companyId, java.lang.String name,
783                    int scope, java.lang.String primKey, long roleId)
784                    throws com.liferay.portal.kernel.exception.SystemException;
785    
786            /**
787            * Counts all the resource permissions.
788            *
789            * @return the number of resource permissions
790            * @throws SystemException if a system exception occurred
791            */
792            public int countAll()
793                    throws com.liferay.portal.kernel.exception.SystemException;
794    }