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="RatingsStatsUtil.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   *
27   */
28  public class RatingsStatsUtil {
29      public static void cacheResult(
30          com.liferay.portlet.ratings.model.RatingsStats ratingsStats) {
31          getPersistence().cacheResult(ratingsStats);
32      }
33  
34      public static void cacheResult(
35          java.util.List<com.liferay.portlet.ratings.model.RatingsStats> ratingsStatses) {
36          getPersistence().cacheResult(ratingsStatses);
37      }
38  
39      public static void clearCache() {
40          getPersistence().clearCache();
41      }
42  
43      public static com.liferay.portlet.ratings.model.RatingsStats create(
44          long statsId) {
45          return getPersistence().create(statsId);
46      }
47  
48      public static com.liferay.portlet.ratings.model.RatingsStats remove(
49          long statsId)
50          throws com.liferay.portal.SystemException,
51              com.liferay.portlet.ratings.NoSuchStatsException {
52          return getPersistence().remove(statsId);
53      }
54  
55      public static com.liferay.portlet.ratings.model.RatingsStats remove(
56          com.liferay.portlet.ratings.model.RatingsStats ratingsStats)
57          throws com.liferay.portal.SystemException {
58          return getPersistence().remove(ratingsStats);
59      }
60  
61      /**
62       * @deprecated Use <code>update(RatingsStats ratingsStats, boolean merge)</code>.
63       */
64      public static com.liferay.portlet.ratings.model.RatingsStats update(
65          com.liferay.portlet.ratings.model.RatingsStats ratingsStats)
66          throws com.liferay.portal.SystemException {
67          return getPersistence().update(ratingsStats);
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        ratingsStats 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 ratingsStats 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.RatingsStats update(
84          com.liferay.portlet.ratings.model.RatingsStats ratingsStats,
85          boolean merge) throws com.liferay.portal.SystemException {
86          return getPersistence().update(ratingsStats, merge);
87      }
88  
89      public static com.liferay.portlet.ratings.model.RatingsStats updateImpl(
90          com.liferay.portlet.ratings.model.RatingsStats ratingsStats,
91          boolean merge) throws com.liferay.portal.SystemException {
92          return getPersistence().updateImpl(ratingsStats, merge);
93      }
94  
95      public static com.liferay.portlet.ratings.model.RatingsStats findByPrimaryKey(
96          long statsId)
97          throws com.liferay.portal.SystemException,
98              com.liferay.portlet.ratings.NoSuchStatsException {
99          return getPersistence().findByPrimaryKey(statsId);
100     }
101 
102     public static com.liferay.portlet.ratings.model.RatingsStats fetchByPrimaryKey(
103         long statsId) throws com.liferay.portal.SystemException {
104         return getPersistence().fetchByPrimaryKey(statsId);
105     }
106 
107     public static com.liferay.portlet.ratings.model.RatingsStats findByC_C(
108         long classNameId, long classPK)
109         throws com.liferay.portal.SystemException,
110             com.liferay.portlet.ratings.NoSuchStatsException {
111         return getPersistence().findByC_C(classNameId, classPK);
112     }
113 
114     public static com.liferay.portlet.ratings.model.RatingsStats fetchByC_C(
115         long classNameId, long classPK)
116         throws com.liferay.portal.SystemException {
117         return getPersistence().fetchByC_C(classNameId, classPK);
118     }
119 
120     public static com.liferay.portlet.ratings.model.RatingsStats fetchByC_C(
121         long classNameId, long classPK, boolean retrieveFromCache)
122         throws com.liferay.portal.SystemException {
123         return getPersistence()
124                    .fetchByC_C(classNameId, classPK, retrieveFromCache);
125     }
126 
127     public static java.util.List<Object> findWithDynamicQuery(
128         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
129         throws com.liferay.portal.SystemException {
130         return getPersistence().findWithDynamicQuery(dynamicQuery);
131     }
132 
133     public static java.util.List<Object> findWithDynamicQuery(
134         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
135         int end) throws com.liferay.portal.SystemException {
136         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
137     }
138 
139     public static java.util.List<com.liferay.portlet.ratings.model.RatingsStats> findAll()
140         throws com.liferay.portal.SystemException {
141         return getPersistence().findAll();
142     }
143 
144     public static java.util.List<com.liferay.portlet.ratings.model.RatingsStats> findAll(
145         int start, int end) throws com.liferay.portal.SystemException {
146         return getPersistence().findAll(start, end);
147     }
148 
149     public static java.util.List<com.liferay.portlet.ratings.model.RatingsStats> findAll(
150         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
151         throws com.liferay.portal.SystemException {
152         return getPersistence().findAll(start, end, obc);
153     }
154 
155     public static void removeByC_C(long classNameId, long classPK)
156         throws com.liferay.portal.SystemException,
157             com.liferay.portlet.ratings.NoSuchStatsException {
158         getPersistence().removeByC_C(classNameId, classPK);
159     }
160 
161     public static void removeAll() throws com.liferay.portal.SystemException {
162         getPersistence().removeAll();
163     }
164 
165     public static int countByC_C(long classNameId, long classPK)
166         throws com.liferay.portal.SystemException {
167         return getPersistence().countByC_C(classNameId, classPK);
168     }
169 
170     public static int countAll() throws com.liferay.portal.SystemException {
171         return getPersistence().countAll();
172     }
173 
174     public static RatingsStatsPersistence getPersistence() {
175         return _persistence;
176     }
177 
178     public void setPersistence(RatingsStatsPersistence persistence) {
179         _persistence = persistence;
180     }
181 
182     private static RatingsStatsPersistence _persistence;
183 }