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