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