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