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 com.liferay.portlet.ratings.model.RatingsStats create(
30          long statsId) {
31          return getPersistence().create(statsId);
32      }
33  
34      public static com.liferay.portlet.ratings.model.RatingsStats remove(
35          long statsId)
36          throws com.liferay.portal.SystemException,
37              com.liferay.portlet.ratings.NoSuchStatsException {
38          return getPersistence().remove(statsId);
39      }
40  
41      public static com.liferay.portlet.ratings.model.RatingsStats remove(
42          com.liferay.portlet.ratings.model.RatingsStats ratingsStats)
43          throws com.liferay.portal.SystemException {
44          return getPersistence().remove(ratingsStats);
45      }
46  
47      /**
48       * @deprecated Use <code>update(RatingsStats ratingsStats, boolean merge)</code>.
49       */
50      public static com.liferay.portlet.ratings.model.RatingsStats update(
51          com.liferay.portlet.ratings.model.RatingsStats ratingsStats)
52          throws com.liferay.portal.SystemException {
53          return getPersistence().update(ratingsStats);
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        ratingsStats 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 ratingsStats 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.RatingsStats update(
70          com.liferay.portlet.ratings.model.RatingsStats ratingsStats,
71          boolean merge) throws com.liferay.portal.SystemException {
72          return getPersistence().update(ratingsStats, merge);
73      }
74  
75      public static com.liferay.portlet.ratings.model.RatingsStats updateImpl(
76          com.liferay.portlet.ratings.model.RatingsStats ratingsStats,
77          boolean merge) throws com.liferay.portal.SystemException {
78          return getPersistence().updateImpl(ratingsStats, merge);
79      }
80  
81      public static com.liferay.portlet.ratings.model.RatingsStats findByPrimaryKey(
82          long statsId)
83          throws com.liferay.portal.SystemException,
84              com.liferay.portlet.ratings.NoSuchStatsException {
85          return getPersistence().findByPrimaryKey(statsId);
86      }
87  
88      public static com.liferay.portlet.ratings.model.RatingsStats fetchByPrimaryKey(
89          long statsId) throws com.liferay.portal.SystemException {
90          return getPersistence().fetchByPrimaryKey(statsId);
91      }
92  
93      public static com.liferay.portlet.ratings.model.RatingsStats findByC_C(
94          long classNameId, long classPK)
95          throws com.liferay.portal.SystemException,
96              com.liferay.portlet.ratings.NoSuchStatsException {
97          return getPersistence().findByC_C(classNameId, classPK);
98      }
99  
100     public static com.liferay.portlet.ratings.model.RatingsStats fetchByC_C(
101         long classNameId, long classPK)
102         throws com.liferay.portal.SystemException {
103         return getPersistence().fetchByC_C(classNameId, classPK);
104     }
105 
106     public static java.util.List<Object> findWithDynamicQuery(
107         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
108         throws com.liferay.portal.SystemException {
109         return getPersistence().findWithDynamicQuery(dynamicQuery);
110     }
111 
112     public static java.util.List<Object> findWithDynamicQuery(
113         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
114         int end) throws com.liferay.portal.SystemException {
115         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
116     }
117 
118     public static java.util.List<com.liferay.portlet.ratings.model.RatingsStats> findAll()
119         throws com.liferay.portal.SystemException {
120         return getPersistence().findAll();
121     }
122 
123     public static java.util.List<com.liferay.portlet.ratings.model.RatingsStats> findAll(
124         int start, int end) throws com.liferay.portal.SystemException {
125         return getPersistence().findAll(start, end);
126     }
127 
128     public static java.util.List<com.liferay.portlet.ratings.model.RatingsStats> findAll(
129         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
130         throws com.liferay.portal.SystemException {
131         return getPersistence().findAll(start, end, obc);
132     }
133 
134     public static void removeByC_C(long classNameId, long classPK)
135         throws com.liferay.portal.SystemException,
136             com.liferay.portlet.ratings.NoSuchStatsException {
137         getPersistence().removeByC_C(classNameId, classPK);
138     }
139 
140     public static void removeAll() throws com.liferay.portal.SystemException {
141         getPersistence().removeAll();
142     }
143 
144     public static int countByC_C(long classNameId, long classPK)
145         throws com.liferay.portal.SystemException {
146         return getPersistence().countByC_C(classNameId, classPK);
147     }
148 
149     public static int countAll() throws com.liferay.portal.SystemException {
150         return getPersistence().countAll();
151     }
152 
153     public static RatingsStatsPersistence getPersistence() {
154         return _persistence;
155     }
156 
157     public void setPersistence(RatingsStatsPersistence persistence) {
158         _persistence = persistence;
159     }
160 
161     private static RatingsStatsPersistence _persistence;
162 }