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.social.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.IndexableActionableDynamicQuery; 022 import com.liferay.portal.kernel.dao.orm.Projection; 023 import com.liferay.portal.kernel.exception.PortalException; 024 import com.liferay.portal.kernel.exception.SystemException; 025 import com.liferay.portal.kernel.search.Indexable; 026 import com.liferay.portal.kernel.search.IndexableType; 027 import com.liferay.portal.kernel.transaction.Isolation; 028 import com.liferay.portal.kernel.transaction.Propagation; 029 import com.liferay.portal.kernel.transaction.Transactional; 030 import com.liferay.portal.kernel.util.OrderByComparator; 031 import com.liferay.portal.model.PersistedModel; 032 import com.liferay.portal.service.BaseLocalService; 033 import com.liferay.portal.service.PersistedModelLocalService; 034 035 import com.liferay.portlet.social.model.SocialAchievement; 036 import com.liferay.portlet.social.model.SocialActivityAchievement; 037 038 import java.io.Serializable; 039 040 import java.util.List; 041 042 /** 043 * Provides the local service interface for SocialActivityAchievement. Methods of this 044 * service will not have security checks based on the propagated JAAS 045 * credentials because this service can only be accessed from within the same 046 * VM. 047 * 048 * @author Brian Wing Shun Chan 049 * @see SocialActivityAchievementLocalServiceUtil 050 * @see com.liferay.portlet.social.service.base.SocialActivityAchievementLocalServiceBaseImpl 051 * @see com.liferay.portlet.social.service.impl.SocialActivityAchievementLocalServiceImpl 052 * @generated 053 */ 054 @ProviderType 055 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 056 PortalException.class, SystemException.class}) 057 public interface SocialActivityAchievementLocalService extends BaseLocalService, 058 PersistedModelLocalService { 059 /* 060 * NOTE FOR DEVELOPERS: 061 * 062 * Never modify or reference this interface directly. Always use {@link SocialActivityAchievementLocalServiceUtil} to access the social activity achievement local service. Add custom service methods to {@link com.liferay.portlet.social.service.impl.SocialActivityAchievementLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 063 */ 064 public void addActivityAchievement(long userId, long groupId, 065 SocialAchievement achievement) throws PortalException; 066 067 /** 068 * Adds the social activity achievement to the database. Also notifies the appropriate model listeners. 069 * 070 * @param socialActivityAchievement the social activity achievement 071 * @return the social activity achievement that was added 072 */ 073 @Indexable(type = IndexableType.REINDEX) 074 public SocialActivityAchievement addSocialActivityAchievement( 075 SocialActivityAchievement socialActivityAchievement); 076 077 /** 078 * Creates a new social activity achievement with the primary key. Does not add the social activity achievement to the database. 079 * 080 * @param activityAchievementId the primary key for the new social activity achievement 081 * @return the new social activity achievement 082 */ 083 public SocialActivityAchievement createSocialActivityAchievement( 084 long activityAchievementId); 085 086 /** 087 * @throws PortalException 088 */ 089 @Override 090 public PersistedModel deletePersistedModel(PersistedModel persistedModel) 091 throws PortalException; 092 093 /** 094 * Deletes the social activity achievement with the primary key from the database. Also notifies the appropriate model listeners. 095 * 096 * @param activityAchievementId the primary key of the social activity achievement 097 * @return the social activity achievement that was removed 098 * @throws PortalException if a social activity achievement with the primary key could not be found 099 */ 100 @Indexable(type = IndexableType.DELETE) 101 public SocialActivityAchievement deleteSocialActivityAchievement( 102 long activityAchievementId) throws PortalException; 103 104 /** 105 * Deletes the social activity achievement from the database. Also notifies the appropriate model listeners. 106 * 107 * @param socialActivityAchievement the social activity achievement 108 * @return the social activity achievement that was removed 109 */ 110 @Indexable(type = IndexableType.DELETE) 111 public SocialActivityAchievement deleteSocialActivityAchievement( 112 SocialActivityAchievement socialActivityAchievement); 113 114 public DynamicQuery dynamicQuery(); 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 <T> List<T> dynamicQuery(DynamicQuery dynamicQuery); 123 124 /** 125 * Performs a dynamic query on the database and returns a range of the matching rows. 126 * 127 * <p> 128 * 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.social.model.impl.SocialActivityAchievementModelImpl}. 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. 129 * </p> 130 * 131 * @param dynamicQuery the dynamic query 132 * @param start the lower bound of the range of model instances 133 * @param end the upper bound of the range of model instances (not inclusive) 134 * @return the range of matching rows 135 */ 136 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 137 int end); 138 139 /** 140 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 141 * 142 * <p> 143 * 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.social.model.impl.SocialActivityAchievementModelImpl}. 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. 144 * </p> 145 * 146 * @param dynamicQuery the dynamic query 147 * @param start the lower bound of the range of model instances 148 * @param end the upper bound of the range of model instances (not inclusive) 149 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 150 * @return the ordered range of matching rows 151 */ 152 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 153 int end, OrderByComparator<T> orderByComparator); 154 155 /** 156 * Returns the number of rows matching the dynamic query. 157 * 158 * @param dynamicQuery the dynamic query 159 * @return the number of rows matching the dynamic query 160 */ 161 public long dynamicQueryCount(DynamicQuery dynamicQuery); 162 163 /** 164 * Returns the number of rows matching the dynamic query. 165 * 166 * @param dynamicQuery the dynamic query 167 * @param projection the projection to apply to the query 168 * @return the number of rows matching the dynamic query 169 */ 170 public long dynamicQueryCount(DynamicQuery dynamicQuery, 171 Projection projection); 172 173 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 174 public SocialActivityAchievement fetchSocialActivityAchievement( 175 long activityAchievementId); 176 177 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 178 public SocialActivityAchievement fetchUserAchievement(long userId, 179 long groupId, java.lang.String name); 180 181 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 182 public ActionableDynamicQuery getActionableDynamicQuery(); 183 184 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 185 public List<SocialActivityAchievement> getGroupAchievements(long groupId); 186 187 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 188 public List<SocialActivityAchievement> getGroupAchievements(long groupId, 189 java.lang.String name); 190 191 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 192 public int getGroupAchievementsCount(long groupId); 193 194 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 195 public int getGroupAchievementsCount(long groupId, java.lang.String name); 196 197 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 198 public List<SocialActivityAchievement> getGroupFirstAchievements( 199 long groupId); 200 201 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 202 public int getGroupFirstAchievementsCount(long groupId); 203 204 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 205 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery(); 206 207 /** 208 * Returns the OSGi service identifier. 209 * 210 * @return the OSGi service identifier 211 */ 212 public java.lang.String getOSGiServiceIdentifier(); 213 214 @Override 215 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 216 public PersistedModel getPersistedModel(Serializable primaryKeyObj) 217 throws PortalException; 218 219 /** 220 * Returns the social activity achievement with the primary key. 221 * 222 * @param activityAchievementId the primary key of the social activity achievement 223 * @return the social activity achievement 224 * @throws PortalException if a social activity achievement with the primary key could not be found 225 */ 226 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 227 public SocialActivityAchievement getSocialActivityAchievement( 228 long activityAchievementId) throws PortalException; 229 230 /** 231 * Returns a range of all the social activity achievements. 232 * 233 * <p> 234 * 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.social.model.impl.SocialActivityAchievementModelImpl}. 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. 235 * </p> 236 * 237 * @param start the lower bound of the range of social activity achievements 238 * @param end the upper bound of the range of social activity achievements (not inclusive) 239 * @return the range of social activity achievements 240 */ 241 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 242 public List<SocialActivityAchievement> getSocialActivityAchievements( 243 int start, int end); 244 245 /** 246 * Returns the number of social activity achievements. 247 * 248 * @return the number of social activity achievements 249 */ 250 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 251 public int getSocialActivityAchievementsCount(); 252 253 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 254 public List<SocialActivityAchievement> getUserAchievements(long userId, 255 long groupId); 256 257 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 258 public int getUserAchievementsCount(long userId, long groupId); 259 260 /** 261 * Updates the social activity achievement in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 262 * 263 * @param socialActivityAchievement the social activity achievement 264 * @return the social activity achievement that was updated 265 */ 266 @Indexable(type = IndexableType.REINDEX) 267 public SocialActivityAchievement updateSocialActivityAchievement( 268 SocialActivityAchievement socialActivityAchievement); 269 }