001 /** 002 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved. 003 * 004 * This library is free software; you can redistribute it and/or modify it under 005 * the terms of the GNU Lesser General Public License as published by the Free 006 * Software Foundation; either version 2.1 of the License, or (at your option) 007 * any later version. 008 * 009 * This library is distributed in the hope that it will be useful, but WITHOUT 010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 012 * details. 013 */ 014 015 package com.liferay.portlet.ratings.service.persistence; 016 017 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 018 import com.liferay.portal.kernel.dao.orm.DynamicQuery; 019 import com.liferay.portal.kernel.exception.SystemException; 020 import com.liferay.portal.kernel.util.OrderByComparator; 021 import com.liferay.portal.kernel.util.ReferenceRegistry; 022 import com.liferay.portal.service.ServiceContext; 023 024 import com.liferay.portlet.ratings.model.RatingsStats; 025 026 import java.util.List; 027 028 /** 029 * The persistence utility for the ratings stats service. This utility wraps {@link RatingsStatsPersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class. 030 * 031 * <p> 032 * Caching information and settings can be found in <code>portal.properties</code> 033 * </p> 034 * 035 * @author Brian Wing Shun Chan 036 * @see RatingsStatsPersistence 037 * @see RatingsStatsPersistenceImpl 038 * @generated 039 */ 040 public class RatingsStatsUtil { 041 /* 042 * NOTE FOR DEVELOPERS: 043 * 044 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class. 045 */ 046 047 /** 048 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() 049 */ 050 public static void clearCache() { 051 getPersistence().clearCache(); 052 } 053 054 /** 055 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) 056 */ 057 public static void clearCache(RatingsStats ratingsStats) { 058 getPersistence().clearCache(ratingsStats); 059 } 060 061 /** 062 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 063 */ 064 public long countWithDynamicQuery(DynamicQuery dynamicQuery) 065 throws SystemException { 066 return getPersistence().countWithDynamicQuery(dynamicQuery); 067 } 068 069 /** 070 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 071 */ 072 public static List<RatingsStats> findWithDynamicQuery( 073 DynamicQuery dynamicQuery) throws SystemException { 074 return getPersistence().findWithDynamicQuery(dynamicQuery); 075 } 076 077 /** 078 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 079 */ 080 public static List<RatingsStats> findWithDynamicQuery( 081 DynamicQuery dynamicQuery, int start, int end) 082 throws SystemException { 083 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end); 084 } 085 086 /** 087 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator) 088 */ 089 public static List<RatingsStats> findWithDynamicQuery( 090 DynamicQuery dynamicQuery, int start, int end, 091 OrderByComparator orderByComparator) throws SystemException { 092 return getPersistence() 093 .findWithDynamicQuery(dynamicQuery, start, end, 094 orderByComparator); 095 } 096 097 /** 098 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel) 099 */ 100 public static RatingsStats update(RatingsStats ratingsStats) 101 throws SystemException { 102 return getPersistence().update(ratingsStats); 103 } 104 105 /** 106 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext) 107 */ 108 public static RatingsStats update(RatingsStats ratingsStats, 109 ServiceContext serviceContext) throws SystemException { 110 return getPersistence().update(ratingsStats, serviceContext); 111 } 112 113 /** 114 * Caches the ratings stats in the entity cache if it is enabled. 115 * 116 * @param ratingsStats the ratings stats 117 */ 118 public static void cacheResult( 119 com.liferay.portlet.ratings.model.RatingsStats ratingsStats) { 120 getPersistence().cacheResult(ratingsStats); 121 } 122 123 /** 124 * Caches the ratings statses in the entity cache if it is enabled. 125 * 126 * @param ratingsStatses the ratings statses 127 */ 128 public static void cacheResult( 129 java.util.List<com.liferay.portlet.ratings.model.RatingsStats> ratingsStatses) { 130 getPersistence().cacheResult(ratingsStatses); 131 } 132 133 /** 134 * Creates a new ratings stats with the primary key. Does not add the ratings stats to the database. 135 * 136 * @param statsId the primary key for the new ratings stats 137 * @return the new ratings stats 138 */ 139 public static com.liferay.portlet.ratings.model.RatingsStats create( 140 long statsId) { 141 return getPersistence().create(statsId); 142 } 143 144 /** 145 * Removes the ratings stats with the primary key from the database. Also notifies the appropriate model listeners. 146 * 147 * @param statsId the primary key of the ratings stats 148 * @return the ratings stats that was removed 149 * @throws com.liferay.portlet.ratings.NoSuchStatsException if a ratings stats with the primary key could not be found 150 * @throws SystemException if a system exception occurred 151 */ 152 public static com.liferay.portlet.ratings.model.RatingsStats remove( 153 long statsId) 154 throws com.liferay.portal.kernel.exception.SystemException, 155 com.liferay.portlet.ratings.NoSuchStatsException { 156 return getPersistence().remove(statsId); 157 } 158 159 public static com.liferay.portlet.ratings.model.RatingsStats updateImpl( 160 com.liferay.portlet.ratings.model.RatingsStats ratingsStats) 161 throws com.liferay.portal.kernel.exception.SystemException { 162 return getPersistence().updateImpl(ratingsStats); 163 } 164 165 /** 166 * Returns the ratings stats with the primary key or throws a {@link com.liferay.portlet.ratings.NoSuchStatsException} if it could not be found. 167 * 168 * @param statsId the primary key of the ratings stats 169 * @return the ratings stats 170 * @throws com.liferay.portlet.ratings.NoSuchStatsException if a ratings stats with the primary key could not be found 171 * @throws SystemException if a system exception occurred 172 */ 173 public static com.liferay.portlet.ratings.model.RatingsStats findByPrimaryKey( 174 long statsId) 175 throws com.liferay.portal.kernel.exception.SystemException, 176 com.liferay.portlet.ratings.NoSuchStatsException { 177 return getPersistence().findByPrimaryKey(statsId); 178 } 179 180 /** 181 * Returns the ratings stats with the primary key or returns <code>null</code> if it could not be found. 182 * 183 * @param statsId the primary key of the ratings stats 184 * @return the ratings stats, or <code>null</code> if a ratings stats with the primary key could not be found 185 * @throws SystemException if a system exception occurred 186 */ 187 public static com.liferay.portlet.ratings.model.RatingsStats fetchByPrimaryKey( 188 long statsId) 189 throws com.liferay.portal.kernel.exception.SystemException { 190 return getPersistence().fetchByPrimaryKey(statsId); 191 } 192 193 /** 194 * Returns the ratings stats where classNameId = ? and classPK = ? or throws a {@link com.liferay.portlet.ratings.NoSuchStatsException} if it could not be found. 195 * 196 * @param classNameId the class name ID 197 * @param classPK the class p k 198 * @return the matching ratings stats 199 * @throws com.liferay.portlet.ratings.NoSuchStatsException if a matching ratings stats could not be found 200 * @throws SystemException if a system exception occurred 201 */ 202 public static com.liferay.portlet.ratings.model.RatingsStats findByC_C( 203 long classNameId, long classPK) 204 throws com.liferay.portal.kernel.exception.SystemException, 205 com.liferay.portlet.ratings.NoSuchStatsException { 206 return getPersistence().findByC_C(classNameId, classPK); 207 } 208 209 /** 210 * Returns the ratings stats where classNameId = ? and classPK = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 211 * 212 * @param classNameId the class name ID 213 * @param classPK the class p k 214 * @return the matching ratings stats, or <code>null</code> if a matching ratings stats could not be found 215 * @throws SystemException if a system exception occurred 216 */ 217 public static com.liferay.portlet.ratings.model.RatingsStats fetchByC_C( 218 long classNameId, long classPK) 219 throws com.liferay.portal.kernel.exception.SystemException { 220 return getPersistence().fetchByC_C(classNameId, classPK); 221 } 222 223 /** 224 * Returns the ratings stats where classNameId = ? and classPK = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 225 * 226 * @param classNameId the class name ID 227 * @param classPK the class p k 228 * @param retrieveFromCache whether to use the finder cache 229 * @return the matching ratings stats, or <code>null</code> if a matching ratings stats could not be found 230 * @throws SystemException if a system exception occurred 231 */ 232 public static com.liferay.portlet.ratings.model.RatingsStats fetchByC_C( 233 long classNameId, long classPK, boolean retrieveFromCache) 234 throws com.liferay.portal.kernel.exception.SystemException { 235 return getPersistence() 236 .fetchByC_C(classNameId, classPK, retrieveFromCache); 237 } 238 239 /** 240 * Returns all the ratings statses. 241 * 242 * @return the ratings statses 243 * @throws SystemException if a system exception occurred 244 */ 245 public static java.util.List<com.liferay.portlet.ratings.model.RatingsStats> findAll() 246 throws com.liferay.portal.kernel.exception.SystemException { 247 return getPersistence().findAll(); 248 } 249 250 /** 251 * Returns a range of all the ratings statses. 252 * 253 * <p> 254 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. 255 * </p> 256 * 257 * @param start the lower bound of the range of ratings statses 258 * @param end the upper bound of the range of ratings statses (not inclusive) 259 * @return the range of ratings statses 260 * @throws SystemException if a system exception occurred 261 */ 262 public static java.util.List<com.liferay.portlet.ratings.model.RatingsStats> findAll( 263 int start, int end) 264 throws com.liferay.portal.kernel.exception.SystemException { 265 return getPersistence().findAll(start, end); 266 } 267 268 /** 269 * Returns an ordered range of all the ratings statses. 270 * 271 * <p> 272 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. 273 * </p> 274 * 275 * @param start the lower bound of the range of ratings statses 276 * @param end the upper bound of the range of ratings statses (not inclusive) 277 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 278 * @return the ordered range of ratings statses 279 * @throws SystemException if a system exception occurred 280 */ 281 public static java.util.List<com.liferay.portlet.ratings.model.RatingsStats> findAll( 282 int start, int end, 283 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 284 throws com.liferay.portal.kernel.exception.SystemException { 285 return getPersistence().findAll(start, end, orderByComparator); 286 } 287 288 /** 289 * Removes the ratings stats where classNameId = ? and classPK = ? from the database. 290 * 291 * @param classNameId the class name ID 292 * @param classPK the class p k 293 * @return the ratings stats that was removed 294 * @throws SystemException if a system exception occurred 295 */ 296 public static com.liferay.portlet.ratings.model.RatingsStats removeByC_C( 297 long classNameId, long classPK) 298 throws com.liferay.portal.kernel.exception.SystemException, 299 com.liferay.portlet.ratings.NoSuchStatsException { 300 return getPersistence().removeByC_C(classNameId, classPK); 301 } 302 303 /** 304 * Removes all the ratings statses from the database. 305 * 306 * @throws SystemException if a system exception occurred 307 */ 308 public static void removeAll() 309 throws com.liferay.portal.kernel.exception.SystemException { 310 getPersistence().removeAll(); 311 } 312 313 /** 314 * Returns the number of ratings statses where classNameId = ? and classPK = ?. 315 * 316 * @param classNameId the class name ID 317 * @param classPK the class p k 318 * @return the number of matching ratings statses 319 * @throws SystemException if a system exception occurred 320 */ 321 public static int countByC_C(long classNameId, long classPK) 322 throws com.liferay.portal.kernel.exception.SystemException { 323 return getPersistence().countByC_C(classNameId, classPK); 324 } 325 326 /** 327 * Returns the number of ratings statses. 328 * 329 * @return the number of ratings statses 330 * @throws SystemException if a system exception occurred 331 */ 332 public static int countAll() 333 throws com.liferay.portal.kernel.exception.SystemException { 334 return getPersistence().countAll(); 335 } 336 337 public static RatingsStatsPersistence getPersistence() { 338 if (_persistence == null) { 339 _persistence = (RatingsStatsPersistence)PortalBeanLocatorUtil.locate(RatingsStatsPersistence.class.getName()); 340 341 ReferenceRegistry.registerReference(RatingsStatsUtil.class, 342 "_persistence"); 343 } 344 345 return _persistence; 346 } 347 348 /** 349 * @deprecated 350 */ 351 public void setPersistence(RatingsStatsPersistence persistence) { 352 } 353 354 private static RatingsStatsPersistence _persistence; 355 }