1   /**
2    * Copyright (c) 2000-2009 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 void cacheResult(com.liferay.portal.model.LayoutSet layoutSet) {
33          getPersistence().cacheResult(layoutSet);
34      }
35  
36      public static void cacheResult(
37          java.util.List<com.liferay.portal.model.LayoutSet> layoutSets) {
38          getPersistence().cacheResult(layoutSets);
39      }
40  
41      public static void clearCache() {
42          getPersistence().clearCache();
43      }
44  
45      public static com.liferay.portal.model.LayoutSet create(long layoutSetId) {
46          return getPersistence().create(layoutSetId);
47      }
48  
49      public static com.liferay.portal.model.LayoutSet remove(long layoutSetId)
50          throws com.liferay.portal.NoSuchLayoutSetException,
51              com.liferay.portal.SystemException {
52          return getPersistence().remove(layoutSetId);
53      }
54  
55      public static com.liferay.portal.model.LayoutSet remove(
56          com.liferay.portal.model.LayoutSet layoutSet)
57          throws com.liferay.portal.SystemException {
58          return getPersistence().remove(layoutSet);
59      }
60  
61      /**
62       * @deprecated Use <code>update(LayoutSet layoutSet, boolean merge)</code>.
63       */
64      public static com.liferay.portal.model.LayoutSet update(
65          com.liferay.portal.model.LayoutSet layoutSet)
66          throws com.liferay.portal.SystemException {
67          return getPersistence().update(layoutSet);
68      }
69  
70      /**
71       * Add, update, or merge, the entity. This method also calls the model
72       * listeners to trigger the proper events associated with adding, deleting,
73       * or updating an entity.
74       *
75       * @param        layoutSet the entity to add, update, or merge
76       * @param        merge boolean value for whether to merge the entity. The
77       *                default value is false. Setting merge to true is more
78       *                expensive and should only be true when layoutSet is
79       *                transient. See LEP-5473 for a detailed discussion of this
80       *                method.
81       * @return        true if the portlet can be displayed via Ajax
82       */
83      public static com.liferay.portal.model.LayoutSet update(
84          com.liferay.portal.model.LayoutSet layoutSet, boolean merge)
85          throws com.liferay.portal.SystemException {
86          return getPersistence().update(layoutSet, merge);
87      }
88  
89      public static com.liferay.portal.model.LayoutSet updateImpl(
90          com.liferay.portal.model.LayoutSet layoutSet, boolean merge)
91          throws com.liferay.portal.SystemException {
92          return getPersistence().updateImpl(layoutSet, merge);
93      }
94  
95      public static com.liferay.portal.model.LayoutSet findByPrimaryKey(
96          long layoutSetId)
97          throws com.liferay.portal.NoSuchLayoutSetException,
98              com.liferay.portal.SystemException {
99          return getPersistence().findByPrimaryKey(layoutSetId);
100     }
101 
102     public static com.liferay.portal.model.LayoutSet fetchByPrimaryKey(
103         long layoutSetId) throws com.liferay.portal.SystemException {
104         return getPersistence().fetchByPrimaryKey(layoutSetId);
105     }
106 
107     public static java.util.List<com.liferay.portal.model.LayoutSet> findByGroupId(
108         long groupId) throws com.liferay.portal.SystemException {
109         return getPersistence().findByGroupId(groupId);
110     }
111 
112     public static java.util.List<com.liferay.portal.model.LayoutSet> findByGroupId(
113         long groupId, int start, int end)
114         throws com.liferay.portal.SystemException {
115         return getPersistence().findByGroupId(groupId, start, end);
116     }
117 
118     public static java.util.List<com.liferay.portal.model.LayoutSet> findByGroupId(
119         long groupId, int start, int end,
120         com.liferay.portal.kernel.util.OrderByComparator obc)
121         throws com.liferay.portal.SystemException {
122         return getPersistence().findByGroupId(groupId, start, end, obc);
123     }
124 
125     public static com.liferay.portal.model.LayoutSet findByGroupId_First(
126         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
127         throws com.liferay.portal.NoSuchLayoutSetException,
128             com.liferay.portal.SystemException {
129         return getPersistence().findByGroupId_First(groupId, obc);
130     }
131 
132     public static com.liferay.portal.model.LayoutSet findByGroupId_Last(
133         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
134         throws com.liferay.portal.NoSuchLayoutSetException,
135             com.liferay.portal.SystemException {
136         return getPersistence().findByGroupId_Last(groupId, obc);
137     }
138 
139     public static com.liferay.portal.model.LayoutSet[] findByGroupId_PrevAndNext(
140         long layoutSetId, long groupId,
141         com.liferay.portal.kernel.util.OrderByComparator obc)
142         throws com.liferay.portal.NoSuchLayoutSetException,
143             com.liferay.portal.SystemException {
144         return getPersistence()
145                    .findByGroupId_PrevAndNext(layoutSetId, groupId, obc);
146     }
147 
148     public static com.liferay.portal.model.LayoutSet findByVirtualHost(
149         java.lang.String virtualHost)
150         throws com.liferay.portal.NoSuchLayoutSetException,
151             com.liferay.portal.SystemException {
152         return getPersistence().findByVirtualHost(virtualHost);
153     }
154 
155     public static com.liferay.portal.model.LayoutSet fetchByVirtualHost(
156         java.lang.String virtualHost) throws com.liferay.portal.SystemException {
157         return getPersistence().fetchByVirtualHost(virtualHost);
158     }
159 
160     public static com.liferay.portal.model.LayoutSet fetchByVirtualHost(
161         java.lang.String virtualHost, boolean retrieveFromCache)
162         throws com.liferay.portal.SystemException {
163         return getPersistence()
164                    .fetchByVirtualHost(virtualHost, retrieveFromCache);
165     }
166 
167     public static com.liferay.portal.model.LayoutSet findByG_P(long groupId,
168         boolean privateLayout)
169         throws com.liferay.portal.NoSuchLayoutSetException,
170             com.liferay.portal.SystemException {
171         return getPersistence().findByG_P(groupId, privateLayout);
172     }
173 
174     public static com.liferay.portal.model.LayoutSet fetchByG_P(long groupId,
175         boolean privateLayout) throws com.liferay.portal.SystemException {
176         return getPersistence().fetchByG_P(groupId, privateLayout);
177     }
178 
179     public static com.liferay.portal.model.LayoutSet fetchByG_P(long groupId,
180         boolean privateLayout, boolean retrieveFromCache)
181         throws com.liferay.portal.SystemException {
182         return getPersistence()
183                    .fetchByG_P(groupId, privateLayout, retrieveFromCache);
184     }
185 
186     public static java.util.List<Object> findWithDynamicQuery(
187         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
188         throws com.liferay.portal.SystemException {
189         return getPersistence().findWithDynamicQuery(dynamicQuery);
190     }
191 
192     public static java.util.List<Object> findWithDynamicQuery(
193         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
194         int end) throws com.liferay.portal.SystemException {
195         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
196     }
197 
198     public static java.util.List<com.liferay.portal.model.LayoutSet> findAll()
199         throws com.liferay.portal.SystemException {
200         return getPersistence().findAll();
201     }
202 
203     public static java.util.List<com.liferay.portal.model.LayoutSet> findAll(
204         int start, int end) throws com.liferay.portal.SystemException {
205         return getPersistence().findAll(start, end);
206     }
207 
208     public static java.util.List<com.liferay.portal.model.LayoutSet> findAll(
209         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
210         throws com.liferay.portal.SystemException {
211         return getPersistence().findAll(start, end, obc);
212     }
213 
214     public static void removeByGroupId(long groupId)
215         throws com.liferay.portal.SystemException {
216         getPersistence().removeByGroupId(groupId);
217     }
218 
219     public static void removeByVirtualHost(java.lang.String virtualHost)
220         throws com.liferay.portal.NoSuchLayoutSetException,
221             com.liferay.portal.SystemException {
222         getPersistence().removeByVirtualHost(virtualHost);
223     }
224 
225     public static void removeByG_P(long groupId, boolean privateLayout)
226         throws com.liferay.portal.NoSuchLayoutSetException,
227             com.liferay.portal.SystemException {
228         getPersistence().removeByG_P(groupId, privateLayout);
229     }
230 
231     public static void removeAll() throws com.liferay.portal.SystemException {
232         getPersistence().removeAll();
233     }
234 
235     public static int countByGroupId(long groupId)
236         throws com.liferay.portal.SystemException {
237         return getPersistence().countByGroupId(groupId);
238     }
239 
240     public static int countByVirtualHost(java.lang.String virtualHost)
241         throws com.liferay.portal.SystemException {
242         return getPersistence().countByVirtualHost(virtualHost);
243     }
244 
245     public static int countByG_P(long groupId, boolean privateLayout)
246         throws com.liferay.portal.SystemException {
247         return getPersistence().countByG_P(groupId, privateLayout);
248     }
249 
250     public static int countAll() throws com.liferay.portal.SystemException {
251         return getPersistence().countAll();
252     }
253 
254     public static LayoutSetPersistence getPersistence() {
255         return _persistence;
256     }
257 
258     public void setPersistence(LayoutSetPersistence persistence) {
259         _persistence = persistence;
260     }
261 
262     private static LayoutSetPersistence _persistence;
263 }