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