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="PortletPreferencesUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class PortletPreferencesUtil {
32      public static com.liferay.portal.model.PortletPreferences create(
33          long portletPreferencesId) {
34          return getPersistence().create(portletPreferencesId);
35      }
36  
37      public static com.liferay.portal.model.PortletPreferences remove(
38          long portletPreferencesId)
39          throws com.liferay.portal.SystemException,
40              com.liferay.portal.NoSuchPortletPreferencesException {
41          return getPersistence().remove(portletPreferencesId);
42      }
43  
44      public static com.liferay.portal.model.PortletPreferences remove(
45          com.liferay.portal.model.PortletPreferences portletPreferences)
46          throws com.liferay.portal.SystemException {
47          return getPersistence().remove(portletPreferences);
48      }
49  
50      /**
51       * @deprecated Use <code>update(PortletPreferences portletPreferences, boolean merge)</code>.
52       */
53      public static com.liferay.portal.model.PortletPreferences update(
54          com.liferay.portal.model.PortletPreferences portletPreferences)
55          throws com.liferay.portal.SystemException {
56          return getPersistence().update(portletPreferences);
57      }
58  
59      /**
60       * Add, update, or merge, the entity. This method also calls the model
61       * listeners to trigger the proper events associated with adding, deleting,
62       * or updating an entity.
63       *
64       * @param        portletPreferences the entity to add, update, or merge
65       * @param        merge boolean value for whether to merge the entity. The
66       *                default value is false. Setting merge to true is more
67       *                expensive and should only be true when portletPreferences is
68       *                transient. See LEP-5473 for a detailed discussion of this
69       *                method.
70       * @return        true if the portlet can be displayed via Ajax
71       */
72      public static com.liferay.portal.model.PortletPreferences update(
73          com.liferay.portal.model.PortletPreferences portletPreferences,
74          boolean merge) throws com.liferay.portal.SystemException {
75          return getPersistence().update(portletPreferences, merge);
76      }
77  
78      public static com.liferay.portal.model.PortletPreferences updateImpl(
79          com.liferay.portal.model.PortletPreferences portletPreferences,
80          boolean merge) throws com.liferay.portal.SystemException {
81          return getPersistence().updateImpl(portletPreferences, merge);
82      }
83  
84      public static com.liferay.portal.model.PortletPreferences findByPrimaryKey(
85          long portletPreferencesId)
86          throws com.liferay.portal.SystemException,
87              com.liferay.portal.NoSuchPortletPreferencesException {
88          return getPersistence().findByPrimaryKey(portletPreferencesId);
89      }
90  
91      public static com.liferay.portal.model.PortletPreferences fetchByPrimaryKey(
92          long portletPreferencesId) throws com.liferay.portal.SystemException {
93          return getPersistence().fetchByPrimaryKey(portletPreferencesId);
94      }
95  
96      public static java.util.List<com.liferay.portal.model.PortletPreferences> findByPlid(
97          long plid) throws com.liferay.portal.SystemException {
98          return getPersistence().findByPlid(plid);
99      }
100 
101     public static java.util.List<com.liferay.portal.model.PortletPreferences> findByPlid(
102         long plid, int begin, int end)
103         throws com.liferay.portal.SystemException {
104         return getPersistence().findByPlid(plid, begin, end);
105     }
106 
107     public static java.util.List<com.liferay.portal.model.PortletPreferences> findByPlid(
108         long plid, int begin, int end,
109         com.liferay.portal.kernel.util.OrderByComparator obc)
110         throws com.liferay.portal.SystemException {
111         return getPersistence().findByPlid(plid, begin, end, obc);
112     }
113 
114     public static com.liferay.portal.model.PortletPreferences findByPlid_First(
115         long plid, com.liferay.portal.kernel.util.OrderByComparator obc)
116         throws com.liferay.portal.SystemException,
117             com.liferay.portal.NoSuchPortletPreferencesException {
118         return getPersistence().findByPlid_First(plid, obc);
119     }
120 
121     public static com.liferay.portal.model.PortletPreferences findByPlid_Last(
122         long plid, com.liferay.portal.kernel.util.OrderByComparator obc)
123         throws com.liferay.portal.SystemException,
124             com.liferay.portal.NoSuchPortletPreferencesException {
125         return getPersistence().findByPlid_Last(plid, obc);
126     }
127 
128     public static com.liferay.portal.model.PortletPreferences[] findByPlid_PrevAndNext(
129         long portletPreferencesId, long plid,
130         com.liferay.portal.kernel.util.OrderByComparator obc)
131         throws com.liferay.portal.SystemException,
132             com.liferay.portal.NoSuchPortletPreferencesException {
133         return getPersistence()
134                    .findByPlid_PrevAndNext(portletPreferencesId, plid, obc);
135     }
136 
137     public static java.util.List<com.liferay.portal.model.PortletPreferences> findByP_P(
138         long plid, java.lang.String portletId)
139         throws com.liferay.portal.SystemException {
140         return getPersistence().findByP_P(plid, portletId);
141     }
142 
143     public static java.util.List<com.liferay.portal.model.PortletPreferences> findByP_P(
144         long plid, java.lang.String portletId, int begin, int end)
145         throws com.liferay.portal.SystemException {
146         return getPersistence().findByP_P(plid, portletId, begin, end);
147     }
148 
149     public static java.util.List<com.liferay.portal.model.PortletPreferences> findByP_P(
150         long plid, java.lang.String portletId, int begin, int end,
151         com.liferay.portal.kernel.util.OrderByComparator obc)
152         throws com.liferay.portal.SystemException {
153         return getPersistence().findByP_P(plid, portletId, begin, end, obc);
154     }
155 
156     public static com.liferay.portal.model.PortletPreferences findByP_P_First(
157         long plid, java.lang.String portletId,
158         com.liferay.portal.kernel.util.OrderByComparator obc)
159         throws com.liferay.portal.SystemException,
160             com.liferay.portal.NoSuchPortletPreferencesException {
161         return getPersistence().findByP_P_First(plid, portletId, obc);
162     }
163 
164     public static com.liferay.portal.model.PortletPreferences findByP_P_Last(
165         long plid, java.lang.String portletId,
166         com.liferay.portal.kernel.util.OrderByComparator obc)
167         throws com.liferay.portal.SystemException,
168             com.liferay.portal.NoSuchPortletPreferencesException {
169         return getPersistence().findByP_P_Last(plid, portletId, obc);
170     }
171 
172     public static com.liferay.portal.model.PortletPreferences[] findByP_P_PrevAndNext(
173         long portletPreferencesId, long plid, java.lang.String portletId,
174         com.liferay.portal.kernel.util.OrderByComparator obc)
175         throws com.liferay.portal.SystemException,
176             com.liferay.portal.NoSuchPortletPreferencesException {
177         return getPersistence()
178                    .findByP_P_PrevAndNext(portletPreferencesId, plid,
179             portletId, obc);
180     }
181 
182     public static java.util.List<com.liferay.portal.model.PortletPreferences> findByO_O_P(
183         long ownerId, int ownerType, long plid)
184         throws com.liferay.portal.SystemException {
185         return getPersistence().findByO_O_P(ownerId, ownerType, plid);
186     }
187 
188     public static java.util.List<com.liferay.portal.model.PortletPreferences> findByO_O_P(
189         long ownerId, int ownerType, long plid, int begin, int end)
190         throws com.liferay.portal.SystemException {
191         return getPersistence().findByO_O_P(ownerId, ownerType, plid, begin, end);
192     }
193 
194     public static java.util.List<com.liferay.portal.model.PortletPreferences> findByO_O_P(
195         long ownerId, int ownerType, long plid, int begin, int end,
196         com.liferay.portal.kernel.util.OrderByComparator obc)
197         throws com.liferay.portal.SystemException {
198         return getPersistence()
199                    .findByO_O_P(ownerId, ownerType, plid, begin, end, obc);
200     }
201 
202     public static com.liferay.portal.model.PortletPreferences findByO_O_P_First(
203         long ownerId, int ownerType, long plid,
204         com.liferay.portal.kernel.util.OrderByComparator obc)
205         throws com.liferay.portal.SystemException,
206             com.liferay.portal.NoSuchPortletPreferencesException {
207         return getPersistence().findByO_O_P_First(ownerId, ownerType, plid, obc);
208     }
209 
210     public static com.liferay.portal.model.PortletPreferences findByO_O_P_Last(
211         long ownerId, int ownerType, long plid,
212         com.liferay.portal.kernel.util.OrderByComparator obc)
213         throws com.liferay.portal.SystemException,
214             com.liferay.portal.NoSuchPortletPreferencesException {
215         return getPersistence().findByO_O_P_Last(ownerId, ownerType, plid, obc);
216     }
217 
218     public static com.liferay.portal.model.PortletPreferences[] findByO_O_P_PrevAndNext(
219         long portletPreferencesId, long ownerId, int ownerType, long plid,
220         com.liferay.portal.kernel.util.OrderByComparator obc)
221         throws com.liferay.portal.SystemException,
222             com.liferay.portal.NoSuchPortletPreferencesException {
223         return getPersistence()
224                    .findByO_O_P_PrevAndNext(portletPreferencesId, ownerId,
225             ownerType, plid, obc);
226     }
227 
228     public static com.liferay.portal.model.PortletPreferences findByO_O_P_P(
229         long ownerId, int ownerType, long plid, java.lang.String portletId)
230         throws com.liferay.portal.SystemException,
231             com.liferay.portal.NoSuchPortletPreferencesException {
232         return getPersistence()
233                    .findByO_O_P_P(ownerId, ownerType, plid, portletId);
234     }
235 
236     public static com.liferay.portal.model.PortletPreferences fetchByO_O_P_P(
237         long ownerId, int ownerType, long plid, java.lang.String portletId)
238         throws com.liferay.portal.SystemException {
239         return getPersistence()
240                    .fetchByO_O_P_P(ownerId, ownerType, plid, portletId);
241     }
242 
243     public static java.util.List<com.liferay.portal.model.PortletPreferences> findWithDynamicQuery(
244         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
245         throws com.liferay.portal.SystemException {
246         return getPersistence().findWithDynamicQuery(queryInitializer);
247     }
248 
249     public static java.util.List<com.liferay.portal.model.PortletPreferences> findWithDynamicQuery(
250         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
251         int begin, int end) throws com.liferay.portal.SystemException {
252         return getPersistence()
253                    .findWithDynamicQuery(queryInitializer, begin, end);
254     }
255 
256     public static java.util.List<com.liferay.portal.model.PortletPreferences> findAll()
257         throws com.liferay.portal.SystemException {
258         return getPersistence().findAll();
259     }
260 
261     public static java.util.List<com.liferay.portal.model.PortletPreferences> findAll(
262         int begin, int end) throws com.liferay.portal.SystemException {
263         return getPersistence().findAll(begin, end);
264     }
265 
266     public static java.util.List<com.liferay.portal.model.PortletPreferences> findAll(
267         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
268         throws com.liferay.portal.SystemException {
269         return getPersistence().findAll(begin, end, obc);
270     }
271 
272     public static void removeByPlid(long plid)
273         throws com.liferay.portal.SystemException {
274         getPersistence().removeByPlid(plid);
275     }
276 
277     public static void removeByP_P(long plid, java.lang.String portletId)
278         throws com.liferay.portal.SystemException {
279         getPersistence().removeByP_P(plid, portletId);
280     }
281 
282     public static void removeByO_O_P(long ownerId, int ownerType, long plid)
283         throws com.liferay.portal.SystemException {
284         getPersistence().removeByO_O_P(ownerId, ownerType, plid);
285     }
286 
287     public static void removeByO_O_P_P(long ownerId, int ownerType, long plid,
288         java.lang.String portletId)
289         throws com.liferay.portal.SystemException,
290             com.liferay.portal.NoSuchPortletPreferencesException {
291         getPersistence().removeByO_O_P_P(ownerId, ownerType, plid, portletId);
292     }
293 
294     public static void removeAll() throws com.liferay.portal.SystemException {
295         getPersistence().removeAll();
296     }
297 
298     public static int countByPlid(long plid)
299         throws com.liferay.portal.SystemException {
300         return getPersistence().countByPlid(plid);
301     }
302 
303     public static int countByP_P(long plid, java.lang.String portletId)
304         throws com.liferay.portal.SystemException {
305         return getPersistence().countByP_P(plid, portletId);
306     }
307 
308     public static int countByO_O_P(long ownerId, int ownerType, long plid)
309         throws com.liferay.portal.SystemException {
310         return getPersistence().countByO_O_P(ownerId, ownerType, plid);
311     }
312 
313     public static int countByO_O_P_P(long ownerId, int ownerType, long plid,
314         java.lang.String portletId) throws com.liferay.portal.SystemException {
315         return getPersistence()
316                    .countByO_O_P_P(ownerId, ownerType, plid, portletId);
317     }
318 
319     public static int countAll() throws com.liferay.portal.SystemException {
320         return getPersistence().countAll();
321     }
322 
323     public static PortletPreferencesPersistence getPersistence() {
324         return _getUtil()._persistence;
325     }
326 
327     public void setPersistence(PortletPreferencesPersistence persistence) {
328         _persistence = persistence;
329     }
330 
331     private static PortletPreferencesUtil _getUtil() {
332         if (_util == null) {
333             _util = (PortletPreferencesUtil)com.liferay.portal.kernel.bean.BeanLocatorUtil.locate(_UTIL);
334         }
335 
336         return _util;
337     }
338 
339     private static final String _UTIL = PortletPreferencesUtil.class.getName();
340     private static PortletPreferencesUtil _util;
341     private PortletPreferencesPersistence _persistence;
342 }