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