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.ratings.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 RatingsStats. This utility wraps
024     * {@link com.liferay.portlet.ratings.service.impl.RatingsStatsLocalServiceImpl} 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 RatingsStatsLocalService
032     * @see com.liferay.portlet.ratings.service.base.RatingsStatsLocalServiceBaseImpl
033     * @see com.liferay.portlet.ratings.service.impl.RatingsStatsLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class RatingsStatsLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.ratings.service.impl.RatingsStatsLocalServiceImpl} 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 ratings stats to the database. Also notifies the appropriate model listeners.
072            *
073            * @param ratingsStats the ratings stats
074            * @return the ratings stats that was added
075            */
076            public static com.liferay.ratings.kernel.model.RatingsStats addRatingsStats(
077                    com.liferay.ratings.kernel.model.RatingsStats ratingsStats) {
078                    return getService().addRatingsStats(ratingsStats);
079            }
080    
081            public static com.liferay.ratings.kernel.model.RatingsStats addStats(
082                    long classNameId, long classPK) {
083                    return getService().addStats(classNameId, classPK);
084            }
085    
086            /**
087            * Creates a new ratings stats with the primary key. Does not add the ratings stats to the database.
088            *
089            * @param statsId the primary key for the new ratings stats
090            * @return the new ratings stats
091            */
092            public static com.liferay.ratings.kernel.model.RatingsStats createRatingsStats(
093                    long statsId) {
094                    return getService().createRatingsStats(statsId);
095            }
096    
097            /**
098            * Deletes the ratings stats from the database. Also notifies the appropriate model listeners.
099            *
100            * @param ratingsStats the ratings stats
101            * @return the ratings stats that was removed
102            */
103            public static com.liferay.ratings.kernel.model.RatingsStats deleteRatingsStats(
104                    com.liferay.ratings.kernel.model.RatingsStats ratingsStats) {
105                    return getService().deleteRatingsStats(ratingsStats);
106            }
107    
108            /**
109            * Deletes the ratings stats with the primary key from the database. Also notifies the appropriate model listeners.
110            *
111            * @param statsId the primary key of the ratings stats
112            * @return the ratings stats that was removed
113            * @throws PortalException if a ratings stats with the primary key could not be found
114            */
115            public static com.liferay.ratings.kernel.model.RatingsStats deleteRatingsStats(
116                    long statsId)
117                    throws com.liferay.portal.kernel.exception.PortalException {
118                    return getService().deleteRatingsStats(statsId);
119            }
120    
121            public static com.liferay.ratings.kernel.model.RatingsStats fetchRatingsStats(
122                    long statsId) {
123                    return getService().fetchRatingsStats(statsId);
124            }
125    
126            public static com.liferay.ratings.kernel.model.RatingsStats fetchStats(
127                    java.lang.String className, long classPK) {
128                    return getService().fetchStats(className, classPK);
129            }
130    
131            /**
132            * Returns the ratings stats with the primary key.
133            *
134            * @param statsId the primary key of the ratings stats
135            * @return the ratings stats
136            * @throws PortalException if a ratings stats with the primary key could not be found
137            */
138            public static com.liferay.ratings.kernel.model.RatingsStats getRatingsStats(
139                    long statsId)
140                    throws com.liferay.portal.kernel.exception.PortalException {
141                    return getService().getRatingsStats(statsId);
142            }
143    
144            public static com.liferay.ratings.kernel.model.RatingsStats getStats(
145                    java.lang.String className, long classPK) {
146                    return getService().getStats(className, classPK);
147            }
148    
149            public static com.liferay.ratings.kernel.model.RatingsStats getStats(
150                    long statsId)
151                    throws com.liferay.portal.kernel.exception.PortalException {
152                    return getService().getStats(statsId);
153            }
154    
155            /**
156            * Updates the ratings stats in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
157            *
158            * @param ratingsStats the ratings stats
159            * @return the ratings stats that was updated
160            */
161            public static com.liferay.ratings.kernel.model.RatingsStats updateRatingsStats(
162                    com.liferay.ratings.kernel.model.RatingsStats ratingsStats) {
163                    return getService().updateRatingsStats(ratingsStats);
164            }
165    
166            /**
167            * Returns the number of ratings statses.
168            *
169            * @return the number of ratings statses
170            */
171            public static int getRatingsStatsesCount() {
172                    return getService().getRatingsStatsesCount();
173            }
174    
175            /**
176            * Returns the OSGi service identifier.
177            *
178            * @return the OSGi service identifier
179            */
180            public static java.lang.String getOSGiServiceIdentifier() {
181                    return getService().getOSGiServiceIdentifier();
182            }
183    
184            /**
185            * Performs a dynamic query on the database and returns the matching rows.
186            *
187            * @param dynamicQuery the dynamic query
188            * @return the matching rows
189            */
190            public static <T> java.util.List<T> dynamicQuery(
191                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
192                    return getService().dynamicQuery(dynamicQuery);
193            }
194    
195            /**
196            * Performs a dynamic query on the database and returns a range of the matching rows.
197            *
198            * <p>
199            * 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.RatingsStatsModelImpl}. 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.
200            * </p>
201            *
202            * @param dynamicQuery the dynamic query
203            * @param start the lower bound of the range of model instances
204            * @param end the upper bound of the range of model instances (not inclusive)
205            * @return the range of matching rows
206            */
207            public static <T> java.util.List<T> dynamicQuery(
208                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
209                    int end) {
210                    return getService().dynamicQuery(dynamicQuery, start, end);
211            }
212    
213            /**
214            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
215            *
216            * <p>
217            * 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.RatingsStatsModelImpl}. 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.
218            * </p>
219            *
220            * @param dynamicQuery the dynamic query
221            * @param start the lower bound of the range of model instances
222            * @param end the upper bound of the range of model instances (not inclusive)
223            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
224            * @return the ordered range of matching rows
225            */
226            public static <T> java.util.List<T> dynamicQuery(
227                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
228                    int end,
229                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
230                    return getService()
231                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
232            }
233    
234            /**
235            * Returns a range of all the ratings statses.
236            *
237            * <p>
238            * 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.RatingsStatsModelImpl}. 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.
239            * </p>
240            *
241            * @param start the lower bound of the range of ratings statses
242            * @param end the upper bound of the range of ratings statses (not inclusive)
243            * @return the range of ratings statses
244            */
245            public static java.util.List<com.liferay.ratings.kernel.model.RatingsStats> getRatingsStatses(
246                    int start, int end) {
247                    return getService().getRatingsStatses(start, end);
248            }
249    
250            public static java.util.List<com.liferay.ratings.kernel.model.RatingsStats> getStats(
251                    java.lang.String className, java.util.List<java.lang.Long> classPKs) {
252                    return getService().getStats(className, classPKs);
253            }
254    
255            /**
256            * Returns the number of rows matching the dynamic query.
257            *
258            * @param dynamicQuery the dynamic query
259            * @return the number of rows matching the dynamic query
260            */
261            public static long dynamicQueryCount(
262                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
263                    return getService().dynamicQueryCount(dynamicQuery);
264            }
265    
266            /**
267            * Returns the number of rows matching the dynamic query.
268            *
269            * @param dynamicQuery the dynamic query
270            * @param projection the projection to apply to the query
271            * @return the number of rows matching the dynamic query
272            */
273            public static long dynamicQueryCount(
274                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
275                    com.liferay.portal.kernel.dao.orm.Projection projection) {
276                    return getService().dynamicQueryCount(dynamicQuery, projection);
277            }
278    
279            public static void deleteStats(java.lang.String className, long classPK) {
280                    getService().deleteStats(className, classPK);
281            }
282    
283            public static RatingsStatsLocalService getService() {
284                    if (_service == null) {
285                            _service = (RatingsStatsLocalService)PortalBeanLocatorUtil.locate(RatingsStatsLocalService.class.getName());
286    
287                            ReferenceRegistry.registerReference(RatingsStatsLocalServiceUtil.class,
288                                    "_service");
289                    }
290    
291                    return _service;
292            }
293    
294            private static RatingsStatsLocalService _service;
295    }