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; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 020 import com.liferay.portal.kernel.util.ReferenceRegistry; 021 022 /** 023 * Provides the local service utility for RatingsStats. This utility wraps 024 * {@link com.liferay.portlet.ratings.service.impl.RatingsStatsLocalServiceImpl} and is the 025 * primary access point for service operations in application layer code running 026 * on the local server. Methods of this service will not have security checks 027 * based on the propagated JAAS credentials because this service can only be 028 * accessed from within the same VM. 029 * 030 * @author Brian Wing Shun Chan 031 * @see RatingsStatsLocalService 032 * @see com.liferay.portlet.ratings.service.base.RatingsStatsLocalServiceBaseImpl 033 * @see com.liferay.portlet.ratings.service.impl.RatingsStatsLocalServiceImpl 034 * @generated 035 */ 036 @ProviderType 037 public class RatingsStatsLocalServiceUtil { 038 /* 039 * NOTE FOR DEVELOPERS: 040 * 041 * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.ratings.service.impl.RatingsStatsLocalServiceImpl} and rerun ServiceBuilder to regenerate this class. 042 */ 043 044 /** 045 * Adds the ratings stats to the database. Also notifies the appropriate model listeners. 046 * 047 * @param ratingsStats the ratings stats 048 * @return the ratings stats that was added 049 */ 050 public static com.liferay.portlet.ratings.model.RatingsStats addRatingsStats( 051 com.liferay.portlet.ratings.model.RatingsStats ratingsStats) { 052 return getService().addRatingsStats(ratingsStats); 053 } 054 055 public static com.liferay.portlet.ratings.model.RatingsStats addStats( 056 long classNameId, long classPK) { 057 return getService().addStats(classNameId, classPK); 058 } 059 060 /** 061 * Creates a new ratings stats with the primary key. Does not add the ratings stats to the database. 062 * 063 * @param statsId the primary key for the new ratings stats 064 * @return the new ratings stats 065 */ 066 public static com.liferay.portlet.ratings.model.RatingsStats createRatingsStats( 067 long statsId) { 068 return getService().createRatingsStats(statsId); 069 } 070 071 /** 072 * @throws PortalException 073 */ 074 public static com.liferay.portal.model.PersistedModel deletePersistedModel( 075 com.liferay.portal.model.PersistedModel persistedModel) 076 throws com.liferay.portal.kernel.exception.PortalException { 077 return getService().deletePersistedModel(persistedModel); 078 } 079 080 /** 081 * Deletes the ratings stats from the database. Also notifies the appropriate model listeners. 082 * 083 * @param ratingsStats the ratings stats 084 * @return the ratings stats that was removed 085 */ 086 public static com.liferay.portlet.ratings.model.RatingsStats deleteRatingsStats( 087 com.liferay.portlet.ratings.model.RatingsStats ratingsStats) { 088 return getService().deleteRatingsStats(ratingsStats); 089 } 090 091 /** 092 * Deletes the ratings stats with the primary key from the database. Also notifies the appropriate model listeners. 093 * 094 * @param statsId the primary key of the ratings stats 095 * @return the ratings stats that was removed 096 * @throws PortalException if a ratings stats with the primary key could not be found 097 */ 098 public static com.liferay.portlet.ratings.model.RatingsStats deleteRatingsStats( 099 long statsId) 100 throws com.liferay.portal.kernel.exception.PortalException { 101 return getService().deleteRatingsStats(statsId); 102 } 103 104 public static void deleteStats(java.lang.String className, long classPK) { 105 getService().deleteStats(className, classPK); 106 } 107 108 public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { 109 return getService().dynamicQuery(); 110 } 111 112 /** 113 * Performs a dynamic query on the database and returns the matching rows. 114 * 115 * @param dynamicQuery the dynamic query 116 * @return the matching rows 117 */ 118 public static <T> java.util.List<T> dynamicQuery( 119 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 120 return getService().dynamicQuery(dynamicQuery); 121 } 122 123 /** 124 * Performs a dynamic query on the database and returns a range of the matching rows. 125 * 126 * <p> 127 * 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. 128 * </p> 129 * 130 * @param dynamicQuery the dynamic query 131 * @param start the lower bound of the range of model instances 132 * @param end the upper bound of the range of model instances (not inclusive) 133 * @return the range of matching rows 134 */ 135 public static <T> java.util.List<T> dynamicQuery( 136 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 137 int end) { 138 return getService().dynamicQuery(dynamicQuery, start, end); 139 } 140 141 /** 142 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 143 * 144 * <p> 145 * 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. 146 * </p> 147 * 148 * @param dynamicQuery the dynamic query 149 * @param start the lower bound of the range of model instances 150 * @param end the upper bound of the range of model instances (not inclusive) 151 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 152 * @return the ordered range of matching rows 153 */ 154 public static <T> java.util.List<T> dynamicQuery( 155 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 156 int end, 157 com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) { 158 return getService() 159 .dynamicQuery(dynamicQuery, start, end, orderByComparator); 160 } 161 162 /** 163 * Returns the number of rows matching the dynamic query. 164 * 165 * @param dynamicQuery the dynamic query 166 * @return the number of rows matching the dynamic query 167 */ 168 public static long dynamicQueryCount( 169 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 170 return getService().dynamicQueryCount(dynamicQuery); 171 } 172 173 /** 174 * Returns the number of rows matching the dynamic query. 175 * 176 * @param dynamicQuery the dynamic query 177 * @param projection the projection to apply to the query 178 * @return the number of rows matching the dynamic query 179 */ 180 public static long dynamicQueryCount( 181 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 182 com.liferay.portal.kernel.dao.orm.Projection projection) { 183 return getService().dynamicQueryCount(dynamicQuery, projection); 184 } 185 186 public static com.liferay.portlet.ratings.model.RatingsStats fetchRatingsStats( 187 long statsId) { 188 return getService().fetchRatingsStats(statsId); 189 } 190 191 public static com.liferay.portlet.ratings.model.RatingsStats fetchStats( 192 java.lang.String className, long classPK) { 193 return getService().fetchStats(className, classPK); 194 } 195 196 public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() { 197 return getService().getActionableDynamicQuery(); 198 } 199 200 public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() { 201 return getService().getIndexableActionableDynamicQuery(); 202 } 203 204 /** 205 * Returns the OSGi service identifier. 206 * 207 * @return the OSGi service identifier 208 */ 209 public static java.lang.String getOSGiServiceIdentifier() { 210 return getService().getOSGiServiceIdentifier(); 211 } 212 213 public static com.liferay.portal.model.PersistedModel getPersistedModel( 214 java.io.Serializable primaryKeyObj) 215 throws com.liferay.portal.kernel.exception.PortalException { 216 return getService().getPersistedModel(primaryKeyObj); 217 } 218 219 /** 220 * Returns the ratings stats with the primary key. 221 * 222 * @param statsId the primary key of the ratings stats 223 * @return the ratings stats 224 * @throws PortalException if a ratings stats with the primary key could not be found 225 */ 226 public static com.liferay.portlet.ratings.model.RatingsStats getRatingsStats( 227 long statsId) 228 throws com.liferay.portal.kernel.exception.PortalException { 229 return getService().getRatingsStats(statsId); 230 } 231 232 /** 233 * Returns a range of all the ratings statses. 234 * 235 * <p> 236 * 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. 237 * </p> 238 * 239 * @param start the lower bound of the range of ratings statses 240 * @param end the upper bound of the range of ratings statses (not inclusive) 241 * @return the range of ratings statses 242 */ 243 public static java.util.List<com.liferay.portlet.ratings.model.RatingsStats> getRatingsStatses( 244 int start, int end) { 245 return getService().getRatingsStatses(start, end); 246 } 247 248 /** 249 * Returns the number of ratings statses. 250 * 251 * @return the number of ratings statses 252 */ 253 public static int getRatingsStatsesCount() { 254 return getService().getRatingsStatsesCount(); 255 } 256 257 public static com.liferay.portlet.ratings.model.RatingsStats getStats( 258 java.lang.String className, long classPK) { 259 return getService().getStats(className, classPK); 260 } 261 262 public static java.util.List<com.liferay.portlet.ratings.model.RatingsStats> getStats( 263 java.lang.String className, java.util.List<java.lang.Long> classPKs) { 264 return getService().getStats(className, classPKs); 265 } 266 267 public static com.liferay.portlet.ratings.model.RatingsStats getStats( 268 long statsId) 269 throws com.liferay.portal.kernel.exception.PortalException { 270 return getService().getStats(statsId); 271 } 272 273 /** 274 * Updates the ratings stats in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 275 * 276 * @param ratingsStats the ratings stats 277 * @return the ratings stats that was updated 278 */ 279 public static com.liferay.portlet.ratings.model.RatingsStats updateRatingsStats( 280 com.liferay.portlet.ratings.model.RatingsStats ratingsStats) { 281 return getService().updateRatingsStats(ratingsStats); 282 } 283 284 public static RatingsStatsLocalService getService() { 285 if (_service == null) { 286 _service = (RatingsStatsLocalService)PortalBeanLocatorUtil.locate(RatingsStatsLocalService.class.getName()); 287 288 ReferenceRegistry.registerReference(RatingsStatsLocalServiceUtil.class, 289 "_service"); 290 } 291 292 return _service; 293 } 294 295 private static RatingsStatsLocalService _service; 296 }