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