1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.service.persistence;
24  
25  
26  /**
27   * <a href="PortletUtil.java.html"><b><i>View Source</i></b></a>
28   *
29   * <p>
30   * ServiceBuilder generated this class. Modifications in this class will be
31   * overwritten the next time is generated.
32   * </p>
33   *
34   * @author    Brian Wing Shun Chan
35   * @see       PortletPersistence
36   * @see       PortletPersistenceImpl
37   * @generated
38   */
39  public class PortletUtil {
40      public static void cacheResult(com.liferay.portal.model.Portlet portlet) {
41          getPersistence().cacheResult(portlet);
42      }
43  
44      public static void cacheResult(
45          java.util.List<com.liferay.portal.model.Portlet> portlets) {
46          getPersistence().cacheResult(portlets);
47      }
48  
49      public static void clearCache() {
50          getPersistence().clearCache();
51      }
52  
53      public static com.liferay.portal.model.Portlet create(long id) {
54          return getPersistence().create(id);
55      }
56  
57      public static com.liferay.portal.model.Portlet remove(long id)
58          throws com.liferay.portal.NoSuchPortletException,
59              com.liferay.portal.SystemException {
60          return getPersistence().remove(id);
61      }
62  
63      public static com.liferay.portal.model.Portlet remove(
64          com.liferay.portal.model.Portlet portlet)
65          throws com.liferay.portal.SystemException {
66          return getPersistence().remove(portlet);
67      }
68  
69      /**
70       * @deprecated Use {@link #update(Portlet, boolean merge)}.
71       */
72      public static com.liferay.portal.model.Portlet update(
73          com.liferay.portal.model.Portlet portlet)
74          throws com.liferay.portal.SystemException {
75          return getPersistence().update(portlet);
76      }
77  
78      /**
79       * Add, update, or merge, the entity. This method also calls the model
80       * listeners to trigger the proper events associated with adding, deleting,
81       * or updating an entity.
82       *
83       * @param  portlet the entity to add, update, or merge
84       * @param  merge boolean value for whether to merge the entity. The default
85       *         value is false. Setting merge to true is more expensive and
86       *         should only be true when portlet is transient. See
87       *         LEP-5473 for a detailed discussion of this method.
88       * @return the entity that was added, updated, or merged
89       */
90      public static com.liferay.portal.model.Portlet update(
91          com.liferay.portal.model.Portlet portlet, boolean merge)
92          throws com.liferay.portal.SystemException {
93          return getPersistence().update(portlet, merge);
94      }
95  
96      public static com.liferay.portal.model.Portlet updateImpl(
97          com.liferay.portal.model.Portlet portlet, boolean merge)
98          throws com.liferay.portal.SystemException {
99          return getPersistence().updateImpl(portlet, merge);
100     }
101 
102     public static com.liferay.portal.model.Portlet findByPrimaryKey(long id)
103         throws com.liferay.portal.NoSuchPortletException,
104             com.liferay.portal.SystemException {
105         return getPersistence().findByPrimaryKey(id);
106     }
107 
108     public static com.liferay.portal.model.Portlet fetchByPrimaryKey(long id)
109         throws com.liferay.portal.SystemException {
110         return getPersistence().fetchByPrimaryKey(id);
111     }
112 
113     public static java.util.List<com.liferay.portal.model.Portlet> findByCompanyId(
114         long companyId) throws com.liferay.portal.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.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 obc)
127         throws com.liferay.portal.SystemException {
128         return getPersistence().findByCompanyId(companyId, start, end, obc);
129     }
130 
131     public static com.liferay.portal.model.Portlet findByCompanyId_First(
132         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
133         throws com.liferay.portal.NoSuchPortletException,
134             com.liferay.portal.SystemException {
135         return getPersistence().findByCompanyId_First(companyId, obc);
136     }
137 
138     public static com.liferay.portal.model.Portlet findByCompanyId_Last(
139         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
140         throws com.liferay.portal.NoSuchPortletException,
141             com.liferay.portal.SystemException {
142         return getPersistence().findByCompanyId_Last(companyId, obc);
143     }
144 
145     public static com.liferay.portal.model.Portlet[] findByCompanyId_PrevAndNext(
146         long id, long companyId,
147         com.liferay.portal.kernel.util.OrderByComparator obc)
148         throws com.liferay.portal.NoSuchPortletException,
149             com.liferay.portal.SystemException {
150         return getPersistence().findByCompanyId_PrevAndNext(id, companyId, obc);
151     }
152 
153     public static com.liferay.portal.model.Portlet findByC_P(long companyId,
154         java.lang.String portletId)
155         throws com.liferay.portal.NoSuchPortletException,
156             com.liferay.portal.SystemException {
157         return getPersistence().findByC_P(companyId, portletId);
158     }
159 
160     public static com.liferay.portal.model.Portlet fetchByC_P(long companyId,
161         java.lang.String portletId) throws com.liferay.portal.SystemException {
162         return getPersistence().fetchByC_P(companyId, portletId);
163     }
164 
165     public static com.liferay.portal.model.Portlet fetchByC_P(long companyId,
166         java.lang.String portletId, boolean retrieveFromCache)
167         throws com.liferay.portal.SystemException {
168         return getPersistence()
169                    .fetchByC_P(companyId, portletId, retrieveFromCache);
170     }
171 
172     public static java.util.List<Object> findWithDynamicQuery(
173         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
174         throws com.liferay.portal.SystemException {
175         return getPersistence().findWithDynamicQuery(dynamicQuery);
176     }
177 
178     public static java.util.List<Object> findWithDynamicQuery(
179         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
180         int end) throws com.liferay.portal.SystemException {
181         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
182     }
183 
184     public static java.util.List<com.liferay.portal.model.Portlet> findAll()
185         throws com.liferay.portal.SystemException {
186         return getPersistence().findAll();
187     }
188 
189     public static java.util.List<com.liferay.portal.model.Portlet> findAll(
190         int start, int end) throws com.liferay.portal.SystemException {
191         return getPersistence().findAll(start, end);
192     }
193 
194     public static java.util.List<com.liferay.portal.model.Portlet> findAll(
195         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
196         throws com.liferay.portal.SystemException {
197         return getPersistence().findAll(start, end, obc);
198     }
199 
200     public static void removeByCompanyId(long companyId)
201         throws com.liferay.portal.SystemException {
202         getPersistence().removeByCompanyId(companyId);
203     }
204 
205     public static void removeByC_P(long companyId, java.lang.String portletId)
206         throws com.liferay.portal.NoSuchPortletException,
207             com.liferay.portal.SystemException {
208         getPersistence().removeByC_P(companyId, portletId);
209     }
210 
211     public static void removeAll() throws com.liferay.portal.SystemException {
212         getPersistence().removeAll();
213     }
214 
215     public static int countByCompanyId(long companyId)
216         throws com.liferay.portal.SystemException {
217         return getPersistence().countByCompanyId(companyId);
218     }
219 
220     public static int countByC_P(long companyId, java.lang.String portletId)
221         throws com.liferay.portal.SystemException {
222         return getPersistence().countByC_P(companyId, portletId);
223     }
224 
225     public static int countAll() throws com.liferay.portal.SystemException {
226         return getPersistence().countAll();
227     }
228 
229     public static PortletPersistence getPersistence() {
230         return _persistence;
231     }
232 
233     public void setPersistence(PortletPersistence persistence) {
234         _persistence = persistence;
235     }
236 
237     private static PortletPersistence _persistence;
238 }