001 /** 002 * Copyright (c) 2000-present 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 aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 020 import com.liferay.portal.kernel.dao.orm.DynamicQuery; 021 import com.liferay.portal.kernel.util.OrderByComparator; 022 import com.liferay.portal.kernel.util.ReferenceRegistry; 023 import com.liferay.portal.service.ServiceContext; 024 025 import com.liferay.portlet.ratings.model.RatingsStats; 026 027 import java.util.List; 028 029 /** 030 * 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. 031 * 032 * <p> 033 * Caching information and settings can be found in <code>portal.properties</code> 034 * </p> 035 * 036 * @author Brian Wing Shun Chan 037 * @see RatingsStatsPersistence 038 * @see RatingsStatsPersistenceImpl 039 * @generated 040 */ 041 @ProviderType 042 public class RatingsStatsUtil { 043 /* 044 * NOTE FOR DEVELOPERS: 045 * 046 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class. 047 */ 048 049 /** 050 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() 051 */ 052 public static void clearCache() { 053 getPersistence().clearCache(); 054 } 055 056 /** 057 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) 058 */ 059 public static void clearCache(RatingsStats ratingsStats) { 060 getPersistence().clearCache(ratingsStats); 061 } 062 063 /** 064 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 065 */ 066 public static long countWithDynamicQuery(DynamicQuery dynamicQuery) { 067 return getPersistence().countWithDynamicQuery(dynamicQuery); 068 } 069 070 /** 071 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 072 */ 073 public static List<RatingsStats> findWithDynamicQuery( 074 DynamicQuery dynamicQuery) { 075 return getPersistence().findWithDynamicQuery(dynamicQuery); 076 } 077 078 /** 079 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 080 */ 081 public static List<RatingsStats> findWithDynamicQuery( 082 DynamicQuery dynamicQuery, int start, int end) { 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<RatingsStats> orderByComparator) { 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 return getPersistence().update(ratingsStats); 102 } 103 104 /** 105 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext) 106 */ 107 public static RatingsStats update(RatingsStats ratingsStats, 108 ServiceContext serviceContext) { 109 return getPersistence().update(ratingsStats, serviceContext); 110 } 111 112 /** 113 * Returns the ratings stats where classNameId = ? and classPK = ? or throws a {@link com.liferay.portlet.ratings.NoSuchStatsException} if it could not be found. 114 * 115 * @param classNameId the class name ID 116 * @param classPK the class p k 117 * @return the matching ratings stats 118 * @throws com.liferay.portlet.ratings.NoSuchStatsException if a matching ratings stats could not be found 119 */ 120 public static com.liferay.portlet.ratings.model.RatingsStats findByC_C( 121 long classNameId, long classPK) 122 throws com.liferay.portlet.ratings.NoSuchStatsException { 123 return getPersistence().findByC_C(classNameId, classPK); 124 } 125 126 /** 127 * Returns the ratings stats where classNameId = ? and classPK = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 128 * 129 * @param classNameId the class name ID 130 * @param classPK the class p k 131 * @return the matching ratings stats, or <code>null</code> if a matching ratings stats could not be found 132 */ 133 public static com.liferay.portlet.ratings.model.RatingsStats fetchByC_C( 134 long classNameId, long classPK) { 135 return getPersistence().fetchByC_C(classNameId, classPK); 136 } 137 138 /** 139 * Returns the ratings stats where classNameId = ? and classPK = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 140 * 141 * @param classNameId the class name ID 142 * @param classPK the class p k 143 * @param retrieveFromCache whether to use the finder cache 144 * @return the matching ratings stats, or <code>null</code> if a matching ratings stats could not be found 145 */ 146 public static com.liferay.portlet.ratings.model.RatingsStats fetchByC_C( 147 long classNameId, long classPK, boolean retrieveFromCache) { 148 return getPersistence() 149 .fetchByC_C(classNameId, classPK, retrieveFromCache); 150 } 151 152 /** 153 * Removes the ratings stats where classNameId = ? and classPK = ? from the database. 154 * 155 * @param classNameId the class name ID 156 * @param classPK the class p k 157 * @return the ratings stats that was removed 158 */ 159 public static com.liferay.portlet.ratings.model.RatingsStats removeByC_C( 160 long classNameId, long classPK) 161 throws com.liferay.portlet.ratings.NoSuchStatsException { 162 return getPersistence().removeByC_C(classNameId, classPK); 163 } 164 165 /** 166 * Returns the number of ratings statses where classNameId = ? and classPK = ?. 167 * 168 * @param classNameId the class name ID 169 * @param classPK the class p k 170 * @return the number of matching ratings statses 171 */ 172 public static int countByC_C(long classNameId, long classPK) { 173 return getPersistence().countByC_C(classNameId, classPK); 174 } 175 176 /** 177 * Caches the ratings stats in the entity cache if it is enabled. 178 * 179 * @param ratingsStats the ratings stats 180 */ 181 public static void cacheResult( 182 com.liferay.portlet.ratings.model.RatingsStats ratingsStats) { 183 getPersistence().cacheResult(ratingsStats); 184 } 185 186 /** 187 * Caches the ratings statses in the entity cache if it is enabled. 188 * 189 * @param ratingsStatses the ratings statses 190 */ 191 public static void cacheResult( 192 java.util.List<com.liferay.portlet.ratings.model.RatingsStats> ratingsStatses) { 193 getPersistence().cacheResult(ratingsStatses); 194 } 195 196 /** 197 * Creates a new ratings stats with the primary key. Does not add the ratings stats to the database. 198 * 199 * @param statsId the primary key for the new ratings stats 200 * @return the new ratings stats 201 */ 202 public static com.liferay.portlet.ratings.model.RatingsStats create( 203 long statsId) { 204 return getPersistence().create(statsId); 205 } 206 207 /** 208 * Removes the ratings stats with the primary key from the database. Also notifies the appropriate model listeners. 209 * 210 * @param statsId the primary key of the ratings stats 211 * @return the ratings stats that was removed 212 * @throws com.liferay.portlet.ratings.NoSuchStatsException if a ratings stats with the primary key could not be found 213 */ 214 public static com.liferay.portlet.ratings.model.RatingsStats remove( 215 long statsId) throws com.liferay.portlet.ratings.NoSuchStatsException { 216 return getPersistence().remove(statsId); 217 } 218 219 public static com.liferay.portlet.ratings.model.RatingsStats updateImpl( 220 com.liferay.portlet.ratings.model.RatingsStats ratingsStats) { 221 return getPersistence().updateImpl(ratingsStats); 222 } 223 224 /** 225 * Returns the ratings stats with the primary key or throws a {@link com.liferay.portlet.ratings.NoSuchStatsException} if it could not be found. 226 * 227 * @param statsId the primary key of the ratings stats 228 * @return the ratings stats 229 * @throws com.liferay.portlet.ratings.NoSuchStatsException if a ratings stats with the primary key could not be found 230 */ 231 public static com.liferay.portlet.ratings.model.RatingsStats findByPrimaryKey( 232 long statsId) throws com.liferay.portlet.ratings.NoSuchStatsException { 233 return getPersistence().findByPrimaryKey(statsId); 234 } 235 236 /** 237 * Returns the ratings stats with the primary key or returns <code>null</code> if it could not be found. 238 * 239 * @param statsId the primary key of the ratings stats 240 * @return the ratings stats, or <code>null</code> if a ratings stats with the primary key could not be found 241 */ 242 public static com.liferay.portlet.ratings.model.RatingsStats fetchByPrimaryKey( 243 long statsId) { 244 return getPersistence().fetchByPrimaryKey(statsId); 245 } 246 247 public static java.util.Map<java.io.Serializable, com.liferay.portlet.ratings.model.RatingsStats> fetchByPrimaryKeys( 248 java.util.Set<java.io.Serializable> primaryKeys) { 249 return getPersistence().fetchByPrimaryKeys(primaryKeys); 250 } 251 252 /** 253 * Returns all the ratings statses. 254 * 255 * @return the ratings statses 256 */ 257 public static java.util.List<com.liferay.portlet.ratings.model.RatingsStats> findAll() { 258 return getPersistence().findAll(); 259 } 260 261 /** 262 * Returns a range of all the ratings statses. 263 * 264 * <p> 265 * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.ratings.model.impl.RatingsStatsModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 266 * </p> 267 * 268 * @param start the lower bound of the range of ratings statses 269 * @param end the upper bound of the range of ratings statses (not inclusive) 270 * @return the range of ratings statses 271 */ 272 public static java.util.List<com.liferay.portlet.ratings.model.RatingsStats> findAll( 273 int start, int end) { 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.ratings.model.impl.RatingsStatsModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 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 */ 289 public static java.util.List<com.liferay.portlet.ratings.model.RatingsStats> findAll( 290 int start, int end, 291 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.ratings.model.RatingsStats> orderByComparator) { 292 return getPersistence().findAll(start, end, orderByComparator); 293 } 294 295 /** 296 * Removes all the ratings statses from the database. 297 */ 298 public static void removeAll() { 299 getPersistence().removeAll(); 300 } 301 302 /** 303 * Returns the number of ratings statses. 304 * 305 * @return the number of ratings statses 306 */ 307 public static int countAll() { 308 return getPersistence().countAll(); 309 } 310 311 public static RatingsStatsPersistence getPersistence() { 312 if (_persistence == null) { 313 _persistence = (RatingsStatsPersistence)PortalBeanLocatorUtil.locate(RatingsStatsPersistence.class.getName()); 314 315 ReferenceRegistry.registerReference(RatingsStatsUtil.class, 316 "_persistence"); 317 } 318 319 return _persistence; 320 } 321 322 /** 323 * @deprecated As of 6.2.0 324 */ 325 @Deprecated 326 public void setPersistence(RatingsStatsPersistence persistence) { 327 } 328 329 private static RatingsStatsPersistence _persistence; 330 }