1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions 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.portlet.ratings.service.persistence;
24  
25  /**
26   * <a href="RatingsEntryUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class RatingsEntryUtil {
32      public static void cacheResult(
33          com.liferay.portlet.ratings.model.RatingsEntry ratingsEntry) {
34          getPersistence().cacheResult(ratingsEntry);
35      }
36  
37      public static void cacheResult(
38          java.util.List<com.liferay.portlet.ratings.model.RatingsEntry> ratingsEntries) {
39          getPersistence().cacheResult(ratingsEntries);
40      }
41  
42      public static void clearCache() {
43          getPersistence().clearCache();
44      }
45  
46      public static com.liferay.portlet.ratings.model.RatingsEntry create(
47          long entryId) {
48          return getPersistence().create(entryId);
49      }
50  
51      public static com.liferay.portlet.ratings.model.RatingsEntry remove(
52          long entryId)
53          throws com.liferay.portal.SystemException,
54              com.liferay.portlet.ratings.NoSuchEntryException {
55          return getPersistence().remove(entryId);
56      }
57  
58      public static com.liferay.portlet.ratings.model.RatingsEntry remove(
59          com.liferay.portlet.ratings.model.RatingsEntry ratingsEntry)
60          throws com.liferay.portal.SystemException {
61          return getPersistence().remove(ratingsEntry);
62      }
63  
64      /**
65       * @deprecated Use <code>update(RatingsEntry ratingsEntry, boolean merge)</code>.
66       */
67      public static com.liferay.portlet.ratings.model.RatingsEntry update(
68          com.liferay.portlet.ratings.model.RatingsEntry ratingsEntry)
69          throws com.liferay.portal.SystemException {
70          return getPersistence().update(ratingsEntry);
71      }
72  
73      /**
74       * Add, update, or merge, the entity. This method also calls the model
75       * listeners to trigger the proper events associated with adding, deleting,
76       * or updating an entity.
77       *
78       * @param        ratingsEntry the entity to add, update, or merge
79       * @param        merge boolean value for whether to merge the entity. The
80       *                default value is false. Setting merge to true is more
81       *                expensive and should only be true when ratingsEntry is
82       *                transient. See LEP-5473 for a detailed discussion of this
83       *                method.
84       * @return        true if the portlet can be displayed via Ajax
85       */
86      public static com.liferay.portlet.ratings.model.RatingsEntry update(
87          com.liferay.portlet.ratings.model.RatingsEntry ratingsEntry,
88          boolean merge) throws com.liferay.portal.SystemException {
89          return getPersistence().update(ratingsEntry, merge);
90      }
91  
92      public static com.liferay.portlet.ratings.model.RatingsEntry updateImpl(
93          com.liferay.portlet.ratings.model.RatingsEntry ratingsEntry,
94          boolean merge) throws com.liferay.portal.SystemException {
95          return getPersistence().updateImpl(ratingsEntry, merge);
96      }
97  
98      public static com.liferay.portlet.ratings.model.RatingsEntry findByPrimaryKey(
99          long entryId)
100         throws com.liferay.portal.SystemException,
101             com.liferay.portlet.ratings.NoSuchEntryException {
102         return getPersistence().findByPrimaryKey(entryId);
103     }
104 
105     public static com.liferay.portlet.ratings.model.RatingsEntry fetchByPrimaryKey(
106         long entryId) throws com.liferay.portal.SystemException {
107         return getPersistence().fetchByPrimaryKey(entryId);
108     }
109 
110     public static java.util.List<com.liferay.portlet.ratings.model.RatingsEntry> findByC_C(
111         long classNameId, long classPK)
112         throws com.liferay.portal.SystemException {
113         return getPersistence().findByC_C(classNameId, classPK);
114     }
115 
116     public static java.util.List<com.liferay.portlet.ratings.model.RatingsEntry> findByC_C(
117         long classNameId, long classPK, int start, int end)
118         throws com.liferay.portal.SystemException {
119         return getPersistence().findByC_C(classNameId, classPK, start, end);
120     }
121 
122     public static java.util.List<com.liferay.portlet.ratings.model.RatingsEntry> findByC_C(
123         long classNameId, long classPK, int start, int end,
124         com.liferay.portal.kernel.util.OrderByComparator obc)
125         throws com.liferay.portal.SystemException {
126         return getPersistence().findByC_C(classNameId, classPK, start, end, obc);
127     }
128 
129     public static com.liferay.portlet.ratings.model.RatingsEntry findByC_C_First(
130         long classNameId, long classPK,
131         com.liferay.portal.kernel.util.OrderByComparator obc)
132         throws com.liferay.portal.SystemException,
133             com.liferay.portlet.ratings.NoSuchEntryException {
134         return getPersistence().findByC_C_First(classNameId, classPK, obc);
135     }
136 
137     public static com.liferay.portlet.ratings.model.RatingsEntry findByC_C_Last(
138         long classNameId, long classPK,
139         com.liferay.portal.kernel.util.OrderByComparator obc)
140         throws com.liferay.portal.SystemException,
141             com.liferay.portlet.ratings.NoSuchEntryException {
142         return getPersistence().findByC_C_Last(classNameId, classPK, obc);
143     }
144 
145     public static com.liferay.portlet.ratings.model.RatingsEntry[] findByC_C_PrevAndNext(
146         long entryId, long classNameId, long classPK,
147         com.liferay.portal.kernel.util.OrderByComparator obc)
148         throws com.liferay.portal.SystemException,
149             com.liferay.portlet.ratings.NoSuchEntryException {
150         return getPersistence()
151                    .findByC_C_PrevAndNext(entryId, classNameId, classPK, obc);
152     }
153 
154     public static com.liferay.portlet.ratings.model.RatingsEntry findByU_C_C(
155         long userId, long classNameId, long classPK)
156         throws com.liferay.portal.SystemException,
157             com.liferay.portlet.ratings.NoSuchEntryException {
158         return getPersistence().findByU_C_C(userId, classNameId, classPK);
159     }
160 
161     public static com.liferay.portlet.ratings.model.RatingsEntry fetchByU_C_C(
162         long userId, long classNameId, long classPK)
163         throws com.liferay.portal.SystemException {
164         return getPersistence().fetchByU_C_C(userId, classNameId, classPK);
165     }
166 
167     public static com.liferay.portlet.ratings.model.RatingsEntry fetchByU_C_C(
168         long userId, long classNameId, long classPK, boolean retrieveFromCache)
169         throws com.liferay.portal.SystemException {
170         return getPersistence()
171                    .fetchByU_C_C(userId, classNameId, classPK, retrieveFromCache);
172     }
173 
174     public static java.util.List<Object> findWithDynamicQuery(
175         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
176         throws com.liferay.portal.SystemException {
177         return getPersistence().findWithDynamicQuery(dynamicQuery);
178     }
179 
180     public static java.util.List<Object> findWithDynamicQuery(
181         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
182         int end) throws com.liferay.portal.SystemException {
183         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
184     }
185 
186     public static java.util.List<com.liferay.portlet.ratings.model.RatingsEntry> findAll()
187         throws com.liferay.portal.SystemException {
188         return getPersistence().findAll();
189     }
190 
191     public static java.util.List<com.liferay.portlet.ratings.model.RatingsEntry> 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.portlet.ratings.model.RatingsEntry> findAll(
197         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
198         throws com.liferay.portal.SystemException {
199         return getPersistence().findAll(start, end, obc);
200     }
201 
202     public static void removeByC_C(long classNameId, long classPK)
203         throws com.liferay.portal.SystemException {
204         getPersistence().removeByC_C(classNameId, classPK);
205     }
206 
207     public static void removeByU_C_C(long userId, long classNameId, long classPK)
208         throws com.liferay.portal.SystemException,
209             com.liferay.portlet.ratings.NoSuchEntryException {
210         getPersistence().removeByU_C_C(userId, classNameId, classPK);
211     }
212 
213     public static void removeAll() throws com.liferay.portal.SystemException {
214         getPersistence().removeAll();
215     }
216 
217     public static int countByC_C(long classNameId, long classPK)
218         throws com.liferay.portal.SystemException {
219         return getPersistence().countByC_C(classNameId, classPK);
220     }
221 
222     public static int countByU_C_C(long userId, long classNameId, long classPK)
223         throws com.liferay.portal.SystemException {
224         return getPersistence().countByU_C_C(userId, classNameId, classPK);
225     }
226 
227     public static int countAll() throws com.liferay.portal.SystemException {
228         return getPersistence().countAll();
229     }
230 
231     public static RatingsEntryPersistence getPersistence() {
232         return _persistence;
233     }
234 
235     public void setPersistence(RatingsEntryPersistence persistence) {
236         _persistence = persistence;
237     }
238 
239     private static RatingsEntryPersistence _persistence;
240 }