1   /**
2    * Copyright (c) 2000-2010 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   *
12   *
13   */
14  
15  package com.liferay.portal.service.persistence;
16  
17  import com.liferay.portal.SystemException;
18  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
19  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
20  import com.liferay.portal.kernel.util.ReferenceRegistry;
21  import com.liferay.portal.model.Portlet;
22  
23  import java.util.List;
24  
25  /**
26   * <a href="PortletUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * <p>
29   * ServiceBuilder generated this class. Modifications in this class will be
30   * overwritten the next time is generated.
31   * </p>
32   *
33   * @author    Brian Wing Shun Chan
34   * @see       PortletPersistence
35   * @see       PortletPersistenceImpl
36   * @generated
37   */
38  public class PortletUtil {
39      /**
40       * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
41       */
42      public static void clearCache() {
43          getPersistence().clearCache();
44      }
45  
46      /**
47       * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(Portlet)
48       */
49      public static void clearCache(Portlet portlet) {
50          getPersistence().clearCache(portlet);
51      }
52  
53      /**
54       * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
55       */
56      public int countWithDynamicQuery(DynamicQuery dynamicQuery)
57          throws SystemException {
58          return getPersistence().countWithDynamicQuery(dynamicQuery);
59      }
60  
61      /**
62       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
63       */
64      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery)
65          throws SystemException {
66          return getPersistence().findWithDynamicQuery(dynamicQuery);
67      }
68  
69      /**
70       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
71       */
72      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery,
73          int start, int end) throws SystemException {
74          return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
75      }
76  
77      /**
78       * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
79       */
80      public static Portlet remove(Portlet portlet) throws SystemException {
81          return getPersistence().remove(portlet);
82      }
83  
84      /**
85       * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
86       */
87      public static Portlet update(Portlet portlet, boolean merge)
88          throws SystemException {
89          return getPersistence().update(portlet, merge);
90      }
91  
92      public static void cacheResult(com.liferay.portal.model.Portlet portlet) {
93          getPersistence().cacheResult(portlet);
94      }
95  
96      public static void cacheResult(
97          java.util.List<com.liferay.portal.model.Portlet> portlets) {
98          getPersistence().cacheResult(portlets);
99      }
100 
101     public static com.liferay.portal.model.Portlet create(long id) {
102         return getPersistence().create(id);
103     }
104 
105     public static com.liferay.portal.model.Portlet remove(long id)
106         throws com.liferay.portal.NoSuchPortletException,
107             com.liferay.portal.SystemException {
108         return getPersistence().remove(id);
109     }
110 
111     /**
112      * @deprecated Use {@link com.liferay.portal.service.persistence.BasePersistence.#update(com.liferay.portal.model.BaseModel, boolean)}.
113      */
114     public static com.liferay.portal.model.Portlet update(
115         com.liferay.portal.model.Portlet portlet)
116         throws com.liferay.portal.SystemException {
117         return getPersistence().update(portlet);
118     }
119 
120     public static com.liferay.portal.model.Portlet updateImpl(
121         com.liferay.portal.model.Portlet portlet, boolean merge)
122         throws com.liferay.portal.SystemException {
123         return getPersistence().updateImpl(portlet, merge);
124     }
125 
126     public static com.liferay.portal.model.Portlet findByPrimaryKey(long id)
127         throws com.liferay.portal.NoSuchPortletException,
128             com.liferay.portal.SystemException {
129         return getPersistence().findByPrimaryKey(id);
130     }
131 
132     public static com.liferay.portal.model.Portlet fetchByPrimaryKey(long id)
133         throws com.liferay.portal.SystemException {
134         return getPersistence().fetchByPrimaryKey(id);
135     }
136 
137     public static java.util.List<com.liferay.portal.model.Portlet> findByCompanyId(
138         long companyId) throws com.liferay.portal.SystemException {
139         return getPersistence().findByCompanyId(companyId);
140     }
141 
142     public static java.util.List<com.liferay.portal.model.Portlet> findByCompanyId(
143         long companyId, int start, int end)
144         throws com.liferay.portal.SystemException {
145         return getPersistence().findByCompanyId(companyId, start, end);
146     }
147 
148     public static java.util.List<com.liferay.portal.model.Portlet> findByCompanyId(
149         long companyId, int start, int end,
150         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
151         throws com.liferay.portal.SystemException {
152         return getPersistence()
153                    .findByCompanyId(companyId, start, end, orderByComparator);
154     }
155 
156     public static com.liferay.portal.model.Portlet findByCompanyId_First(
157         long companyId,
158         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
159         throws com.liferay.portal.NoSuchPortletException,
160             com.liferay.portal.SystemException {
161         return getPersistence()
162                    .findByCompanyId_First(companyId, orderByComparator);
163     }
164 
165     public static com.liferay.portal.model.Portlet findByCompanyId_Last(
166         long companyId,
167         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
168         throws com.liferay.portal.NoSuchPortletException,
169             com.liferay.portal.SystemException {
170         return getPersistence()
171                    .findByCompanyId_Last(companyId, orderByComparator);
172     }
173 
174     public static com.liferay.portal.model.Portlet[] findByCompanyId_PrevAndNext(
175         long id, long companyId,
176         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
177         throws com.liferay.portal.NoSuchPortletException,
178             com.liferay.portal.SystemException {
179         return getPersistence()
180                    .findByCompanyId_PrevAndNext(id, companyId, orderByComparator);
181     }
182 
183     public static com.liferay.portal.model.Portlet findByC_P(long companyId,
184         java.lang.String portletId)
185         throws com.liferay.portal.NoSuchPortletException,
186             com.liferay.portal.SystemException {
187         return getPersistence().findByC_P(companyId, portletId);
188     }
189 
190     public static com.liferay.portal.model.Portlet fetchByC_P(long companyId,
191         java.lang.String portletId) throws com.liferay.portal.SystemException {
192         return getPersistence().fetchByC_P(companyId, portletId);
193     }
194 
195     public static com.liferay.portal.model.Portlet fetchByC_P(long companyId,
196         java.lang.String portletId, boolean retrieveFromCache)
197         throws com.liferay.portal.SystemException {
198         return getPersistence()
199                    .fetchByC_P(companyId, portletId, retrieveFromCache);
200     }
201 
202     public static java.util.List<com.liferay.portal.model.Portlet> findAll()
203         throws com.liferay.portal.SystemException {
204         return getPersistence().findAll();
205     }
206 
207     public static java.util.List<com.liferay.portal.model.Portlet> findAll(
208         int start, int end) throws com.liferay.portal.SystemException {
209         return getPersistence().findAll(start, end);
210     }
211 
212     public static java.util.List<com.liferay.portal.model.Portlet> findAll(
213         int start, int end,
214         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
215         throws com.liferay.portal.SystemException {
216         return getPersistence().findAll(start, end, orderByComparator);
217     }
218 
219     public static void removeByCompanyId(long companyId)
220         throws com.liferay.portal.SystemException {
221         getPersistence().removeByCompanyId(companyId);
222     }
223 
224     public static void removeByC_P(long companyId, java.lang.String portletId)
225         throws com.liferay.portal.NoSuchPortletException,
226             com.liferay.portal.SystemException {
227         getPersistence().removeByC_P(companyId, portletId);
228     }
229 
230     public static void removeAll() throws com.liferay.portal.SystemException {
231         getPersistence().removeAll();
232     }
233 
234     public static int countByCompanyId(long companyId)
235         throws com.liferay.portal.SystemException {
236         return getPersistence().countByCompanyId(companyId);
237     }
238 
239     public static int countByC_P(long companyId, java.lang.String portletId)
240         throws com.liferay.portal.SystemException {
241         return getPersistence().countByC_P(companyId, portletId);
242     }
243 
244     public static int countAll() throws com.liferay.portal.SystemException {
245         return getPersistence().countAll();
246     }
247 
248     public static PortletPersistence getPersistence() {
249         if (_persistence == null) {
250             _persistence = (PortletPersistence)PortalBeanLocatorUtil.locate(PortletPersistence.class.getName());
251 
252             ReferenceRegistry.registerReference(PortletUtil.class,
253                 "_persistence");
254         }
255 
256         return _persistence;
257     }
258 
259     public void setPersistence(PortletPersistence persistence) {
260         _persistence = persistence;
261 
262         ReferenceRegistry.registerReference(PortletUtil.class, "_persistence");
263     }
264 
265     private static PortletPersistence _persistence;
266 }