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.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.util.ReferenceRegistry;
021    
022    /**
023     * Provides the local service utility for SocialActivityAchievement. This utility wraps
024     * {@link com.liferay.portlet.social.service.impl.SocialActivityAchievementLocalServiceImpl} 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 SocialActivityAchievementLocalService
032     * @see com.liferay.portlet.social.service.base.SocialActivityAchievementLocalServiceBaseImpl
033     * @see com.liferay.portlet.social.service.impl.SocialActivityAchievementLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class SocialActivityAchievementLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * 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.
042             */
043            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
044                    return getService().getActionableDynamicQuery();
045            }
046    
047            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
048                    return getService().dynamicQuery();
049            }
050    
051            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
052                    return getService().getIndexableActionableDynamicQuery();
053            }
054    
055            /**
056            * @throws PortalException
057            */
058            public static com.liferay.portal.kernel.model.PersistedModel deletePersistedModel(
059                    com.liferay.portal.kernel.model.PersistedModel persistedModel)
060                    throws com.liferay.portal.kernel.exception.PortalException {
061                    return getService().deletePersistedModel(persistedModel);
062            }
063    
064            public static com.liferay.portal.kernel.model.PersistedModel getPersistedModel(
065                    java.io.Serializable primaryKeyObj)
066                    throws com.liferay.portal.kernel.exception.PortalException {
067                    return getService().getPersistedModel(primaryKeyObj);
068            }
069    
070            /**
071            * Adds the social activity achievement to the database. Also notifies the appropriate model listeners.
072            *
073            * @param socialActivityAchievement the social activity achievement
074            * @return the social activity achievement that was added
075            */
076            public static com.liferay.social.kernel.model.SocialActivityAchievement addSocialActivityAchievement(
077                    com.liferay.social.kernel.model.SocialActivityAchievement socialActivityAchievement) {
078                    return getService()
079                                       .addSocialActivityAchievement(socialActivityAchievement);
080            }
081    
082            /**
083            * Creates a new social activity achievement with the primary key. Does not add the social activity achievement to the database.
084            *
085            * @param activityAchievementId the primary key for the new social activity achievement
086            * @return the new social activity achievement
087            */
088            public static com.liferay.social.kernel.model.SocialActivityAchievement createSocialActivityAchievement(
089                    long activityAchievementId) {
090                    return getService()
091                                       .createSocialActivityAchievement(activityAchievementId);
092            }
093    
094            /**
095            * Deletes the social activity achievement from the database. Also notifies the appropriate model listeners.
096            *
097            * @param socialActivityAchievement the social activity achievement
098            * @return the social activity achievement that was removed
099            */
100            public static com.liferay.social.kernel.model.SocialActivityAchievement deleteSocialActivityAchievement(
101                    com.liferay.social.kernel.model.SocialActivityAchievement socialActivityAchievement) {
102                    return getService()
103                                       .deleteSocialActivityAchievement(socialActivityAchievement);
104            }
105    
106            /**
107            * Deletes the social activity achievement with the primary key from the database. Also notifies the appropriate model listeners.
108            *
109            * @param activityAchievementId the primary key of the social activity achievement
110            * @return the social activity achievement that was removed
111            * @throws PortalException if a social activity achievement with the primary key could not be found
112            */
113            public static com.liferay.social.kernel.model.SocialActivityAchievement deleteSocialActivityAchievement(
114                    long activityAchievementId)
115                    throws com.liferay.portal.kernel.exception.PortalException {
116                    return getService()
117                                       .deleteSocialActivityAchievement(activityAchievementId);
118            }
119    
120            public static com.liferay.social.kernel.model.SocialActivityAchievement fetchSocialActivityAchievement(
121                    long activityAchievementId) {
122                    return getService().fetchSocialActivityAchievement(activityAchievementId);
123            }
124    
125            public static com.liferay.social.kernel.model.SocialActivityAchievement fetchUserAchievement(
126                    long userId, long groupId, java.lang.String name) {
127                    return getService().fetchUserAchievement(userId, groupId, name);
128            }
129    
130            /**
131            * Returns the social activity achievement with the primary key.
132            *
133            * @param activityAchievementId the primary key of the social activity achievement
134            * @return the social activity achievement
135            * @throws PortalException if a social activity achievement with the primary key could not be found
136            */
137            public static com.liferay.social.kernel.model.SocialActivityAchievement getSocialActivityAchievement(
138                    long activityAchievementId)
139                    throws com.liferay.portal.kernel.exception.PortalException {
140                    return getService().getSocialActivityAchievement(activityAchievementId);
141            }
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            public static com.liferay.social.kernel.model.SocialActivityAchievement updateSocialActivityAchievement(
150                    com.liferay.social.kernel.model.SocialActivityAchievement socialActivityAchievement) {
151                    return getService()
152                                       .updateSocialActivityAchievement(socialActivityAchievement);
153            }
154    
155            public static int getGroupAchievementsCount(long groupId) {
156                    return getService().getGroupAchievementsCount(groupId);
157            }
158    
159            public static int getGroupAchievementsCount(long groupId,
160                    java.lang.String name) {
161                    return getService().getGroupAchievementsCount(groupId, name);
162            }
163    
164            public static int getGroupFirstAchievementsCount(long groupId) {
165                    return getService().getGroupFirstAchievementsCount(groupId);
166            }
167    
168            /**
169            * Returns the number of social activity achievements.
170            *
171            * @return the number of social activity achievements
172            */
173            public static int getSocialActivityAchievementsCount() {
174                    return getService().getSocialActivityAchievementsCount();
175            }
176    
177            public static int getUserAchievementsCount(long userId, long groupId) {
178                    return getService().getUserAchievementsCount(userId, groupId);
179            }
180    
181            /**
182            * Returns the OSGi service identifier.
183            *
184            * @return the OSGi service identifier
185            */
186            public static java.lang.String getOSGiServiceIdentifier() {
187                    return getService().getOSGiServiceIdentifier();
188            }
189    
190            /**
191            * Performs a dynamic query on the database and returns the matching rows.
192            *
193            * @param dynamicQuery the dynamic query
194            * @return the matching rows
195            */
196            public static <T> java.util.List<T> dynamicQuery(
197                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
198                    return getService().dynamicQuery(dynamicQuery);
199            }
200    
201            /**
202            * Performs a dynamic query on the database and returns a range of the matching rows.
203            *
204            * <p>
205            * 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.
206            * </p>
207            *
208            * @param dynamicQuery the dynamic query
209            * @param start the lower bound of the range of model instances
210            * @param end the upper bound of the range of model instances (not inclusive)
211            * @return the range of matching rows
212            */
213            public static <T> java.util.List<T> dynamicQuery(
214                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
215                    int end) {
216                    return getService().dynamicQuery(dynamicQuery, start, end);
217            }
218    
219            /**
220            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
221            *
222            * <p>
223            * 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.
224            * </p>
225            *
226            * @param dynamicQuery the dynamic query
227            * @param start the lower bound of the range of model instances
228            * @param end the upper bound of the range of model instances (not inclusive)
229            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
230            * @return the ordered range of matching rows
231            */
232            public static <T> java.util.List<T> dynamicQuery(
233                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
234                    int end,
235                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
236                    return getService()
237                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
238            }
239    
240            public static java.util.List<com.liferay.social.kernel.model.SocialActivityAchievement> getGroupAchievements(
241                    long groupId) {
242                    return getService().getGroupAchievements(groupId);
243            }
244    
245            public static java.util.List<com.liferay.social.kernel.model.SocialActivityAchievement> getGroupAchievements(
246                    long groupId, java.lang.String name) {
247                    return getService().getGroupAchievements(groupId, name);
248            }
249    
250            public static java.util.List<com.liferay.social.kernel.model.SocialActivityAchievement> getGroupFirstAchievements(
251                    long groupId) {
252                    return getService().getGroupFirstAchievements(groupId);
253            }
254    
255            /**
256            * Returns a range of all the social activity achievements.
257            *
258            * <p>
259            * 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.
260            * </p>
261            *
262            * @param start the lower bound of the range of social activity achievements
263            * @param end the upper bound of the range of social activity achievements (not inclusive)
264            * @return the range of social activity achievements
265            */
266            public static java.util.List<com.liferay.social.kernel.model.SocialActivityAchievement> getSocialActivityAchievements(
267                    int start, int end) {
268                    return getService().getSocialActivityAchievements(start, end);
269            }
270    
271            public static java.util.List<com.liferay.social.kernel.model.SocialActivityAchievement> getUserAchievements(
272                    long userId, long groupId) {
273                    return getService().getUserAchievements(userId, groupId);
274            }
275    
276            /**
277            * Returns the number of rows matching the dynamic query.
278            *
279            * @param dynamicQuery the dynamic query
280            * @return the number of rows matching the dynamic query
281            */
282            public static long dynamicQueryCount(
283                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
284                    return getService().dynamicQueryCount(dynamicQuery);
285            }
286    
287            /**
288            * Returns the number of rows matching the dynamic query.
289            *
290            * @param dynamicQuery the dynamic query
291            * @param projection the projection to apply to the query
292            * @return the number of rows matching the dynamic query
293            */
294            public static long dynamicQueryCount(
295                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
296                    com.liferay.portal.kernel.dao.orm.Projection projection) {
297                    return getService().dynamicQueryCount(dynamicQuery, projection);
298            }
299    
300            public static void addActivityAchievement(long userId, long groupId,
301                    com.liferay.social.kernel.model.SocialAchievement achievement)
302                    throws com.liferay.portal.kernel.exception.PortalException {
303                    getService().addActivityAchievement(userId, groupId, achievement);
304            }
305    
306            public static SocialActivityAchievementLocalService getService() {
307                    if (_service == null) {
308                            _service = (SocialActivityAchievementLocalService)PortalBeanLocatorUtil.locate(SocialActivityAchievementLocalService.class.getName());
309    
310                            ReferenceRegistry.registerReference(SocialActivityAchievementLocalServiceUtil.class,
311                                    "_service");
312                    }
313    
314                    return _service;
315            }
316    
317            private static SocialActivityAchievementLocalService _service;
318    }