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