001 /** 002 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved. 003 * 004 * The contents of this file are subject to the terms of the Liferay Enterprise 005 * Subscription License ("License"). You may not use this file except in 006 * compliance with the License. You can obtain a copy of the License by 007 * contacting Liferay, Inc. See the License for the specific language governing 008 * permissions and limitations under the License, including but not limited to 009 * distribution rights of the Software. 010 * 011 * 012 * 013 */ 014 015 package com.liferay.portlet.social.service; 016 017 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 018 import com.liferay.portal.kernel.util.MethodCache; 019 import com.liferay.portal.kernel.util.ReferenceRegistry; 020 021 /** 022 * The utility for the social activity achievement local service. This utility wraps {@link com.liferay.portlet.social.service.impl.SocialActivityAchievementLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server. 023 * 024 * <p> 025 * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM. 026 * </p> 027 * 028 * @author Brian Wing Shun Chan 029 * @see SocialActivityAchievementLocalService 030 * @see com.liferay.portlet.social.service.base.SocialActivityAchievementLocalServiceBaseImpl 031 * @see com.liferay.portlet.social.service.impl.SocialActivityAchievementLocalServiceImpl 032 * @generated 033 */ 034 public class SocialActivityAchievementLocalServiceUtil { 035 /* 036 * NOTE FOR DEVELOPERS: 037 * 038 * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.social.service.impl.SocialActivityAchievementLocalServiceImpl} and rerun ServiceBuilder to regenerate this class. 039 */ 040 041 /** 042 * Adds the social activity achievement to the database. Also notifies the appropriate model listeners. 043 * 044 * @param socialActivityAchievement the social activity achievement 045 * @return the social activity achievement that was added 046 * @throws SystemException if a system exception occurred 047 */ 048 public static com.liferay.portlet.social.model.SocialActivityAchievement addSocialActivityAchievement( 049 com.liferay.portlet.social.model.SocialActivityAchievement socialActivityAchievement) 050 throws com.liferay.portal.kernel.exception.SystemException { 051 return getService() 052 .addSocialActivityAchievement(socialActivityAchievement); 053 } 054 055 /** 056 * Creates a new social activity achievement with the primary key. Does not add the social activity achievement to the database. 057 * 058 * @param activityAchievementId the primary key for the new social activity achievement 059 * @return the new social activity achievement 060 */ 061 public static com.liferay.portlet.social.model.SocialActivityAchievement createSocialActivityAchievement( 062 long activityAchievementId) { 063 return getService() 064 .createSocialActivityAchievement(activityAchievementId); 065 } 066 067 /** 068 * Deletes the social activity achievement with the primary key from the database. Also notifies the appropriate model listeners. 069 * 070 * @param activityAchievementId the primary key of the social activity achievement 071 * @throws PortalException if a social activity achievement with the primary key could not be found 072 * @throws SystemException if a system exception occurred 073 */ 074 public static void deleteSocialActivityAchievement( 075 long activityAchievementId) 076 throws com.liferay.portal.kernel.exception.PortalException, 077 com.liferay.portal.kernel.exception.SystemException { 078 getService().deleteSocialActivityAchievement(activityAchievementId); 079 } 080 081 /** 082 * Deletes the social activity achievement from the database. Also notifies the appropriate model listeners. 083 * 084 * @param socialActivityAchievement the social activity achievement 085 * @throws SystemException if a system exception occurred 086 */ 087 public static void deleteSocialActivityAchievement( 088 com.liferay.portlet.social.model.SocialActivityAchievement socialActivityAchievement) 089 throws com.liferay.portal.kernel.exception.SystemException { 090 getService().deleteSocialActivityAchievement(socialActivityAchievement); 091 } 092 093 /** 094 * Performs a dynamic query on the database and returns the matching rows. 095 * 096 * @param dynamicQuery the dynamic query 097 * @return the matching rows 098 * @throws SystemException if a system exception occurred 099 */ 100 @SuppressWarnings("rawtypes") 101 public static java.util.List dynamicQuery( 102 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 103 throws com.liferay.portal.kernel.exception.SystemException { 104 return getService().dynamicQuery(dynamicQuery); 105 } 106 107 /** 108 * Performs a dynamic query on the database and returns a range of the matching rows. 109 * 110 * <p> 111 * 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. 112 * </p> 113 * 114 * @param dynamicQuery the dynamic query 115 * @param start the lower bound of the range of model instances 116 * @param end the upper bound of the range of model instances (not inclusive) 117 * @return the range of matching rows 118 * @throws SystemException if a system exception occurred 119 */ 120 @SuppressWarnings("rawtypes") 121 public static java.util.List dynamicQuery( 122 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 123 int end) throws com.liferay.portal.kernel.exception.SystemException { 124 return getService().dynamicQuery(dynamicQuery, start, end); 125 } 126 127 /** 128 * Performs a dynamic query on the database and returns an ordered 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. 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 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 138 * @return the ordered range of matching rows 139 * @throws SystemException if a system exception occurred 140 */ 141 @SuppressWarnings("rawtypes") 142 public static java.util.List dynamicQuery( 143 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 144 int end, 145 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 146 throws com.liferay.portal.kernel.exception.SystemException { 147 return getService() 148 .dynamicQuery(dynamicQuery, start, end, orderByComparator); 149 } 150 151 /** 152 * Returns the number of rows that match the dynamic query. 153 * 154 * @param dynamicQuery the dynamic query 155 * @return the number of rows that match the dynamic query 156 * @throws SystemException if a system exception occurred 157 */ 158 public static long dynamicQueryCount( 159 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 160 throws com.liferay.portal.kernel.exception.SystemException { 161 return getService().dynamicQueryCount(dynamicQuery); 162 } 163 164 public static com.liferay.portlet.social.model.SocialActivityAchievement fetchSocialActivityAchievement( 165 long activityAchievementId) 166 throws com.liferay.portal.kernel.exception.SystemException { 167 return getService().fetchSocialActivityAchievement(activityAchievementId); 168 } 169 170 /** 171 * Returns the social activity achievement with the primary key. 172 * 173 * @param activityAchievementId the primary key of the social activity achievement 174 * @return the social activity achievement 175 * @throws PortalException if a social activity achievement with the primary key could not be found 176 * @throws SystemException if a system exception occurred 177 */ 178 public static com.liferay.portlet.social.model.SocialActivityAchievement getSocialActivityAchievement( 179 long activityAchievementId) 180 throws com.liferay.portal.kernel.exception.PortalException, 181 com.liferay.portal.kernel.exception.SystemException { 182 return getService().getSocialActivityAchievement(activityAchievementId); 183 } 184 185 public static com.liferay.portal.model.PersistedModel getPersistedModel( 186 java.io.Serializable primaryKeyObj) 187 throws com.liferay.portal.kernel.exception.PortalException, 188 com.liferay.portal.kernel.exception.SystemException { 189 return getService().getPersistedModel(primaryKeyObj); 190 } 191 192 /** 193 * Returns a range of all the social activity achievements. 194 * 195 * <p> 196 * 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. 197 * </p> 198 * 199 * @param start the lower bound of the range of social activity achievements 200 * @param end the upper bound of the range of social activity achievements (not inclusive) 201 * @return the range of social activity achievements 202 * @throws SystemException if a system exception occurred 203 */ 204 public static java.util.List<com.liferay.portlet.social.model.SocialActivityAchievement> getSocialActivityAchievements( 205 int start, int end) 206 throws com.liferay.portal.kernel.exception.SystemException { 207 return getService().getSocialActivityAchievements(start, end); 208 } 209 210 /** 211 * Returns the number of social activity achievements. 212 * 213 * @return the number of social activity achievements 214 * @throws SystemException if a system exception occurred 215 */ 216 public static int getSocialActivityAchievementsCount() 217 throws com.liferay.portal.kernel.exception.SystemException { 218 return getService().getSocialActivityAchievementsCount(); 219 } 220 221 /** 222 * Updates the social activity achievement in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 223 * 224 * @param socialActivityAchievement the social activity achievement 225 * @return the social activity achievement that was updated 226 * @throws SystemException if a system exception occurred 227 */ 228 public static com.liferay.portlet.social.model.SocialActivityAchievement updateSocialActivityAchievement( 229 com.liferay.portlet.social.model.SocialActivityAchievement socialActivityAchievement) 230 throws com.liferay.portal.kernel.exception.SystemException { 231 return getService() 232 .updateSocialActivityAchievement(socialActivityAchievement); 233 } 234 235 /** 236 * Updates the social activity achievement in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 237 * 238 * @param socialActivityAchievement the social activity achievement 239 * @param merge whether to merge the social activity achievement with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation. 240 * @return the social activity achievement that was updated 241 * @throws SystemException if a system exception occurred 242 */ 243 public static com.liferay.portlet.social.model.SocialActivityAchievement updateSocialActivityAchievement( 244 com.liferay.portlet.social.model.SocialActivityAchievement socialActivityAchievement, 245 boolean merge) 246 throws com.liferay.portal.kernel.exception.SystemException { 247 return getService() 248 .updateSocialActivityAchievement(socialActivityAchievement, 249 merge); 250 } 251 252 /** 253 * Returns the Spring bean ID for this bean. 254 * 255 * @return the Spring bean ID for this bean 256 */ 257 public static java.lang.String getBeanIdentifier() { 258 return getService().getBeanIdentifier(); 259 } 260 261 /** 262 * Sets the Spring bean ID for this bean. 263 * 264 * @param beanIdentifier the Spring bean ID for this bean 265 */ 266 public static void setBeanIdentifier(java.lang.String beanIdentifier) { 267 getService().setBeanIdentifier(beanIdentifier); 268 } 269 270 public static void addActivityAchievement(long userId, long groupId, 271 com.liferay.portlet.social.model.SocialAchievement achievement) 272 throws com.liferay.portal.kernel.exception.PortalException, 273 com.liferay.portal.kernel.exception.SystemException { 274 getService().addActivityAchievement(userId, groupId, achievement); 275 } 276 277 public static SocialActivityAchievementLocalService getService() { 278 if (_service == null) { 279 _service = (SocialActivityAchievementLocalService)PortalBeanLocatorUtil.locate(SocialActivityAchievementLocalService.class.getName()); 280 281 ReferenceRegistry.registerReference(SocialActivityAchievementLocalServiceUtil.class, 282 "_service"); 283 MethodCache.remove(SocialActivityAchievementLocalService.class); 284 } 285 286 return _service; 287 } 288 289 public void setService(SocialActivityAchievementLocalService service) { 290 MethodCache.remove(SocialActivityAchievementLocalService.class); 291 292 _service = service; 293 294 ReferenceRegistry.registerReference(SocialActivityAchievementLocalServiceUtil.class, 295 "_service"); 296 MethodCache.remove(SocialActivityAchievementLocalService.class); 297 } 298 299 private static SocialActivityAchievementLocalService _service; 300 }