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.dao.orm.ActionableDynamicQuery; 020 import com.liferay.portal.kernel.dao.orm.DynamicQuery; 021 import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery; 022 import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery; 023 import com.liferay.portal.kernel.dao.orm.Projection; 024 import com.liferay.portal.kernel.exception.PortalException; 025 import com.liferay.portal.kernel.exception.SystemException; 026 import com.liferay.portal.kernel.search.Indexable; 027 import com.liferay.portal.kernel.search.IndexableType; 028 import com.liferay.portal.kernel.systemevent.SystemEvent; 029 import com.liferay.portal.kernel.transaction.Isolation; 030 import com.liferay.portal.kernel.transaction.Propagation; 031 import com.liferay.portal.kernel.transaction.Transactional; 032 import com.liferay.portal.kernel.util.OrderByComparator; 033 import com.liferay.portal.model.PersistedModel; 034 import com.liferay.portal.model.SystemEventConstants; 035 import com.liferay.portal.service.BaseLocalService; 036 import com.liferay.portal.service.PersistedModelLocalService; 037 import com.liferay.portal.service.ServiceContext; 038 039 import com.liferay.portlet.exportimport.lar.PortletDataContext; 040 import com.liferay.portlet.ratings.model.RatingsEntry; 041 042 import java.io.Serializable; 043 044 import java.util.List; 045 046 /** 047 * Provides the local service interface for RatingsEntry. Methods of this 048 * service will not have security checks based on the propagated JAAS 049 * credentials because this service can only be accessed from within the same 050 * VM. 051 * 052 * @author Brian Wing Shun Chan 053 * @see RatingsEntryLocalServiceUtil 054 * @see com.liferay.portlet.ratings.service.base.RatingsEntryLocalServiceBaseImpl 055 * @see com.liferay.portlet.ratings.service.impl.RatingsEntryLocalServiceImpl 056 * @generated 057 */ 058 @ProviderType 059 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 060 PortalException.class, SystemException.class}) 061 public interface RatingsEntryLocalService extends BaseLocalService, 062 PersistedModelLocalService { 063 /* 064 * NOTE FOR DEVELOPERS: 065 * 066 * Never modify or reference this interface directly. Always use {@link RatingsEntryLocalServiceUtil} to access the ratings entry local service. Add custom service methods to {@link com.liferay.portlet.ratings.service.impl.RatingsEntryLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 067 */ 068 069 /** 070 * Adds the ratings entry to the database. Also notifies the appropriate model listeners. 071 * 072 * @param ratingsEntry the ratings entry 073 * @return the ratings entry that was added 074 */ 075 @Indexable(type = IndexableType.REINDEX) 076 public RatingsEntry addRatingsEntry(RatingsEntry ratingsEntry); 077 078 /** 079 * Creates a new ratings entry with the primary key. Does not add the ratings entry to the database. 080 * 081 * @param entryId the primary key for the new ratings entry 082 * @return the new ratings entry 083 */ 084 public RatingsEntry createRatingsEntry(long entryId); 085 086 @SystemEvent(type = SystemEventConstants.TYPE_DELETE) 087 public void deleteEntry(RatingsEntry entry, long userId, 088 java.lang.String className, long classPK) throws PortalException; 089 090 public void deleteEntry(long userId, java.lang.String className, 091 long classPK) throws PortalException; 092 093 /** 094 * @throws PortalException 095 */ 096 @Override 097 public PersistedModel deletePersistedModel(PersistedModel persistedModel) 098 throws PortalException; 099 100 /** 101 * Deletes the ratings entry with the primary key from the database. Also notifies the appropriate model listeners. 102 * 103 * @param entryId the primary key of the ratings entry 104 * @return the ratings entry that was removed 105 * @throws PortalException if a ratings entry with the primary key could not be found 106 */ 107 @Indexable(type = IndexableType.DELETE) 108 public RatingsEntry deleteRatingsEntry(long entryId) 109 throws PortalException; 110 111 /** 112 * Deletes the ratings entry from the database. Also notifies the appropriate model listeners. 113 * 114 * @param ratingsEntry the ratings entry 115 * @return the ratings entry that was removed 116 */ 117 @Indexable(type = IndexableType.DELETE) 118 public RatingsEntry deleteRatingsEntry(RatingsEntry ratingsEntry); 119 120 public DynamicQuery dynamicQuery(); 121 122 /** 123 * Performs a dynamic query on the database and returns the matching rows. 124 * 125 * @param dynamicQuery the dynamic query 126 * @return the matching rows 127 */ 128 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery); 129 130 /** 131 * Performs a dynamic query on the database and returns a range of the matching rows. 132 * 133 * <p> 134 * 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. 135 * </p> 136 * 137 * @param dynamicQuery the dynamic query 138 * @param start the lower bound of the range of model instances 139 * @param end the upper bound of the range of model instances (not inclusive) 140 * @return the range of matching rows 141 */ 142 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 143 int end); 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 <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 159 int end, OrderByComparator<T> orderByComparator); 160 161 /** 162 * Returns the number of rows matching the dynamic query. 163 * 164 * @param dynamicQuery the dynamic query 165 * @return the number of rows matching the dynamic query 166 */ 167 public long dynamicQueryCount(DynamicQuery dynamicQuery); 168 169 /** 170 * Returns the number of rows matching the dynamic query. 171 * 172 * @param dynamicQuery the dynamic query 173 * @param projection the projection to apply to the query 174 * @return the number of rows matching the dynamic query 175 */ 176 public long dynamicQueryCount(DynamicQuery dynamicQuery, 177 Projection projection); 178 179 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 180 public RatingsEntry fetchEntry(long userId, java.lang.String className, 181 long classPK); 182 183 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 184 public RatingsEntry fetchRatingsEntry(long entryId); 185 186 /** 187 * Returns the ratings entry with the matching UUID and company. 188 * 189 * @param uuid the ratings entry's UUID 190 * @param companyId the primary key of the company 191 * @return the matching ratings entry, or <code>null</code> if a matching ratings entry could not be found 192 */ 193 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 194 public RatingsEntry fetchRatingsEntryByUuidAndCompanyId( 195 java.lang.String uuid, long companyId); 196 197 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 198 public ActionableDynamicQuery getActionableDynamicQuery(); 199 200 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 201 public List<RatingsEntry> getEntries(java.lang.String className, 202 long classPK); 203 204 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 205 public List<RatingsEntry> getEntries(java.lang.String className, 206 long classPK, double score); 207 208 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 209 public List<RatingsEntry> getEntries(long userId, 210 java.lang.String className, List<java.lang.Long> classPKs); 211 212 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 213 public int getEntriesCount(java.lang.String className, long classPK, 214 double score); 215 216 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 217 public RatingsEntry getEntry(long userId, java.lang.String className, 218 long classPK) throws PortalException; 219 220 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 221 public ExportActionableDynamicQuery getExportActionableDynamicQuery( 222 PortletDataContext portletDataContext); 223 224 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 225 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery(); 226 227 /** 228 * Returns the OSGi service identifier. 229 * 230 * @return the OSGi service identifier 231 */ 232 public java.lang.String getOSGiServiceIdentifier(); 233 234 @Override 235 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 236 public PersistedModel getPersistedModel(Serializable primaryKeyObj) 237 throws PortalException; 238 239 /** 240 * Returns a range of all the ratings entries. 241 * 242 * <p> 243 * 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. 244 * </p> 245 * 246 * @param start the lower bound of the range of ratings entries 247 * @param end the upper bound of the range of ratings entries (not inclusive) 248 * @return the range of ratings entries 249 */ 250 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 251 public List<RatingsEntry> getRatingsEntries(int start, int end); 252 253 /** 254 * Returns the number of ratings entries. 255 * 256 * @return the number of ratings entries 257 */ 258 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 259 public int getRatingsEntriesCount(); 260 261 /** 262 * Returns the ratings entry with the primary key. 263 * 264 * @param entryId the primary key of the ratings entry 265 * @return the ratings entry 266 * @throws PortalException if a ratings entry with the primary key could not be found 267 */ 268 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 269 public RatingsEntry getRatingsEntry(long entryId) throws PortalException; 270 271 /** 272 * Returns the ratings entry with the matching UUID and company. 273 * 274 * @param uuid the ratings entry's UUID 275 * @param companyId the primary key of the company 276 * @return the matching ratings entry 277 * @throws PortalException if a matching ratings entry could not be found 278 */ 279 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 280 public RatingsEntry getRatingsEntryByUuidAndCompanyId( 281 java.lang.String uuid, long companyId) throws PortalException; 282 283 public RatingsEntry updateEntry(long userId, java.lang.String className, 284 long classPK, double score, ServiceContext serviceContext) 285 throws PortalException; 286 287 /** 288 * Updates the ratings entry in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 289 * 290 * @param ratingsEntry the ratings entry 291 * @return the ratings entry that was updated 292 */ 293 @Indexable(type = IndexableType.REINDEX) 294 public RatingsEntry updateRatingsEntry(RatingsEntry ratingsEntry); 295 }