1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.service.persistence;
16  
17  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
19  import com.liferay.portal.kernel.exception.SystemException;
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.kernel.exception.SystemException {
92          return getPersistence().remove(id);
93      }
94  
95      public static com.liferay.portal.model.Portlet updateImpl(
96          com.liferay.portal.model.Portlet portlet, boolean merge)
97          throws com.liferay.portal.kernel.exception.SystemException {
98          return getPersistence().updateImpl(portlet, merge);
99      }
100 
101     public static com.liferay.portal.model.Portlet findByPrimaryKey(long id)
102         throws com.liferay.portal.NoSuchPortletException,
103             com.liferay.portal.kernel.exception.SystemException {
104         return getPersistence().findByPrimaryKey(id);
105     }
106 
107     public static com.liferay.portal.model.Portlet fetchByPrimaryKey(long id)
108         throws com.liferay.portal.kernel.exception.SystemException {
109         return getPersistence().fetchByPrimaryKey(id);
110     }
111 
112     public static java.util.List<com.liferay.portal.model.Portlet> findByCompanyId(
113         long companyId)
114         throws com.liferay.portal.kernel.exception.SystemException {
115         return getPersistence().findByCompanyId(companyId);
116     }
117 
118     public static java.util.List<com.liferay.portal.model.Portlet> findByCompanyId(
119         long companyId, int start, int end)
120         throws com.liferay.portal.kernel.exception.SystemException {
121         return getPersistence().findByCompanyId(companyId, start, end);
122     }
123 
124     public static java.util.List<com.liferay.portal.model.Portlet> findByCompanyId(
125         long companyId, int start, int end,
126         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
127         throws com.liferay.portal.kernel.exception.SystemException {
128         return getPersistence()
129                    .findByCompanyId(companyId, start, end, orderByComparator);
130     }
131 
132     public static com.liferay.portal.model.Portlet findByCompanyId_First(
133         long companyId,
134         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
135         throws com.liferay.portal.NoSuchPortletException,
136             com.liferay.portal.kernel.exception.SystemException {
137         return getPersistence()
138                    .findByCompanyId_First(companyId, orderByComparator);
139     }
140 
141     public static com.liferay.portal.model.Portlet findByCompanyId_Last(
142         long companyId,
143         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
144         throws com.liferay.portal.NoSuchPortletException,
145             com.liferay.portal.kernel.exception.SystemException {
146         return getPersistence()
147                    .findByCompanyId_Last(companyId, orderByComparator);
148     }
149 
150     public static com.liferay.portal.model.Portlet[] findByCompanyId_PrevAndNext(
151         long id, long companyId,
152         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
153         throws com.liferay.portal.NoSuchPortletException,
154             com.liferay.portal.kernel.exception.SystemException {
155         return getPersistence()
156                    .findByCompanyId_PrevAndNext(id, companyId, orderByComparator);
157     }
158 
159     public static com.liferay.portal.model.Portlet findByC_P(long companyId,
160         java.lang.String portletId)
161         throws com.liferay.portal.NoSuchPortletException,
162             com.liferay.portal.kernel.exception.SystemException {
163         return getPersistence().findByC_P(companyId, portletId);
164     }
165 
166     public static com.liferay.portal.model.Portlet fetchByC_P(long companyId,
167         java.lang.String portletId)
168         throws com.liferay.portal.kernel.exception.SystemException {
169         return getPersistence().fetchByC_P(companyId, portletId);
170     }
171 
172     public static com.liferay.portal.model.Portlet fetchByC_P(long companyId,
173         java.lang.String portletId, boolean retrieveFromCache)
174         throws com.liferay.portal.kernel.exception.SystemException {
175         return getPersistence()
176                    .fetchByC_P(companyId, portletId, retrieveFromCache);
177     }
178 
179     public static java.util.List<com.liferay.portal.model.Portlet> findAll()
180         throws com.liferay.portal.kernel.exception.SystemException {
181         return getPersistence().findAll();
182     }
183 
184     public static java.util.List<com.liferay.portal.model.Portlet> findAll(
185         int start, int end)
186         throws com.liferay.portal.kernel.exception.SystemException {
187         return getPersistence().findAll(start, end);
188     }
189 
190     public static java.util.List<com.liferay.portal.model.Portlet> findAll(
191         int start, int end,
192         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
193         throws com.liferay.portal.kernel.exception.SystemException {
194         return getPersistence().findAll(start, end, orderByComparator);
195     }
196 
197     public static void removeByCompanyId(long companyId)
198         throws com.liferay.portal.kernel.exception.SystemException {
199         getPersistence().removeByCompanyId(companyId);
200     }
201 
202     public static void removeByC_P(long companyId, java.lang.String portletId)
203         throws com.liferay.portal.NoSuchPortletException,
204             com.liferay.portal.kernel.exception.SystemException {
205         getPersistence().removeByC_P(companyId, portletId);
206     }
207 
208     public static void removeAll()
209         throws com.liferay.portal.kernel.exception.SystemException {
210         getPersistence().removeAll();
211     }
212 
213     public static int countByCompanyId(long companyId)
214         throws com.liferay.portal.kernel.exception.SystemException {
215         return getPersistence().countByCompanyId(companyId);
216     }
217 
218     public static int countByC_P(long companyId, java.lang.String portletId)
219         throws com.liferay.portal.kernel.exception.SystemException {
220         return getPersistence().countByC_P(companyId, portletId);
221     }
222 
223     public static int countAll()
224         throws com.liferay.portal.kernel.exception.SystemException {
225         return getPersistence().countAll();
226     }
227 
228     public static PortletPersistence getPersistence() {
229         if (_persistence == null) {
230             _persistence = (PortletPersistence)PortalBeanLocatorUtil.locate(PortletPersistence.class.getName());
231         }
232 
233         return _persistence;
234     }
235 
236     public void setPersistence(PortletPersistence persistence) {
237         _persistence = persistence;
238     }
239 
240     private static PortletPersistence _persistence;
241 }