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