001 /** 002 * Copyright (c) 2000-2011 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#remove(com.liferay.portal.model.BaseModel) 099 */ 100 public static RatingsStats remove(RatingsStats ratingsStats) 101 throws SystemException { 102 return getPersistence().remove(ratingsStats); 103 } 104 105 /** 106 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean) 107 */ 108 public static RatingsStats update(RatingsStats ratingsStats, boolean merge) 109 throws SystemException { 110 return getPersistence().update(ratingsStats, merge); 111 } 112 113 /** 114 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext) 115 */ 116 public static RatingsStats update(RatingsStats ratingsStats, boolean merge, 117 ServiceContext serviceContext) throws SystemException { 118 return getPersistence().update(ratingsStats, merge, serviceContext); 119 } 120 121 /** 122 * Caches the ratings stats in the entity cache if it is enabled. 123 * 124 * @param ratingsStats the ratings stats 125 */ 126 public static void cacheResult( 127 com.liferay.portlet.ratings.model.RatingsStats ratingsStats) { 128 getPersistence().cacheResult(ratingsStats); 129 } 130 131 /** 132 * Caches the ratings statses in the entity cache if it is enabled. 133 * 134 * @param ratingsStatses the ratings statses 135 */ 136 public static void cacheResult( 137 java.util.List<com.liferay.portlet.ratings.model.RatingsStats> ratingsStatses) { 138 getPersistence().cacheResult(ratingsStatses); 139 } 140 141 /** 142 * Creates a new ratings stats with the primary key. Does not add the ratings stats to the database. 143 * 144 * @param statsId the primary key for the new ratings stats 145 * @return the new ratings stats 146 */ 147 public static com.liferay.portlet.ratings.model.RatingsStats create( 148 long statsId) { 149 return getPersistence().create(statsId); 150 } 151 152 /** 153 * Removes the ratings stats with the primary key from the database. Also notifies the appropriate model listeners. 154 * 155 * @param statsId the primary key of the ratings stats 156 * @return the ratings stats that was removed 157 * @throws com.liferay.portlet.ratings.NoSuchStatsException if a ratings stats with the primary key could not be found 158 * @throws SystemException if a system exception occurred 159 */ 160 public static com.liferay.portlet.ratings.model.RatingsStats remove( 161 long statsId) 162 throws com.liferay.portal.kernel.exception.SystemException, 163 com.liferay.portlet.ratings.NoSuchStatsException { 164 return getPersistence().remove(statsId); 165 } 166 167 public static com.liferay.portlet.ratings.model.RatingsStats updateImpl( 168 com.liferay.portlet.ratings.model.RatingsStats ratingsStats, 169 boolean merge) 170 throws com.liferay.portal.kernel.exception.SystemException { 171 return getPersistence().updateImpl(ratingsStats, merge); 172 } 173 174 /** 175 * Returns the ratings stats with the primary key or throws a {@link com.liferay.portlet.ratings.NoSuchStatsException} if it could not be found. 176 * 177 * @param statsId the primary key of the ratings stats 178 * @return the ratings stats 179 * @throws com.liferay.portlet.ratings.NoSuchStatsException if a ratings stats with the primary key could not be found 180 * @throws SystemException if a system exception occurred 181 */ 182 public static com.liferay.portlet.ratings.model.RatingsStats findByPrimaryKey( 183 long statsId) 184 throws com.liferay.portal.kernel.exception.SystemException, 185 com.liferay.portlet.ratings.NoSuchStatsException { 186 return getPersistence().findByPrimaryKey(statsId); 187 } 188 189 /** 190 * Returns the ratings stats with the primary key or returns <code>null</code> if it could not be found. 191 * 192 * @param statsId the primary key of the ratings stats 193 * @return the ratings stats, or <code>null</code> if a ratings stats with the primary key could not be found 194 * @throws SystemException if a system exception occurred 195 */ 196 public static com.liferay.portlet.ratings.model.RatingsStats fetchByPrimaryKey( 197 long statsId) 198 throws com.liferay.portal.kernel.exception.SystemException { 199 return getPersistence().fetchByPrimaryKey(statsId); 200 } 201 202 /** 203 * Returns the ratings stats where classNameId = ? and classPK = ? or throws a {@link com.liferay.portlet.ratings.NoSuchStatsException} if it could not be found. 204 * 205 * @param classNameId the class name ID 206 * @param classPK the class p k 207 * @return the matching ratings stats 208 * @throws com.liferay.portlet.ratings.NoSuchStatsException if a matching ratings stats could not be found 209 * @throws SystemException if a system exception occurred 210 */ 211 public static com.liferay.portlet.ratings.model.RatingsStats findByC_C( 212 long classNameId, long classPK) 213 throws com.liferay.portal.kernel.exception.SystemException, 214 com.liferay.portlet.ratings.NoSuchStatsException { 215 return getPersistence().findByC_C(classNameId, classPK); 216 } 217 218 /** 219 * Returns the ratings stats where classNameId = ? and classPK = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 220 * 221 * @param classNameId the class name ID 222 * @param classPK the class p k 223 * @return the matching ratings stats, or <code>null</code> if a matching ratings stats could not be found 224 * @throws SystemException if a system exception occurred 225 */ 226 public static com.liferay.portlet.ratings.model.RatingsStats fetchByC_C( 227 long classNameId, long classPK) 228 throws com.liferay.portal.kernel.exception.SystemException { 229 return getPersistence().fetchByC_C(classNameId, classPK); 230 } 231 232 /** 233 * Returns the ratings stats where classNameId = ? and classPK = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 234 * 235 * @param classNameId the class name ID 236 * @param classPK the class p k 237 * @param retrieveFromCache whether to use the finder cache 238 * @return the matching ratings stats, or <code>null</code> if a matching ratings stats could not be found 239 * @throws SystemException if a system exception occurred 240 */ 241 public static com.liferay.portlet.ratings.model.RatingsStats fetchByC_C( 242 long classNameId, long classPK, boolean retrieveFromCache) 243 throws com.liferay.portal.kernel.exception.SystemException { 244 return getPersistence() 245 .fetchByC_C(classNameId, classPK, retrieveFromCache); 246 } 247 248 /** 249 * Returns all the ratings statses. 250 * 251 * @return the ratings statses 252 * @throws SystemException if a system exception occurred 253 */ 254 public static java.util.List<com.liferay.portlet.ratings.model.RatingsStats> findAll() 255 throws com.liferay.portal.kernel.exception.SystemException { 256 return getPersistence().findAll(); 257 } 258 259 /** 260 * Returns a range of all the ratings statses. 261 * 262 * <p> 263 * 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. 264 * </p> 265 * 266 * @param start the lower bound of the range of ratings statses 267 * @param end the upper bound of the range of ratings statses (not inclusive) 268 * @return the range of ratings statses 269 * @throws SystemException if a system exception occurred 270 */ 271 public static java.util.List<com.liferay.portlet.ratings.model.RatingsStats> findAll( 272 int start, int end) 273 throws com.liferay.portal.kernel.exception.SystemException { 274 return getPersistence().findAll(start, end); 275 } 276 277 /** 278 * Returns an ordered range of all the ratings statses. 279 * 280 * <p> 281 * 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. 282 * </p> 283 * 284 * @param start the lower bound of the range of ratings statses 285 * @param end the upper bound of the range of ratings statses (not inclusive) 286 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 287 * @return the ordered range of ratings statses 288 * @throws SystemException if a system exception occurred 289 */ 290 public static java.util.List<com.liferay.portlet.ratings.model.RatingsStats> findAll( 291 int start, int end, 292 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 293 throws com.liferay.portal.kernel.exception.SystemException { 294 return getPersistence().findAll(start, end, orderByComparator); 295 } 296 297 /** 298 * Removes the ratings stats where classNameId = ? and classPK = ? from the database. 299 * 300 * @param classNameId the class name ID 301 * @param classPK the class p k 302 * @throws SystemException if a system exception occurred 303 */ 304 public static void removeByC_C(long classNameId, long classPK) 305 throws com.liferay.portal.kernel.exception.SystemException, 306 com.liferay.portlet.ratings.NoSuchStatsException { 307 getPersistence().removeByC_C(classNameId, classPK); 308 } 309 310 /** 311 * Removes all the ratings statses from the database. 312 * 313 * @throws SystemException if a system exception occurred 314 */ 315 public static void removeAll() 316 throws com.liferay.portal.kernel.exception.SystemException { 317 getPersistence().removeAll(); 318 } 319 320 /** 321 * Returns the number of ratings statses where classNameId = ? and classPK = ?. 322 * 323 * @param classNameId the class name ID 324 * @param classPK the class p k 325 * @return the number of matching ratings statses 326 * @throws SystemException if a system exception occurred 327 */ 328 public static int countByC_C(long classNameId, long classPK) 329 throws com.liferay.portal.kernel.exception.SystemException { 330 return getPersistence().countByC_C(classNameId, classPK); 331 } 332 333 /** 334 * Returns the number of ratings statses. 335 * 336 * @return the number of ratings statses 337 * @throws SystemException if a system exception occurred 338 */ 339 public static int countAll() 340 throws com.liferay.portal.kernel.exception.SystemException { 341 return getPersistence().countAll(); 342 } 343 344 public static RatingsStatsPersistence getPersistence() { 345 if (_persistence == null) { 346 _persistence = (RatingsStatsPersistence)PortalBeanLocatorUtil.locate(RatingsStatsPersistence.class.getName()); 347 348 ReferenceRegistry.registerReference(RatingsStatsUtil.class, 349 "_persistence"); 350 } 351 352 return _persistence; 353 } 354 355 public void setPersistence(RatingsStatsPersistence persistence) { 356 _persistence = persistence; 357 358 ReferenceRegistry.registerReference(RatingsStatsUtil.class, 359 "_persistence"); 360 } 361 362 private static RatingsStatsPersistence _persistence; 363 }