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