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