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