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 RatingsEntry. This utility wraps
024     * {@link com.liferay.portlet.ratings.service.impl.RatingsEntryLocalServiceImpl} 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 RatingsEntryLocalService
032     * @see com.liferay.portlet.ratings.service.base.RatingsEntryLocalServiceBaseImpl
033     * @see com.liferay.portlet.ratings.service.impl.RatingsEntryLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class RatingsEntryLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.ratings.service.impl.RatingsEntryLocalServiceImpl} 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.ExportActionableDynamicQuery getExportActionableDynamicQuery(
052                    com.liferay.exportimport.kernel.lar.PortletDataContext portletDataContext) {
053                    return getService().getExportActionableDynamicQuery(portletDataContext);
054            }
055    
056            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
057                    return getService().getIndexableActionableDynamicQuery();
058            }
059    
060            /**
061            * @throws PortalException
062            */
063            public static com.liferay.portal.kernel.model.PersistedModel deletePersistedModel(
064                    com.liferay.portal.kernel.model.PersistedModel persistedModel)
065                    throws com.liferay.portal.kernel.exception.PortalException {
066                    return getService().deletePersistedModel(persistedModel);
067            }
068    
069            public static com.liferay.portal.kernel.model.PersistedModel getPersistedModel(
070                    java.io.Serializable primaryKeyObj)
071                    throws com.liferay.portal.kernel.exception.PortalException {
072                    return getService().getPersistedModel(primaryKeyObj);
073            }
074    
075            /**
076            * Adds the ratings entry to the database. Also notifies the appropriate model listeners.
077            *
078            * @param ratingsEntry the ratings entry
079            * @return the ratings entry that was added
080            */
081            public static com.liferay.ratings.kernel.model.RatingsEntry addRatingsEntry(
082                    com.liferay.ratings.kernel.model.RatingsEntry ratingsEntry) {
083                    return getService().addRatingsEntry(ratingsEntry);
084            }
085    
086            /**
087            * Creates a new ratings entry with the primary key. Does not add the ratings entry to the database.
088            *
089            * @param entryId the primary key for the new ratings entry
090            * @return the new ratings entry
091            */
092            public static com.liferay.ratings.kernel.model.RatingsEntry createRatingsEntry(
093                    long entryId) {
094                    return getService().createRatingsEntry(entryId);
095            }
096    
097            /**
098            * Deletes the ratings entry from the database. Also notifies the appropriate model listeners.
099            *
100            * @param ratingsEntry the ratings entry
101            * @return the ratings entry that was removed
102            */
103            public static com.liferay.ratings.kernel.model.RatingsEntry deleteRatingsEntry(
104                    com.liferay.ratings.kernel.model.RatingsEntry ratingsEntry) {
105                    return getService().deleteRatingsEntry(ratingsEntry);
106            }
107    
108            /**
109            * Deletes the ratings entry with the primary key from the database. Also notifies the appropriate model listeners.
110            *
111            * @param entryId the primary key of the ratings entry
112            * @return the ratings entry that was removed
113            * @throws PortalException if a ratings entry with the primary key could not be found
114            */
115            public static com.liferay.ratings.kernel.model.RatingsEntry deleteRatingsEntry(
116                    long entryId)
117                    throws com.liferay.portal.kernel.exception.PortalException {
118                    return getService().deleteRatingsEntry(entryId);
119            }
120    
121            public static com.liferay.ratings.kernel.model.RatingsEntry fetchEntry(
122                    long userId, java.lang.String className, long classPK) {
123                    return getService().fetchEntry(userId, className, classPK);
124            }
125    
126            public static com.liferay.ratings.kernel.model.RatingsEntry fetchRatingsEntry(
127                    long entryId) {
128                    return getService().fetchRatingsEntry(entryId);
129            }
130    
131            /**
132            * Returns the ratings entry with the matching UUID and company.
133            *
134            * @param uuid the ratings entry's UUID
135            * @param companyId the primary key of the company
136            * @return the matching ratings entry, or <code>null</code> if a matching ratings entry could not be found
137            */
138            public static com.liferay.ratings.kernel.model.RatingsEntry fetchRatingsEntryByUuidAndCompanyId(
139                    java.lang.String uuid, long companyId) {
140                    return getService().fetchRatingsEntryByUuidAndCompanyId(uuid, companyId);
141            }
142    
143            public static com.liferay.ratings.kernel.model.RatingsEntry getEntry(
144                    long userId, java.lang.String className, long classPK)
145                    throws com.liferay.portal.kernel.exception.PortalException {
146                    return getService().getEntry(userId, className, classPK);
147            }
148    
149            /**
150            * Returns the ratings entry with the primary key.
151            *
152            * @param entryId the primary key of the ratings entry
153            * @return the ratings entry
154            * @throws PortalException if a ratings entry with the primary key could not be found
155            */
156            public static com.liferay.ratings.kernel.model.RatingsEntry getRatingsEntry(
157                    long entryId)
158                    throws com.liferay.portal.kernel.exception.PortalException {
159                    return getService().getRatingsEntry(entryId);
160            }
161    
162            /**
163            * Returns the ratings entry with the matching UUID and company.
164            *
165            * @param uuid the ratings entry's UUID
166            * @param companyId the primary key of the company
167            * @return the matching ratings entry
168            * @throws PortalException if a matching ratings entry could not be found
169            */
170            public static com.liferay.ratings.kernel.model.RatingsEntry getRatingsEntryByUuidAndCompanyId(
171                    java.lang.String uuid, long companyId)
172                    throws com.liferay.portal.kernel.exception.PortalException {
173                    return getService().getRatingsEntryByUuidAndCompanyId(uuid, companyId);
174            }
175    
176            public static com.liferay.ratings.kernel.model.RatingsEntry updateEntry(
177                    long userId, java.lang.String className, long classPK, double score,
178                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
179                    throws com.liferay.portal.kernel.exception.PortalException {
180                    return getService()
181                                       .updateEntry(userId, className, classPK, score,
182                            serviceContext);
183            }
184    
185            /**
186            * Updates the ratings entry in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
187            *
188            * @param ratingsEntry the ratings entry
189            * @return the ratings entry that was updated
190            */
191            public static com.liferay.ratings.kernel.model.RatingsEntry updateRatingsEntry(
192                    com.liferay.ratings.kernel.model.RatingsEntry ratingsEntry) {
193                    return getService().updateRatingsEntry(ratingsEntry);
194            }
195    
196            public static int getEntriesCount(java.lang.String className, long classPK,
197                    double score) {
198                    return getService().getEntriesCount(className, classPK, score);
199            }
200    
201            /**
202            * Returns the number of ratings entries.
203            *
204            * @return the number of ratings entries
205            */
206            public static int getRatingsEntriesCount() {
207                    return getService().getRatingsEntriesCount();
208            }
209    
210            /**
211            * Returns the OSGi service identifier.
212            *
213            * @return the OSGi service identifier
214            */
215            public static java.lang.String getOSGiServiceIdentifier() {
216                    return getService().getOSGiServiceIdentifier();
217            }
218    
219            /**
220            * Performs a dynamic query on the database and returns the matching rows.
221            *
222            * @param dynamicQuery the dynamic query
223            * @return the matching rows
224            */
225            public static <T> java.util.List<T> dynamicQuery(
226                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
227                    return getService().dynamicQuery(dynamicQuery);
228            }
229    
230            /**
231            * Performs a dynamic query on the database and returns a range of the matching rows.
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.ratings.model.impl.RatingsEntryModelImpl}. 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 dynamicQuery the dynamic query
238            * @param start the lower bound of the range of model instances
239            * @param end the upper bound of the range of model instances (not inclusive)
240            * @return the range of matching rows
241            */
242            public static <T> java.util.List<T> dynamicQuery(
243                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
244                    int end) {
245                    return getService().dynamicQuery(dynamicQuery, start, end);
246            }
247    
248            /**
249            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
250            *
251            * <p>
252            * 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.RatingsEntryModelImpl}. 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.
253            * </p>
254            *
255            * @param dynamicQuery the dynamic query
256            * @param start the lower bound of the range of model instances
257            * @param end the upper bound of the range of model instances (not inclusive)
258            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
259            * @return the ordered range of matching rows
260            */
261            public static <T> java.util.List<T> dynamicQuery(
262                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
263                    int end,
264                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
265                    return getService()
266                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
267            }
268    
269            public static java.util.List<com.liferay.ratings.kernel.model.RatingsEntry> getEntries(
270                    java.lang.String className, long classPK) {
271                    return getService().getEntries(className, classPK);
272            }
273    
274            public static java.util.List<com.liferay.ratings.kernel.model.RatingsEntry> getEntries(
275                    java.lang.String className, long classPK, double score) {
276                    return getService().getEntries(className, classPK, score);
277            }
278    
279            public static java.util.List<com.liferay.ratings.kernel.model.RatingsEntry> getEntries(
280                    long userId, java.lang.String className,
281                    java.util.List<java.lang.Long> classPKs) {
282                    return getService().getEntries(userId, className, classPKs);
283            }
284    
285            /**
286            * Returns a range of all the ratings entries.
287            *
288            * <p>
289            * 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.RatingsEntryModelImpl}. 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.
290            * </p>
291            *
292            * @param start the lower bound of the range of ratings entries
293            * @param end the upper bound of the range of ratings entries (not inclusive)
294            * @return the range of ratings entries
295            */
296            public static java.util.List<com.liferay.ratings.kernel.model.RatingsEntry> getRatingsEntries(
297                    int start, int end) {
298                    return getService().getRatingsEntries(start, end);
299            }
300    
301            /**
302            * Returns the number of rows matching the dynamic query.
303            *
304            * @param dynamicQuery the dynamic query
305            * @return the number of rows matching the dynamic query
306            */
307            public static long dynamicQueryCount(
308                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
309                    return getService().dynamicQueryCount(dynamicQuery);
310            }
311    
312            /**
313            * Returns the number of rows matching the dynamic query.
314            *
315            * @param dynamicQuery the dynamic query
316            * @param projection the projection to apply to the query
317            * @return the number of rows matching the dynamic query
318            */
319            public static long dynamicQueryCount(
320                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
321                    com.liferay.portal.kernel.dao.orm.Projection projection) {
322                    return getService().dynamicQueryCount(dynamicQuery, projection);
323            }
324    
325            public static void deleteEntry(
326                    com.liferay.ratings.kernel.model.RatingsEntry entry, long userId,
327                    java.lang.String className, long classPK)
328                    throws com.liferay.portal.kernel.exception.PortalException {
329                    getService().deleteEntry(entry, userId, className, classPK);
330            }
331    
332            public static void deleteEntry(long userId, java.lang.String className,
333                    long classPK)
334                    throws com.liferay.portal.kernel.exception.PortalException {
335                    getService().deleteEntry(userId, className, classPK);
336            }
337    
338            public static RatingsEntryLocalService getService() {
339                    if (_service == null) {
340                            _service = (RatingsEntryLocalService)PortalBeanLocatorUtil.locate(RatingsEntryLocalService.class.getName());
341    
342                            ReferenceRegistry.registerReference(RatingsEntryLocalServiceUtil.class,
343                                    "_service");
344                    }
345    
346                    return _service;
347            }
348    
349            private static RatingsEntryLocalService _service;
350    }