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