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.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
019    import com.liferay.portal.kernel.exception.SystemException;
020    import com.liferay.portal.kernel.util.OrderByComparator;
021    import com.liferay.portal.kernel.util.ReferenceRegistry;
022    import com.liferay.portal.model.LayoutSet;
023    import com.liferay.portal.service.ServiceContext;
024    
025    import java.util.List;
026    
027    /**
028     * The persistence utility for the layout set service. This utility wraps {@link LayoutSetPersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
029     *
030     * <p>
031     * Caching information and settings can be found in <code>portal.properties</code>
032     * </p>
033     *
034     * @author Brian Wing Shun Chan
035     * @see LayoutSetPersistence
036     * @see LayoutSetPersistenceImpl
037     * @generated
038     */
039    public class LayoutSetUtil {
040            /*
041             * NOTE FOR DEVELOPERS:
042             *
043             * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
044             */
045    
046            /**
047             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
048             */
049            public static void clearCache() {
050                    getPersistence().clearCache();
051            }
052    
053            /**
054             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
055             */
056            public static void clearCache(LayoutSet layoutSet) {
057                    getPersistence().clearCache(layoutSet);
058            }
059    
060            /**
061             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
062             */
063            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
064                    throws SystemException {
065                    return getPersistence().countWithDynamicQuery(dynamicQuery);
066            }
067    
068            /**
069             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
070             */
071            public static List<LayoutSet> findWithDynamicQuery(
072                    DynamicQuery dynamicQuery) throws SystemException {
073                    return getPersistence().findWithDynamicQuery(dynamicQuery);
074            }
075    
076            /**
077             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
078             */
079            public static List<LayoutSet> findWithDynamicQuery(
080                    DynamicQuery dynamicQuery, int start, int end)
081                    throws SystemException {
082                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
083            }
084    
085            /**
086             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
087             */
088            public static List<LayoutSet> findWithDynamicQuery(
089                    DynamicQuery dynamicQuery, int start, int end,
090                    OrderByComparator orderByComparator) throws SystemException {
091                    return getPersistence()
092                                       .findWithDynamicQuery(dynamicQuery, start, end,
093                            orderByComparator);
094            }
095    
096            /**
097             * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
098             */
099            public static LayoutSet remove(LayoutSet layoutSet)
100                    throws SystemException {
101                    return getPersistence().remove(layoutSet);
102            }
103    
104            /**
105             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
106             */
107            public static LayoutSet update(LayoutSet layoutSet, boolean merge)
108                    throws SystemException {
109                    return getPersistence().update(layoutSet, merge);
110            }
111    
112            /**
113             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
114             */
115            public static LayoutSet update(LayoutSet layoutSet, boolean merge,
116                    ServiceContext serviceContext) throws SystemException {
117                    return getPersistence().update(layoutSet, merge, serviceContext);
118            }
119    
120            /**
121            * Caches the layout set in the entity cache if it is enabled.
122            *
123            * @param layoutSet the layout set to cache
124            */
125            public static void cacheResult(com.liferay.portal.model.LayoutSet layoutSet) {
126                    getPersistence().cacheResult(layoutSet);
127            }
128    
129            /**
130            * Caches the layout sets in the entity cache if it is enabled.
131            *
132            * @param layoutSets the layout sets to cache
133            */
134            public static void cacheResult(
135                    java.util.List<com.liferay.portal.model.LayoutSet> layoutSets) {
136                    getPersistence().cacheResult(layoutSets);
137            }
138    
139            /**
140            * Creates a new layout set with the primary key. Does not add the layout set to the database.
141            *
142            * @param layoutSetId the primary key for the new layout set
143            * @return the new layout set
144            */
145            public static com.liferay.portal.model.LayoutSet create(long layoutSetId) {
146                    return getPersistence().create(layoutSetId);
147            }
148    
149            /**
150            * Removes the layout set with the primary key from the database. Also notifies the appropriate model listeners.
151            *
152            * @param layoutSetId the primary key of the layout set to remove
153            * @return the layout set that was removed
154            * @throws com.liferay.portal.NoSuchLayoutSetException if a layout set with the primary key could not be found
155            * @throws SystemException if a system exception occurred
156            */
157            public static com.liferay.portal.model.LayoutSet remove(long layoutSetId)
158                    throws com.liferay.portal.NoSuchLayoutSetException,
159                            com.liferay.portal.kernel.exception.SystemException {
160                    return getPersistence().remove(layoutSetId);
161            }
162    
163            public static com.liferay.portal.model.LayoutSet updateImpl(
164                    com.liferay.portal.model.LayoutSet layoutSet, boolean merge)
165                    throws com.liferay.portal.kernel.exception.SystemException {
166                    return getPersistence().updateImpl(layoutSet, merge);
167            }
168    
169            /**
170            * Finds the layout set with the primary key or throws a {@link com.liferay.portal.NoSuchLayoutSetException} if it could not be found.
171            *
172            * @param layoutSetId the primary key of the layout set to find
173            * @return the layout set
174            * @throws com.liferay.portal.NoSuchLayoutSetException if a layout set with the primary key could not be found
175            * @throws SystemException if a system exception occurred
176            */
177            public static com.liferay.portal.model.LayoutSet findByPrimaryKey(
178                    long layoutSetId)
179                    throws com.liferay.portal.NoSuchLayoutSetException,
180                            com.liferay.portal.kernel.exception.SystemException {
181                    return getPersistence().findByPrimaryKey(layoutSetId);
182            }
183    
184            /**
185            * Finds the layout set with the primary key or returns <code>null</code> if it could not be found.
186            *
187            * @param layoutSetId the primary key of the layout set to find
188            * @return the layout set, or <code>null</code> if a layout set with the primary key could not be found
189            * @throws SystemException if a system exception occurred
190            */
191            public static com.liferay.portal.model.LayoutSet fetchByPrimaryKey(
192                    long layoutSetId)
193                    throws com.liferay.portal.kernel.exception.SystemException {
194                    return getPersistence().fetchByPrimaryKey(layoutSetId);
195            }
196    
197            /**
198            * Finds all the layout sets where groupId = &#63;.
199            *
200            * @param groupId the group ID to search with
201            * @return the matching layout sets
202            * @throws SystemException if a system exception occurred
203            */
204            public static java.util.List<com.liferay.portal.model.LayoutSet> findByGroupId(
205                    long groupId)
206                    throws com.liferay.portal.kernel.exception.SystemException {
207                    return getPersistence().findByGroupId(groupId);
208            }
209    
210            /**
211            * Finds a range of all the layout sets where groupId = &#63;.
212            *
213            * <p>
214            * 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.
215            * </p>
216            *
217            * @param groupId the group ID to search with
218            * @param start the lower bound of the range of layout sets to return
219            * @param end the upper bound of the range of layout sets to return (not inclusive)
220            * @return the range of matching layout sets
221            * @throws SystemException if a system exception occurred
222            */
223            public static java.util.List<com.liferay.portal.model.LayoutSet> findByGroupId(
224                    long groupId, int start, int end)
225                    throws com.liferay.portal.kernel.exception.SystemException {
226                    return getPersistence().findByGroupId(groupId, start, end);
227            }
228    
229            /**
230            * Finds an ordered range of all the layout sets where groupId = &#63;.
231            *
232            * <p>
233            * 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.
234            * </p>
235            *
236            * @param groupId the group ID to search with
237            * @param start the lower bound of the range of layout sets to return
238            * @param end the upper bound of the range of layout sets to return (not inclusive)
239            * @param orderByComparator the comparator to order the results by
240            * @return the ordered range of matching layout sets
241            * @throws SystemException if a system exception occurred
242            */
243            public static java.util.List<com.liferay.portal.model.LayoutSet> findByGroupId(
244                    long groupId, int start, int end,
245                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
246                    throws com.liferay.portal.kernel.exception.SystemException {
247                    return getPersistence()
248                                       .findByGroupId(groupId, start, end, orderByComparator);
249            }
250    
251            /**
252            * Finds the first layout set in the ordered set where groupId = &#63;.
253            *
254            * <p>
255            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
256            * </p>
257            *
258            * @param groupId the group ID to search with
259            * @param orderByComparator the comparator to order the set by
260            * @return the first matching layout set
261            * @throws com.liferay.portal.NoSuchLayoutSetException if a matching layout set could not be found
262            * @throws SystemException if a system exception occurred
263            */
264            public static com.liferay.portal.model.LayoutSet findByGroupId_First(
265                    long groupId,
266                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
267                    throws com.liferay.portal.NoSuchLayoutSetException,
268                            com.liferay.portal.kernel.exception.SystemException {
269                    return getPersistence().findByGroupId_First(groupId, orderByComparator);
270            }
271    
272            /**
273            * Finds the last layout set in the ordered set where groupId = &#63;.
274            *
275            * <p>
276            * 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.
277            * </p>
278            *
279            * @param groupId the group ID to search with
280            * @param orderByComparator the comparator to order the set by
281            * @return the last matching layout set
282            * @throws com.liferay.portal.NoSuchLayoutSetException if a matching layout set could not be found
283            * @throws SystemException if a system exception occurred
284            */
285            public static com.liferay.portal.model.LayoutSet findByGroupId_Last(
286                    long groupId,
287                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
288                    throws com.liferay.portal.NoSuchLayoutSetException,
289                            com.liferay.portal.kernel.exception.SystemException {
290                    return getPersistence().findByGroupId_Last(groupId, orderByComparator);
291            }
292    
293            /**
294            * Finds the layout sets before and after the current layout set in the ordered set where groupId = &#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 layoutSetId the primary key of the current layout set
301            * @param groupId the group ID to search with
302            * @param orderByComparator the comparator to order the set by
303            * @return the previous, current, and next layout set
304            * @throws com.liferay.portal.NoSuchLayoutSetException if a layout set with the primary key could not be found
305            * @throws SystemException if a system exception occurred
306            */
307            public static com.liferay.portal.model.LayoutSet[] findByGroupId_PrevAndNext(
308                    long layoutSetId, long groupId,
309                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
310                    throws com.liferay.portal.NoSuchLayoutSetException,
311                            com.liferay.portal.kernel.exception.SystemException {
312                    return getPersistence()
313                                       .findByGroupId_PrevAndNext(layoutSetId, groupId,
314                            orderByComparator);
315            }
316    
317            /**
318            * Finds the layout set where groupId = &#63; and privateLayout = &#63; or throws a {@link com.liferay.portal.NoSuchLayoutSetException} if it could not be found.
319            *
320            * @param groupId the group ID to search with
321            * @param privateLayout the private layout to search with
322            * @return the matching layout set
323            * @throws com.liferay.portal.NoSuchLayoutSetException if a matching layout set could not be found
324            * @throws SystemException if a system exception occurred
325            */
326            public static com.liferay.portal.model.LayoutSet findByG_P(long groupId,
327                    boolean privateLayout)
328                    throws com.liferay.portal.NoSuchLayoutSetException,
329                            com.liferay.portal.kernel.exception.SystemException {
330                    return getPersistence().findByG_P(groupId, privateLayout);
331            }
332    
333            /**
334            * Finds the layout set where groupId = &#63; and privateLayout = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
335            *
336            * @param groupId the group ID to search with
337            * @param privateLayout the private layout to search with
338            * @return the matching layout set, or <code>null</code> if a matching layout set could not be found
339            * @throws SystemException if a system exception occurred
340            */
341            public static com.liferay.portal.model.LayoutSet fetchByG_P(long groupId,
342                    boolean privateLayout)
343                    throws com.liferay.portal.kernel.exception.SystemException {
344                    return getPersistence().fetchByG_P(groupId, privateLayout);
345            }
346    
347            /**
348            * Finds the layout set where groupId = &#63; and privateLayout = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
349            *
350            * @param groupId the group ID to search with
351            * @param privateLayout the private layout to search with
352            * @return the matching layout set, or <code>null</code> if a matching layout set could not be found
353            * @throws SystemException if a system exception occurred
354            */
355            public static com.liferay.portal.model.LayoutSet fetchByG_P(long groupId,
356                    boolean privateLayout, boolean retrieveFromCache)
357                    throws com.liferay.portal.kernel.exception.SystemException {
358                    return getPersistence()
359                                       .fetchByG_P(groupId, privateLayout, retrieveFromCache);
360            }
361    
362            /**
363            * Finds all the layout sets.
364            *
365            * @return the layout sets
366            * @throws SystemException if a system exception occurred
367            */
368            public static java.util.List<com.liferay.portal.model.LayoutSet> findAll()
369                    throws com.liferay.portal.kernel.exception.SystemException {
370                    return getPersistence().findAll();
371            }
372    
373            /**
374            * Finds a range of all the layout sets.
375            *
376            * <p>
377            * 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.
378            * </p>
379            *
380            * @param start the lower bound of the range of layout sets to return
381            * @param end the upper bound of the range of layout sets to return (not inclusive)
382            * @return the range of layout sets
383            * @throws SystemException if a system exception occurred
384            */
385            public static java.util.List<com.liferay.portal.model.LayoutSet> findAll(
386                    int start, int end)
387                    throws com.liferay.portal.kernel.exception.SystemException {
388                    return getPersistence().findAll(start, end);
389            }
390    
391            /**
392            * Finds an ordered range of all the layout sets.
393            *
394            * <p>
395            * 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.
396            * </p>
397            *
398            * @param start the lower bound of the range of layout sets to return
399            * @param end the upper bound of the range of layout sets to return (not inclusive)
400            * @param orderByComparator the comparator to order the results by
401            * @return the ordered range of layout sets
402            * @throws SystemException if a system exception occurred
403            */
404            public static java.util.List<com.liferay.portal.model.LayoutSet> findAll(
405                    int start, int end,
406                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
407                    throws com.liferay.portal.kernel.exception.SystemException {
408                    return getPersistence().findAll(start, end, orderByComparator);
409            }
410    
411            /**
412            * Removes all the layout sets where groupId = &#63; from the database.
413            *
414            * @param groupId the group ID to search with
415            * @throws SystemException if a system exception occurred
416            */
417            public static void removeByGroupId(long groupId)
418                    throws com.liferay.portal.kernel.exception.SystemException {
419                    getPersistence().removeByGroupId(groupId);
420            }
421    
422            /**
423            * Removes the layout set where groupId = &#63; and privateLayout = &#63; from the database.
424            *
425            * @param groupId the group ID to search with
426            * @param privateLayout the private layout to search with
427            * @throws SystemException if a system exception occurred
428            */
429            public static void removeByG_P(long groupId, boolean privateLayout)
430                    throws com.liferay.portal.NoSuchLayoutSetException,
431                            com.liferay.portal.kernel.exception.SystemException {
432                    getPersistence().removeByG_P(groupId, privateLayout);
433            }
434    
435            /**
436            * Removes all the layout sets from the database.
437            *
438            * @throws SystemException if a system exception occurred
439            */
440            public static void removeAll()
441                    throws com.liferay.portal.kernel.exception.SystemException {
442                    getPersistence().removeAll();
443            }
444    
445            /**
446            * Counts all the layout sets where groupId = &#63;.
447            *
448            * @param groupId the group ID to search with
449            * @return the number of matching layout sets
450            * @throws SystemException if a system exception occurred
451            */
452            public static int countByGroupId(long groupId)
453                    throws com.liferay.portal.kernel.exception.SystemException {
454                    return getPersistence().countByGroupId(groupId);
455            }
456    
457            /**
458            * Counts all the layout sets where groupId = &#63; and privateLayout = &#63;.
459            *
460            * @param groupId the group ID to search with
461            * @param privateLayout the private layout to search with
462            * @return the number of matching layout sets
463            * @throws SystemException if a system exception occurred
464            */
465            public static int countByG_P(long groupId, boolean privateLayout)
466                    throws com.liferay.portal.kernel.exception.SystemException {
467                    return getPersistence().countByG_P(groupId, privateLayout);
468            }
469    
470            /**
471            * Counts all the layout sets.
472            *
473            * @return the number of layout sets
474            * @throws SystemException if a system exception occurred
475            */
476            public static int countAll()
477                    throws com.liferay.portal.kernel.exception.SystemException {
478                    return getPersistence().countAll();
479            }
480    
481            public static LayoutSetPersistence getPersistence() {
482                    if (_persistence == null) {
483                            _persistence = (LayoutSetPersistence)PortalBeanLocatorUtil.locate(LayoutSetPersistence.class.getName());
484    
485                            ReferenceRegistry.registerReference(LayoutSetUtil.class,
486                                    "_persistence");
487                    }
488    
489                    return _persistence;
490            }
491    
492            public void setPersistence(LayoutSetPersistence persistence) {
493                    _persistence = persistence;
494    
495                    ReferenceRegistry.registerReference(LayoutSetUtil.class, "_persistence");
496            }
497    
498            private static LayoutSetPersistence _persistence;
499    }