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 RatingsEntry. This utility wraps 024 * {@link com.liferay.portlet.ratings.service.impl.RatingsEntryLocalServiceImpl} 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 RatingsEntryLocalService 032 * @see com.liferay.portlet.ratings.service.base.RatingsEntryLocalServiceBaseImpl 033 * @see com.liferay.portlet.ratings.service.impl.RatingsEntryLocalServiceImpl 034 * @generated 035 */ 036 @ProviderType 037 public class RatingsEntryLocalServiceUtil { 038 /* 039 * NOTE FOR DEVELOPERS: 040 * 041 * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.ratings.service.impl.RatingsEntryLocalServiceImpl} and rerun ServiceBuilder to regenerate this class. 042 */ 043 044 /** 045 * Adds the ratings entry to the database. Also notifies the appropriate model listeners. 046 * 047 * @param ratingsEntry the ratings entry 048 * @return the ratings entry that was added 049 */ 050 public static com.liferay.portlet.ratings.model.RatingsEntry addRatingsEntry( 051 com.liferay.portlet.ratings.model.RatingsEntry ratingsEntry) { 052 return getService().addRatingsEntry(ratingsEntry); 053 } 054 055 /** 056 * Creates a new ratings entry with the primary key. Does not add the ratings entry to the database. 057 * 058 * @param entryId the primary key for the new ratings entry 059 * @return the new ratings entry 060 */ 061 public static com.liferay.portlet.ratings.model.RatingsEntry createRatingsEntry( 062 long entryId) { 063 return getService().createRatingsEntry(entryId); 064 } 065 066 public static void deleteEntry( 067 com.liferay.portlet.ratings.model.RatingsEntry entry, long userId, 068 java.lang.String className, long classPK) 069 throws com.liferay.portal.kernel.exception.PortalException { 070 getService().deleteEntry(entry, userId, className, classPK); 071 } 072 073 public static void deleteEntry(long userId, java.lang.String className, 074 long classPK) 075 throws com.liferay.portal.kernel.exception.PortalException { 076 getService().deleteEntry(userId, className, classPK); 077 } 078 079 /** 080 * @throws PortalException 081 */ 082 public static com.liferay.portal.model.PersistedModel deletePersistedModel( 083 com.liferay.portal.model.PersistedModel persistedModel) 084 throws com.liferay.portal.kernel.exception.PortalException { 085 return getService().deletePersistedModel(persistedModel); 086 } 087 088 /** 089 * Deletes the ratings entry with the primary key from the database. Also notifies the appropriate model listeners. 090 * 091 * @param entryId the primary key of the ratings entry 092 * @return the ratings entry that was removed 093 * @throws PortalException if a ratings entry with the primary key could not be found 094 */ 095 public static com.liferay.portlet.ratings.model.RatingsEntry deleteRatingsEntry( 096 long entryId) 097 throws com.liferay.portal.kernel.exception.PortalException { 098 return getService().deleteRatingsEntry(entryId); 099 } 100 101 /** 102 * Deletes the ratings entry from the database. Also notifies the appropriate model listeners. 103 * 104 * @param ratingsEntry the ratings entry 105 * @return the ratings entry that was removed 106 */ 107 public static com.liferay.portlet.ratings.model.RatingsEntry deleteRatingsEntry( 108 com.liferay.portlet.ratings.model.RatingsEntry ratingsEntry) { 109 return getService().deleteRatingsEntry(ratingsEntry); 110 } 111 112 public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { 113 return getService().dynamicQuery(); 114 } 115 116 /** 117 * Performs a dynamic query on the database and returns the matching rows. 118 * 119 * @param dynamicQuery the dynamic query 120 * @return the matching rows 121 */ 122 public static <T> java.util.List<T> dynamicQuery( 123 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 124 return getService().dynamicQuery(dynamicQuery); 125 } 126 127 /** 128 * Performs a dynamic query on the database and returns a range of the matching rows. 129 * 130 * <p> 131 * 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.RatingsEntryModelImpl}. 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. 132 * </p> 133 * 134 * @param dynamicQuery the dynamic query 135 * @param start the lower bound of the range of model instances 136 * @param end the upper bound of the range of model instances (not inclusive) 137 * @return the range of matching rows 138 */ 139 public static <T> java.util.List<T> dynamicQuery( 140 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 141 int end) { 142 return getService().dynamicQuery(dynamicQuery, start, end); 143 } 144 145 /** 146 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 147 * 148 * <p> 149 * 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.RatingsEntryModelImpl}. 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. 150 * </p> 151 * 152 * @param dynamicQuery the dynamic query 153 * @param start the lower bound of the range of model instances 154 * @param end the upper bound of the range of model instances (not inclusive) 155 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 156 * @return the ordered range of matching rows 157 */ 158 public static <T> java.util.List<T> dynamicQuery( 159 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 160 int end, 161 com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) { 162 return getService() 163 .dynamicQuery(dynamicQuery, start, end, orderByComparator); 164 } 165 166 /** 167 * Returns the number of rows matching the dynamic query. 168 * 169 * @param dynamicQuery the dynamic query 170 * @return the number of rows matching the dynamic query 171 */ 172 public static long dynamicQueryCount( 173 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 174 return getService().dynamicQueryCount(dynamicQuery); 175 } 176 177 /** 178 * Returns the number of rows matching the dynamic query. 179 * 180 * @param dynamicQuery the dynamic query 181 * @param projection the projection to apply to the query 182 * @return the number of rows matching the dynamic query 183 */ 184 public static long dynamicQueryCount( 185 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 186 com.liferay.portal.kernel.dao.orm.Projection projection) { 187 return getService().dynamicQueryCount(dynamicQuery, projection); 188 } 189 190 public static com.liferay.portlet.ratings.model.RatingsEntry fetchEntry( 191 long userId, java.lang.String className, long classPK) { 192 return getService().fetchEntry(userId, className, classPK); 193 } 194 195 public static com.liferay.portlet.ratings.model.RatingsEntry fetchRatingsEntry( 196 long entryId) { 197 return getService().fetchRatingsEntry(entryId); 198 } 199 200 /** 201 * Returns the ratings entry with the matching UUID and company. 202 * 203 * @param uuid the ratings entry's UUID 204 * @param companyId the primary key of the company 205 * @return the matching ratings entry, or <code>null</code> if a matching ratings entry could not be found 206 */ 207 public static com.liferay.portlet.ratings.model.RatingsEntry fetchRatingsEntryByUuidAndCompanyId( 208 java.lang.String uuid, long companyId) { 209 return getService().fetchRatingsEntryByUuidAndCompanyId(uuid, companyId); 210 } 211 212 public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() { 213 return getService().getActionableDynamicQuery(); 214 } 215 216 public static java.util.List<com.liferay.portlet.ratings.model.RatingsEntry> getEntries( 217 java.lang.String className, long classPK) { 218 return getService().getEntries(className, classPK); 219 } 220 221 public static java.util.List<com.liferay.portlet.ratings.model.RatingsEntry> getEntries( 222 java.lang.String className, long classPK, double score) { 223 return getService().getEntries(className, classPK, score); 224 } 225 226 public static java.util.List<com.liferay.portlet.ratings.model.RatingsEntry> getEntries( 227 long userId, java.lang.String className, 228 java.util.List<java.lang.Long> classPKs) { 229 return getService().getEntries(userId, className, classPKs); 230 } 231 232 public static int getEntriesCount(java.lang.String className, long classPK, 233 double score) { 234 return getService().getEntriesCount(className, classPK, score); 235 } 236 237 public static com.liferay.portlet.ratings.model.RatingsEntry getEntry( 238 long userId, java.lang.String className, long classPK) 239 throws com.liferay.portal.kernel.exception.PortalException { 240 return getService().getEntry(userId, className, classPK); 241 } 242 243 public static com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery getExportActionableDynamicQuery( 244 com.liferay.portlet.exportimport.lar.PortletDataContext portletDataContext) { 245 return getService().getExportActionableDynamicQuery(portletDataContext); 246 } 247 248 public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() { 249 return getService().getIndexableActionableDynamicQuery(); 250 } 251 252 /** 253 * Returns the OSGi service identifier. 254 * 255 * @return the OSGi service identifier 256 */ 257 public static java.lang.String getOSGiServiceIdentifier() { 258 return getService().getOSGiServiceIdentifier(); 259 } 260 261 public static com.liferay.portal.model.PersistedModel getPersistedModel( 262 java.io.Serializable primaryKeyObj) 263 throws com.liferay.portal.kernel.exception.PortalException { 264 return getService().getPersistedModel(primaryKeyObj); 265 } 266 267 /** 268 * Returns a range of all the ratings entries. 269 * 270 * <p> 271 * 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.RatingsEntryModelImpl}. 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. 272 * </p> 273 * 274 * @param start the lower bound of the range of ratings entries 275 * @param end the upper bound of the range of ratings entries (not inclusive) 276 * @return the range of ratings entries 277 */ 278 public static java.util.List<com.liferay.portlet.ratings.model.RatingsEntry> getRatingsEntries( 279 int start, int end) { 280 return getService().getRatingsEntries(start, end); 281 } 282 283 /** 284 * Returns the number of ratings entries. 285 * 286 * @return the number of ratings entries 287 */ 288 public static int getRatingsEntriesCount() { 289 return getService().getRatingsEntriesCount(); 290 } 291 292 /** 293 * Returns the ratings entry with the primary key. 294 * 295 * @param entryId the primary key of the ratings entry 296 * @return the ratings entry 297 * @throws PortalException if a ratings entry with the primary key could not be found 298 */ 299 public static com.liferay.portlet.ratings.model.RatingsEntry getRatingsEntry( 300 long entryId) 301 throws com.liferay.portal.kernel.exception.PortalException { 302 return getService().getRatingsEntry(entryId); 303 } 304 305 /** 306 * Returns the ratings entry with the matching UUID and company. 307 * 308 * @param uuid the ratings entry's UUID 309 * @param companyId the primary key of the company 310 * @return the matching ratings entry 311 * @throws PortalException if a matching ratings entry could not be found 312 */ 313 public static com.liferay.portlet.ratings.model.RatingsEntry getRatingsEntryByUuidAndCompanyId( 314 java.lang.String uuid, long companyId) 315 throws com.liferay.portal.kernel.exception.PortalException { 316 return getService().getRatingsEntryByUuidAndCompanyId(uuid, companyId); 317 } 318 319 public static com.liferay.portlet.ratings.model.RatingsEntry updateEntry( 320 long userId, java.lang.String className, long classPK, double score, 321 com.liferay.portal.service.ServiceContext serviceContext) 322 throws com.liferay.portal.kernel.exception.PortalException { 323 return getService() 324 .updateEntry(userId, className, classPK, score, 325 serviceContext); 326 } 327 328 /** 329 * Updates the ratings entry in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 330 * 331 * @param ratingsEntry the ratings entry 332 * @return the ratings entry that was updated 333 */ 334 public static com.liferay.portlet.ratings.model.RatingsEntry updateRatingsEntry( 335 com.liferay.portlet.ratings.model.RatingsEntry ratingsEntry) { 336 return getService().updateRatingsEntry(ratingsEntry); 337 } 338 339 public static RatingsEntryLocalService getService() { 340 if (_service == null) { 341 _service = (RatingsEntryLocalService)PortalBeanLocatorUtil.locate(RatingsEntryLocalService.class.getName()); 342 343 ReferenceRegistry.registerReference(RatingsEntryLocalServiceUtil.class, 344 "_service"); 345 } 346 347 return _service; 348 } 349 350 private static RatingsEntryLocalService _service; 351 }