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.social.kernel.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.model.PersistedModel; 026 import com.liferay.portal.kernel.search.Indexable; 027 import com.liferay.portal.kernel.search.IndexableType; 028 import com.liferay.portal.kernel.service.BaseLocalService; 029 import com.liferay.portal.kernel.service.PersistedModelLocalService; 030 import com.liferay.portal.kernel.transaction.Isolation; 031 import com.liferay.portal.kernel.transaction.Propagation; 032 import com.liferay.portal.kernel.transaction.Transactional; 033 import com.liferay.portal.kernel.util.OrderByComparator; 034 035 import com.liferay.social.kernel.model.SocialAchievement; 036 import com.liferay.social.kernel.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 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 065 public ActionableDynamicQuery getActionableDynamicQuery(); 066 067 public DynamicQuery dynamicQuery(); 068 069 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 070 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery(); 071 072 /** 073 * @throws PortalException 074 */ 075 @Override 076 public PersistedModel deletePersistedModel(PersistedModel persistedModel) 077 throws PortalException; 078 079 @Override 080 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 081 public PersistedModel getPersistedModel(Serializable primaryKeyObj) 082 throws PortalException; 083 084 /** 085 * Adds the social activity achievement to the database. Also notifies the appropriate model listeners. 086 * 087 * @param socialActivityAchievement the social activity achievement 088 * @return the social activity achievement that was added 089 */ 090 @Indexable(type = IndexableType.REINDEX) 091 public SocialActivityAchievement addSocialActivityAchievement( 092 SocialActivityAchievement socialActivityAchievement); 093 094 /** 095 * Creates a new social activity achievement with the primary key. Does not add the social activity achievement to the database. 096 * 097 * @param activityAchievementId the primary key for the new social activity achievement 098 * @return the new social activity achievement 099 */ 100 public SocialActivityAchievement createSocialActivityAchievement( 101 long activityAchievementId); 102 103 /** 104 * Deletes the social activity achievement from the database. Also notifies the appropriate model listeners. 105 * 106 * @param socialActivityAchievement the social activity achievement 107 * @return the social activity achievement that was removed 108 */ 109 @Indexable(type = IndexableType.DELETE) 110 public SocialActivityAchievement deleteSocialActivityAchievement( 111 SocialActivityAchievement socialActivityAchievement); 112 113 /** 114 * Deletes the social activity achievement with the primary key from the database. Also notifies the appropriate model listeners. 115 * 116 * @param activityAchievementId the primary key of the social activity achievement 117 * @return the social activity achievement that was removed 118 * @throws PortalException if a social activity achievement with the primary key could not be found 119 */ 120 @Indexable(type = IndexableType.DELETE) 121 public SocialActivityAchievement deleteSocialActivityAchievement( 122 long activityAchievementId) throws PortalException; 123 124 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 125 public SocialActivityAchievement fetchSocialActivityAchievement( 126 long activityAchievementId); 127 128 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 129 public SocialActivityAchievement fetchUserAchievement(long userId, 130 long groupId, java.lang.String name); 131 132 /** 133 * Returns the social activity achievement with the primary key. 134 * 135 * @param activityAchievementId the primary key of the social activity achievement 136 * @return the social activity achievement 137 * @throws PortalException if a social activity achievement with the primary key could not be found 138 */ 139 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 140 public SocialActivityAchievement getSocialActivityAchievement( 141 long activityAchievementId) throws PortalException; 142 143 /** 144 * Updates the social activity achievement in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 145 * 146 * @param socialActivityAchievement the social activity achievement 147 * @return the social activity achievement that was updated 148 */ 149 @Indexable(type = IndexableType.REINDEX) 150 public SocialActivityAchievement updateSocialActivityAchievement( 151 SocialActivityAchievement socialActivityAchievement); 152 153 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 154 public int getGroupAchievementsCount(long groupId); 155 156 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 157 public int getGroupAchievementsCount(long groupId, java.lang.String name); 158 159 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 160 public int getGroupFirstAchievementsCount(long groupId); 161 162 /** 163 * Returns the number of social activity achievements. 164 * 165 * @return the number of social activity achievements 166 */ 167 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 168 public int getSocialActivityAchievementsCount(); 169 170 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 171 public int getUserAchievementsCount(long userId, long groupId); 172 173 /** 174 * Returns the OSGi service identifier. 175 * 176 * @return the OSGi service identifier 177 */ 178 public java.lang.String getOSGiServiceIdentifier(); 179 180 /** 181 * Performs a dynamic query on the database and returns the matching rows. 182 * 183 * @param dynamicQuery the dynamic query 184 * @return the matching rows 185 */ 186 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery); 187 188 /** 189 * Performs a dynamic query on the database and returns a range of the matching rows. 190 * 191 * <p> 192 * 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. 193 * </p> 194 * 195 * @param dynamicQuery the dynamic query 196 * @param start the lower bound of the range of model instances 197 * @param end the upper bound of the range of model instances (not inclusive) 198 * @return the range of matching rows 199 */ 200 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 201 int end); 202 203 /** 204 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 205 * 206 * <p> 207 * 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. 208 * </p> 209 * 210 * @param dynamicQuery the dynamic query 211 * @param start the lower bound of the range of model instances 212 * @param end the upper bound of the range of model instances (not inclusive) 213 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 214 * @return the ordered range of matching rows 215 */ 216 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 217 int end, OrderByComparator<T> orderByComparator); 218 219 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 220 public List<SocialActivityAchievement> getGroupAchievements(long groupId); 221 222 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 223 public List<SocialActivityAchievement> getGroupAchievements(long groupId, 224 java.lang.String name); 225 226 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 227 public List<SocialActivityAchievement> getGroupFirstAchievements( 228 long groupId); 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 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 246 public List<SocialActivityAchievement> getUserAchievements(long userId, 247 long groupId); 248 249 /** 250 * Returns the number of rows matching the dynamic query. 251 * 252 * @param dynamicQuery the dynamic query 253 * @return the number of rows matching the dynamic query 254 */ 255 public long dynamicQueryCount(DynamicQuery dynamicQuery); 256 257 /** 258 * Returns the number of rows matching the dynamic query. 259 * 260 * @param dynamicQuery the dynamic query 261 * @param projection the projection to apply to the query 262 * @return the number of rows matching the dynamic query 263 */ 264 public long dynamicQueryCount(DynamicQuery dynamicQuery, 265 Projection projection); 266 267 public void addActivityAchievement(long userId, long groupId, 268 SocialAchievement achievement) throws PortalException; 269 }