1   /**
2    * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.service.persistence;
24  
25  /**
26   * <a href="LayoutSetUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class LayoutSetUtil {
32      public static com.liferay.portal.model.LayoutSet create(long layoutSetId) {
33          return getPersistence().create(layoutSetId);
34      }
35  
36      public static com.liferay.portal.model.LayoutSet remove(long layoutSetId)
37          throws com.liferay.portal.SystemException,
38              com.liferay.portal.NoSuchLayoutSetException {
39          return getPersistence().remove(layoutSetId);
40      }
41  
42      public static com.liferay.portal.model.LayoutSet remove(
43          com.liferay.portal.model.LayoutSet layoutSet)
44          throws com.liferay.portal.SystemException {
45          return getPersistence().remove(layoutSet);
46      }
47  
48      /**
49       * @deprecated Use <code>update(LayoutSet layoutSet, boolean merge)</code>.
50       */
51      public static com.liferay.portal.model.LayoutSet update(
52          com.liferay.portal.model.LayoutSet layoutSet)
53          throws com.liferay.portal.SystemException {
54          return getPersistence().update(layoutSet);
55      }
56  
57      /**
58       * Add, update, or merge, the entity. This method also calls the model
59       * listeners to trigger the proper events associated with adding, deleting,
60       * or updating an entity.
61       *
62       * @param        layoutSet the entity to add, update, or merge
63       * @param        merge boolean value for whether to merge the entity. The
64       *                default value is false. Setting merge to true is more
65       *                expensive and should only be true when layoutSet is
66       *                transient. See LEP-5473 for a detailed discussion of this
67       *                method.
68       * @return        true if the portlet can be displayed via Ajax
69       */
70      public static com.liferay.portal.model.LayoutSet update(
71          com.liferay.portal.model.LayoutSet layoutSet, boolean merge)
72          throws com.liferay.portal.SystemException {
73          return getPersistence().update(layoutSet, merge);
74      }
75  
76      public static com.liferay.portal.model.LayoutSet updateImpl(
77          com.liferay.portal.model.LayoutSet layoutSet, boolean merge)
78          throws com.liferay.portal.SystemException {
79          return getPersistence().updateImpl(layoutSet, merge);
80      }
81  
82      public static com.liferay.portal.model.LayoutSet findByPrimaryKey(
83          long layoutSetId)
84          throws com.liferay.portal.SystemException,
85              com.liferay.portal.NoSuchLayoutSetException {
86          return getPersistence().findByPrimaryKey(layoutSetId);
87      }
88  
89      public static com.liferay.portal.model.LayoutSet fetchByPrimaryKey(
90          long layoutSetId) throws com.liferay.portal.SystemException {
91          return getPersistence().fetchByPrimaryKey(layoutSetId);
92      }
93  
94      public static java.util.List<com.liferay.portal.model.LayoutSet> findByGroupId(
95          long groupId) throws com.liferay.portal.SystemException {
96          return getPersistence().findByGroupId(groupId);
97      }
98  
99      public static java.util.List<com.liferay.portal.model.LayoutSet> findByGroupId(
100         long groupId, int begin, int end)
101         throws com.liferay.portal.SystemException {
102         return getPersistence().findByGroupId(groupId, begin, end);
103     }
104 
105     public static java.util.List<com.liferay.portal.model.LayoutSet> findByGroupId(
106         long groupId, int begin, int end,
107         com.liferay.portal.kernel.util.OrderByComparator obc)
108         throws com.liferay.portal.SystemException {
109         return getPersistence().findByGroupId(groupId, begin, end, obc);
110     }
111 
112     public static com.liferay.portal.model.LayoutSet findByGroupId_First(
113         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
114         throws com.liferay.portal.SystemException,
115             com.liferay.portal.NoSuchLayoutSetException {
116         return getPersistence().findByGroupId_First(groupId, obc);
117     }
118 
119     public static com.liferay.portal.model.LayoutSet findByGroupId_Last(
120         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
121         throws com.liferay.portal.SystemException,
122             com.liferay.portal.NoSuchLayoutSetException {
123         return getPersistence().findByGroupId_Last(groupId, obc);
124     }
125 
126     public static com.liferay.portal.model.LayoutSet[] findByGroupId_PrevAndNext(
127         long layoutSetId, long groupId,
128         com.liferay.portal.kernel.util.OrderByComparator obc)
129         throws com.liferay.portal.SystemException,
130             com.liferay.portal.NoSuchLayoutSetException {
131         return getPersistence()
132                    .findByGroupId_PrevAndNext(layoutSetId, groupId, obc);
133     }
134 
135     public static com.liferay.portal.model.LayoutSet findByVirtualHost(
136         java.lang.String virtualHost)
137         throws com.liferay.portal.SystemException,
138             com.liferay.portal.NoSuchLayoutSetException {
139         return getPersistence().findByVirtualHost(virtualHost);
140     }
141 
142     public static com.liferay.portal.model.LayoutSet fetchByVirtualHost(
143         java.lang.String virtualHost) throws com.liferay.portal.SystemException {
144         return getPersistence().fetchByVirtualHost(virtualHost);
145     }
146 
147     public static com.liferay.portal.model.LayoutSet findByG_P(long groupId,
148         boolean privateLayout)
149         throws com.liferay.portal.SystemException,
150             com.liferay.portal.NoSuchLayoutSetException {
151         return getPersistence().findByG_P(groupId, privateLayout);
152     }
153 
154     public static com.liferay.portal.model.LayoutSet fetchByG_P(long groupId,
155         boolean privateLayout) throws com.liferay.portal.SystemException {
156         return getPersistence().fetchByG_P(groupId, privateLayout);
157     }
158 
159     public static java.util.List<com.liferay.portal.model.LayoutSet> findWithDynamicQuery(
160         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
161         throws com.liferay.portal.SystemException {
162         return getPersistence().findWithDynamicQuery(queryInitializer);
163     }
164 
165     public static java.util.List<com.liferay.portal.model.LayoutSet> findWithDynamicQuery(
166         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
167         int begin, int end) throws com.liferay.portal.SystemException {
168         return getPersistence()
169                    .findWithDynamicQuery(queryInitializer, begin, end);
170     }
171 
172     public static java.util.List<com.liferay.portal.model.LayoutSet> findAll()
173         throws com.liferay.portal.SystemException {
174         return getPersistence().findAll();
175     }
176 
177     public static java.util.List<com.liferay.portal.model.LayoutSet> findAll(
178         int begin, int end) throws com.liferay.portal.SystemException {
179         return getPersistence().findAll(begin, end);
180     }
181 
182     public static java.util.List<com.liferay.portal.model.LayoutSet> findAll(
183         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
184         throws com.liferay.portal.SystemException {
185         return getPersistence().findAll(begin, end, obc);
186     }
187 
188     public static void removeByGroupId(long groupId)
189         throws com.liferay.portal.SystemException {
190         getPersistence().removeByGroupId(groupId);
191     }
192 
193     public static void removeByVirtualHost(java.lang.String virtualHost)
194         throws com.liferay.portal.SystemException,
195             com.liferay.portal.NoSuchLayoutSetException {
196         getPersistence().removeByVirtualHost(virtualHost);
197     }
198 
199     public static void removeByG_P(long groupId, boolean privateLayout)
200         throws com.liferay.portal.SystemException,
201             com.liferay.portal.NoSuchLayoutSetException {
202         getPersistence().removeByG_P(groupId, privateLayout);
203     }
204 
205     public static void removeAll() throws com.liferay.portal.SystemException {
206         getPersistence().removeAll();
207     }
208 
209     public static int countByGroupId(long groupId)
210         throws com.liferay.portal.SystemException {
211         return getPersistence().countByGroupId(groupId);
212     }
213 
214     public static int countByVirtualHost(java.lang.String virtualHost)
215         throws com.liferay.portal.SystemException {
216         return getPersistence().countByVirtualHost(virtualHost);
217     }
218 
219     public static int countByG_P(long groupId, boolean privateLayout)
220         throws com.liferay.portal.SystemException {
221         return getPersistence().countByG_P(groupId, privateLayout);
222     }
223 
224     public static int countAll() throws com.liferay.portal.SystemException {
225         return getPersistence().countAll();
226     }
227 
228     public static LayoutSetPersistence getPersistence() {
229         return _getUtil()._persistence;
230     }
231 
232     public void setPersistence(LayoutSetPersistence persistence) {
233         _persistence = persistence;
234     }
235 
236     private static LayoutSetUtil _getUtil() {
237         if (_util == null) {
238             _util = (LayoutSetUtil)com.liferay.portal.kernel.bean.BeanLocatorUtil.locate(_UTIL);
239         }
240 
241         return _util;
242     }
243 
244     private static final String _UTIL = LayoutSetUtil.class.getName();
245     private static LayoutSetUtil _util;
246     private LayoutSetPersistence _persistence;
247 }