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="WebsiteUtil.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   *
27   */
28  public class WebsiteUtil {
29      public static void cacheResult(com.liferay.portal.model.Website website) {
30          getPersistence().cacheResult(website);
31      }
32  
33      public static void cacheResult(
34          java.util.List<com.liferay.portal.model.Website> websites) {
35          getPersistence().cacheResult(websites);
36      }
37  
38      public static void clearCache() {
39          getPersistence().clearCache();
40      }
41  
42      public static com.liferay.portal.model.Website create(long websiteId) {
43          return getPersistence().create(websiteId);
44      }
45  
46      public static com.liferay.portal.model.Website remove(long websiteId)
47          throws com.liferay.portal.NoSuchWebsiteException,
48              com.liferay.portal.SystemException {
49          return getPersistence().remove(websiteId);
50      }
51  
52      public static com.liferay.portal.model.Website remove(
53          com.liferay.portal.model.Website website)
54          throws com.liferay.portal.SystemException {
55          return getPersistence().remove(website);
56      }
57  
58      /**
59       * @deprecated Use <code>update(Website website, boolean merge)</code>.
60       */
61      public static com.liferay.portal.model.Website update(
62          com.liferay.portal.model.Website website)
63          throws com.liferay.portal.SystemException {
64          return getPersistence().update(website);
65      }
66  
67      /**
68       * Add, update, or merge, the entity. This method also calls the model
69       * listeners to trigger the proper events associated with adding, deleting,
70       * or updating an entity.
71       *
72       * @param        website the entity to add, update, or merge
73       * @param        merge boolean value for whether to merge the entity. The
74       *                default value is false. Setting merge to true is more
75       *                expensive and should only be true when website is
76       *                transient. See LEP-5473 for a detailed discussion of this
77       *                method.
78       * @return        true if the portlet can be displayed via Ajax
79       */
80      public static com.liferay.portal.model.Website update(
81          com.liferay.portal.model.Website website, boolean merge)
82          throws com.liferay.portal.SystemException {
83          return getPersistence().update(website, merge);
84      }
85  
86      public static com.liferay.portal.model.Website updateImpl(
87          com.liferay.portal.model.Website website, boolean merge)
88          throws com.liferay.portal.SystemException {
89          return getPersistence().updateImpl(website, merge);
90      }
91  
92      public static com.liferay.portal.model.Website findByPrimaryKey(
93          long websiteId)
94          throws com.liferay.portal.NoSuchWebsiteException,
95              com.liferay.portal.SystemException {
96          return getPersistence().findByPrimaryKey(websiteId);
97      }
98  
99      public static com.liferay.portal.model.Website fetchByPrimaryKey(
100         long websiteId) throws com.liferay.portal.SystemException {
101         return getPersistence().fetchByPrimaryKey(websiteId);
102     }
103 
104     public static java.util.List<com.liferay.portal.model.Website> findByCompanyId(
105         long companyId) throws com.liferay.portal.SystemException {
106         return getPersistence().findByCompanyId(companyId);
107     }
108 
109     public static java.util.List<com.liferay.portal.model.Website> findByCompanyId(
110         long companyId, int start, int end)
111         throws com.liferay.portal.SystemException {
112         return getPersistence().findByCompanyId(companyId, start, end);
113     }
114 
115     public static java.util.List<com.liferay.portal.model.Website> findByCompanyId(
116         long companyId, int start, int end,
117         com.liferay.portal.kernel.util.OrderByComparator obc)
118         throws com.liferay.portal.SystemException {
119         return getPersistence().findByCompanyId(companyId, start, end, obc);
120     }
121 
122     public static com.liferay.portal.model.Website findByCompanyId_First(
123         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
124         throws com.liferay.portal.NoSuchWebsiteException,
125             com.liferay.portal.SystemException {
126         return getPersistence().findByCompanyId_First(companyId, obc);
127     }
128 
129     public static com.liferay.portal.model.Website findByCompanyId_Last(
130         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
131         throws com.liferay.portal.NoSuchWebsiteException,
132             com.liferay.portal.SystemException {
133         return getPersistence().findByCompanyId_Last(companyId, obc);
134     }
135 
136     public static com.liferay.portal.model.Website[] findByCompanyId_PrevAndNext(
137         long websiteId, long companyId,
138         com.liferay.portal.kernel.util.OrderByComparator obc)
139         throws com.liferay.portal.NoSuchWebsiteException,
140             com.liferay.portal.SystemException {
141         return getPersistence()
142                    .findByCompanyId_PrevAndNext(websiteId, companyId, obc);
143     }
144 
145     public static java.util.List<com.liferay.portal.model.Website> findByUserId(
146         long userId) throws com.liferay.portal.SystemException {
147         return getPersistence().findByUserId(userId);
148     }
149 
150     public static java.util.List<com.liferay.portal.model.Website> findByUserId(
151         long userId, int start, int end)
152         throws com.liferay.portal.SystemException {
153         return getPersistence().findByUserId(userId, start, end);
154     }
155 
156     public static java.util.List<com.liferay.portal.model.Website> findByUserId(
157         long userId, int start, int end,
158         com.liferay.portal.kernel.util.OrderByComparator obc)
159         throws com.liferay.portal.SystemException {
160         return getPersistence().findByUserId(userId, start, end, obc);
161     }
162 
163     public static com.liferay.portal.model.Website findByUserId_First(
164         long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
165         throws com.liferay.portal.NoSuchWebsiteException,
166             com.liferay.portal.SystemException {
167         return getPersistence().findByUserId_First(userId, obc);
168     }
169 
170     public static com.liferay.portal.model.Website findByUserId_Last(
171         long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
172         throws com.liferay.portal.NoSuchWebsiteException,
173             com.liferay.portal.SystemException {
174         return getPersistence().findByUserId_Last(userId, obc);
175     }
176 
177     public static com.liferay.portal.model.Website[] findByUserId_PrevAndNext(
178         long websiteId, long userId,
179         com.liferay.portal.kernel.util.OrderByComparator obc)
180         throws com.liferay.portal.NoSuchWebsiteException,
181             com.liferay.portal.SystemException {
182         return getPersistence().findByUserId_PrevAndNext(websiteId, userId, obc);
183     }
184 
185     public static java.util.List<com.liferay.portal.model.Website> findByC_C(
186         long companyId, long classNameId)
187         throws com.liferay.portal.SystemException {
188         return getPersistence().findByC_C(companyId, classNameId);
189     }
190 
191     public static java.util.List<com.liferay.portal.model.Website> findByC_C(
192         long companyId, long classNameId, int start, int end)
193         throws com.liferay.portal.SystemException {
194         return getPersistence().findByC_C(companyId, classNameId, start, end);
195     }
196 
197     public static java.util.List<com.liferay.portal.model.Website> findByC_C(
198         long companyId, long classNameId, int start, int end,
199         com.liferay.portal.kernel.util.OrderByComparator obc)
200         throws com.liferay.portal.SystemException {
201         return getPersistence()
202                    .findByC_C(companyId, classNameId, start, end, obc);
203     }
204 
205     public static com.liferay.portal.model.Website findByC_C_First(
206         long companyId, long classNameId,
207         com.liferay.portal.kernel.util.OrderByComparator obc)
208         throws com.liferay.portal.NoSuchWebsiteException,
209             com.liferay.portal.SystemException {
210         return getPersistence().findByC_C_First(companyId, classNameId, obc);
211     }
212 
213     public static com.liferay.portal.model.Website findByC_C_Last(
214         long companyId, long classNameId,
215         com.liferay.portal.kernel.util.OrderByComparator obc)
216         throws com.liferay.portal.NoSuchWebsiteException,
217             com.liferay.portal.SystemException {
218         return getPersistence().findByC_C_Last(companyId, classNameId, obc);
219     }
220 
221     public static com.liferay.portal.model.Website[] findByC_C_PrevAndNext(
222         long websiteId, long companyId, long classNameId,
223         com.liferay.portal.kernel.util.OrderByComparator obc)
224         throws com.liferay.portal.NoSuchWebsiteException,
225             com.liferay.portal.SystemException {
226         return getPersistence()
227                    .findByC_C_PrevAndNext(websiteId, companyId, classNameId, obc);
228     }
229 
230     public static java.util.List<com.liferay.portal.model.Website> findByC_C_C(
231         long companyId, long classNameId, long classPK)
232         throws com.liferay.portal.SystemException {
233         return getPersistence().findByC_C_C(companyId, classNameId, classPK);
234     }
235 
236     public static java.util.List<com.liferay.portal.model.Website> findByC_C_C(
237         long companyId, long classNameId, long classPK, int start, int end)
238         throws com.liferay.portal.SystemException {
239         return getPersistence()
240                    .findByC_C_C(companyId, classNameId, classPK, start, end);
241     }
242 
243     public static java.util.List<com.liferay.portal.model.Website> findByC_C_C(
244         long companyId, long classNameId, long classPK, int start, int end,
245         com.liferay.portal.kernel.util.OrderByComparator obc)
246         throws com.liferay.portal.SystemException {
247         return getPersistence()
248                    .findByC_C_C(companyId, classNameId, classPK, start, end, obc);
249     }
250 
251     public static com.liferay.portal.model.Website findByC_C_C_First(
252         long companyId, long classNameId, long classPK,
253         com.liferay.portal.kernel.util.OrderByComparator obc)
254         throws com.liferay.portal.NoSuchWebsiteException,
255             com.liferay.portal.SystemException {
256         return getPersistence()
257                    .findByC_C_C_First(companyId, classNameId, classPK, obc);
258     }
259 
260     public static com.liferay.portal.model.Website findByC_C_C_Last(
261         long companyId, long classNameId, long classPK,
262         com.liferay.portal.kernel.util.OrderByComparator obc)
263         throws com.liferay.portal.NoSuchWebsiteException,
264             com.liferay.portal.SystemException {
265         return getPersistence()
266                    .findByC_C_C_Last(companyId, classNameId, classPK, obc);
267     }
268 
269     public static com.liferay.portal.model.Website[] findByC_C_C_PrevAndNext(
270         long websiteId, long companyId, long classNameId, long classPK,
271         com.liferay.portal.kernel.util.OrderByComparator obc)
272         throws com.liferay.portal.NoSuchWebsiteException,
273             com.liferay.portal.SystemException {
274         return getPersistence()
275                    .findByC_C_C_PrevAndNext(websiteId, companyId, classNameId,
276             classPK, obc);
277     }
278 
279     public static java.util.List<com.liferay.portal.model.Website> findByC_C_C_P(
280         long companyId, long classNameId, long classPK, boolean primary)
281         throws com.liferay.portal.SystemException {
282         return getPersistence()
283                    .findByC_C_C_P(companyId, classNameId, classPK, primary);
284     }
285 
286     public static java.util.List<com.liferay.portal.model.Website> findByC_C_C_P(
287         long companyId, long classNameId, long classPK, boolean primary,
288         int start, int end) throws com.liferay.portal.SystemException {
289         return getPersistence()
290                    .findByC_C_C_P(companyId, classNameId, classPK, primary,
291             start, end);
292     }
293 
294     public static java.util.List<com.liferay.portal.model.Website> findByC_C_C_P(
295         long companyId, long classNameId, long classPK, boolean primary,
296         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
297         throws com.liferay.portal.SystemException {
298         return getPersistence()
299                    .findByC_C_C_P(companyId, classNameId, classPK, primary,
300             start, end, obc);
301     }
302 
303     public static com.liferay.portal.model.Website findByC_C_C_P_First(
304         long companyId, long classNameId, long classPK, boolean primary,
305         com.liferay.portal.kernel.util.OrderByComparator obc)
306         throws com.liferay.portal.NoSuchWebsiteException,
307             com.liferay.portal.SystemException {
308         return getPersistence()
309                    .findByC_C_C_P_First(companyId, classNameId, classPK,
310             primary, obc);
311     }
312 
313     public static com.liferay.portal.model.Website findByC_C_C_P_Last(
314         long companyId, long classNameId, long classPK, boolean primary,
315         com.liferay.portal.kernel.util.OrderByComparator obc)
316         throws com.liferay.portal.NoSuchWebsiteException,
317             com.liferay.portal.SystemException {
318         return getPersistence()
319                    .findByC_C_C_P_Last(companyId, classNameId, classPK,
320             primary, obc);
321     }
322 
323     public static com.liferay.portal.model.Website[] findByC_C_C_P_PrevAndNext(
324         long websiteId, long companyId, long classNameId, long classPK,
325         boolean primary, com.liferay.portal.kernel.util.OrderByComparator obc)
326         throws com.liferay.portal.NoSuchWebsiteException,
327             com.liferay.portal.SystemException {
328         return getPersistence()
329                    .findByC_C_C_P_PrevAndNext(websiteId, companyId,
330             classNameId, classPK, primary, obc);
331     }
332 
333     public static java.util.List<Object> findWithDynamicQuery(
334         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
335         throws com.liferay.portal.SystemException {
336         return getPersistence().findWithDynamicQuery(dynamicQuery);
337     }
338 
339     public static java.util.List<Object> findWithDynamicQuery(
340         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
341         int end) throws com.liferay.portal.SystemException {
342         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
343     }
344 
345     public static java.util.List<com.liferay.portal.model.Website> findAll()
346         throws com.liferay.portal.SystemException {
347         return getPersistence().findAll();
348     }
349 
350     public static java.util.List<com.liferay.portal.model.Website> findAll(
351         int start, int end) throws com.liferay.portal.SystemException {
352         return getPersistence().findAll(start, end);
353     }
354 
355     public static java.util.List<com.liferay.portal.model.Website> findAll(
356         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
357         throws com.liferay.portal.SystemException {
358         return getPersistence().findAll(start, end, obc);
359     }
360 
361     public static void removeByCompanyId(long companyId)
362         throws com.liferay.portal.SystemException {
363         getPersistence().removeByCompanyId(companyId);
364     }
365 
366     public static void removeByUserId(long userId)
367         throws com.liferay.portal.SystemException {
368         getPersistence().removeByUserId(userId);
369     }
370 
371     public static void removeByC_C(long companyId, long classNameId)
372         throws com.liferay.portal.SystemException {
373         getPersistence().removeByC_C(companyId, classNameId);
374     }
375 
376     public static void removeByC_C_C(long companyId, long classNameId,
377         long classPK) throws com.liferay.portal.SystemException {
378         getPersistence().removeByC_C_C(companyId, classNameId, classPK);
379     }
380 
381     public static void removeByC_C_C_P(long companyId, long classNameId,
382         long classPK, boolean primary)
383         throws com.liferay.portal.SystemException {
384         getPersistence()
385             .removeByC_C_C_P(companyId, classNameId, classPK, primary);
386     }
387 
388     public static void removeAll() throws com.liferay.portal.SystemException {
389         getPersistence().removeAll();
390     }
391 
392     public static int countByCompanyId(long companyId)
393         throws com.liferay.portal.SystemException {
394         return getPersistence().countByCompanyId(companyId);
395     }
396 
397     public static int countByUserId(long userId)
398         throws com.liferay.portal.SystemException {
399         return getPersistence().countByUserId(userId);
400     }
401 
402     public static int countByC_C(long companyId, long classNameId)
403         throws com.liferay.portal.SystemException {
404         return getPersistence().countByC_C(companyId, classNameId);
405     }
406 
407     public static int countByC_C_C(long companyId, long classNameId,
408         long classPK) throws com.liferay.portal.SystemException {
409         return getPersistence().countByC_C_C(companyId, classNameId, classPK);
410     }
411 
412     public static int countByC_C_C_P(long companyId, long classNameId,
413         long classPK, boolean primary)
414         throws com.liferay.portal.SystemException {
415         return getPersistence()
416                    .countByC_C_C_P(companyId, classNameId, classPK, primary);
417     }
418 
419     public static int countAll() throws com.liferay.portal.SystemException {
420         return getPersistence().countAll();
421     }
422 
423     public static WebsitePersistence getPersistence() {
424         return _persistence;
425     }
426 
427     public void setPersistence(WebsitePersistence persistence) {
428         _persistence = persistence;
429     }
430 
431     private static WebsitePersistence _persistence;
432 }