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