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.portlet.ratings.service.base;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.asset.kernel.service.persistence.AssetEntryFinder;
020    import com.liferay.asset.kernel.service.persistence.AssetEntryPersistence;
021    
022    import com.liferay.blogs.kernel.service.persistence.BlogsEntryFinder;
023    import com.liferay.blogs.kernel.service.persistence.BlogsEntryPersistence;
024    import com.liferay.blogs.kernel.service.persistence.BlogsStatsUserFinder;
025    import com.liferay.blogs.kernel.service.persistence.BlogsStatsUserPersistence;
026    
027    import com.liferay.exportimport.kernel.lar.ExportImportHelperUtil;
028    import com.liferay.exportimport.kernel.lar.ManifestSummary;
029    import com.liferay.exportimport.kernel.lar.PortletDataContext;
030    import com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil;
031    import com.liferay.exportimport.kernel.lar.StagedModelType;
032    
033    import com.liferay.portal.kernel.bean.BeanReference;
034    import com.liferay.portal.kernel.dao.db.DB;
035    import com.liferay.portal.kernel.dao.db.DBManagerUtil;
036    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
037    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
038    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
039    import com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery;
040    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
041    import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
042    import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery;
043    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
044    import com.liferay.portal.kernel.dao.orm.Projection;
045    import com.liferay.portal.kernel.dao.orm.Property;
046    import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil;
047    import com.liferay.portal.kernel.exception.PortalException;
048    import com.liferay.portal.kernel.exception.SystemException;
049    import com.liferay.portal.kernel.model.PersistedModel;
050    import com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService;
051    import com.liferay.portal.kernel.search.Indexable;
052    import com.liferay.portal.kernel.search.IndexableType;
053    import com.liferay.portal.kernel.service.BaseLocalServiceImpl;
054    import com.liferay.portal.kernel.service.PersistedModelLocalServiceRegistry;
055    import com.liferay.portal.kernel.service.persistence.ClassNamePersistence;
056    import com.liferay.portal.kernel.service.persistence.UserFinder;
057    import com.liferay.portal.kernel.service.persistence.UserPersistence;
058    import com.liferay.portal.kernel.util.OrderByComparator;
059    import com.liferay.portal.kernel.util.PortalUtil;
060    
061    import com.liferay.ratings.kernel.model.RatingsEntry;
062    import com.liferay.ratings.kernel.service.RatingsEntryLocalService;
063    import com.liferay.ratings.kernel.service.persistence.RatingsEntryFinder;
064    import com.liferay.ratings.kernel.service.persistence.RatingsEntryPersistence;
065    import com.liferay.ratings.kernel.service.persistence.RatingsStatsFinder;
066    import com.liferay.ratings.kernel.service.persistence.RatingsStatsPersistence;
067    
068    import java.io.Serializable;
069    
070    import java.util.List;
071    
072    import javax.sql.DataSource;
073    
074    /**
075     * Provides the base implementation for the ratings entry local service.
076     *
077     * <p>
078     * This implementation exists only as a container for the default service methods generated by ServiceBuilder. All custom service methods should be put in {@link com.liferay.portlet.ratings.service.impl.RatingsEntryLocalServiceImpl}.
079     * </p>
080     *
081     * @author Brian Wing Shun Chan
082     * @see com.liferay.portlet.ratings.service.impl.RatingsEntryLocalServiceImpl
083     * @see com.liferay.ratings.kernel.service.RatingsEntryLocalServiceUtil
084     * @generated
085     */
086    @ProviderType
087    public abstract class RatingsEntryLocalServiceBaseImpl
088            extends BaseLocalServiceImpl implements RatingsEntryLocalService,
089                    IdentifiableOSGiService {
090            /*
091             * NOTE FOR DEVELOPERS:
092             *
093             * Never modify or reference this class directly. Always use {@link com.liferay.ratings.kernel.service.RatingsEntryLocalServiceUtil} to access the ratings entry local service.
094             */
095    
096            /**
097             * Adds the ratings entry to the database. Also notifies the appropriate model listeners.
098             *
099             * @param ratingsEntry the ratings entry
100             * @return the ratings entry that was added
101             */
102            @Indexable(type = IndexableType.REINDEX)
103            @Override
104            public RatingsEntry addRatingsEntry(RatingsEntry ratingsEntry) {
105                    ratingsEntry.setNew(true);
106    
107                    return ratingsEntryPersistence.update(ratingsEntry);
108            }
109    
110            /**
111             * Creates a new ratings entry with the primary key. Does not add the ratings entry to the database.
112             *
113             * @param entryId the primary key for the new ratings entry
114             * @return the new ratings entry
115             */
116            @Override
117            public RatingsEntry createRatingsEntry(long entryId) {
118                    return ratingsEntryPersistence.create(entryId);
119            }
120    
121            /**
122             * Deletes the ratings entry with the primary key from the database. Also notifies the appropriate model listeners.
123             *
124             * @param entryId the primary key of the ratings entry
125             * @return the ratings entry that was removed
126             * @throws PortalException if a ratings entry with the primary key could not be found
127             */
128            @Indexable(type = IndexableType.DELETE)
129            @Override
130            public RatingsEntry deleteRatingsEntry(long entryId)
131                    throws PortalException {
132                    return ratingsEntryPersistence.remove(entryId);
133            }
134    
135            /**
136             * Deletes the ratings entry from the database. Also notifies the appropriate model listeners.
137             *
138             * @param ratingsEntry the ratings entry
139             * @return the ratings entry that was removed
140             */
141            @Indexable(type = IndexableType.DELETE)
142            @Override
143            public RatingsEntry deleteRatingsEntry(RatingsEntry ratingsEntry) {
144                    return ratingsEntryPersistence.remove(ratingsEntry);
145            }
146    
147            @Override
148            public DynamicQuery dynamicQuery() {
149                    Class<?> clazz = getClass();
150    
151                    return DynamicQueryFactoryUtil.forClass(RatingsEntry.class,
152                            clazz.getClassLoader());
153            }
154    
155            /**
156             * Performs a dynamic query on the database and returns the matching rows.
157             *
158             * @param dynamicQuery the dynamic query
159             * @return the matching rows
160             */
161            @Override
162            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
163                    return ratingsEntryPersistence.findWithDynamicQuery(dynamicQuery);
164            }
165    
166            /**
167             * Performs a dynamic query on the database and returns a range of the matching rows.
168             *
169             * <p>
170             * 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.
171             * </p>
172             *
173             * @param dynamicQuery the dynamic query
174             * @param start the lower bound of the range of model instances
175             * @param end the upper bound of the range of model instances (not inclusive)
176             * @return the range of matching rows
177             */
178            @Override
179            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
180                    int end) {
181                    return ratingsEntryPersistence.findWithDynamicQuery(dynamicQuery,
182                            start, end);
183            }
184    
185            /**
186             * Performs a dynamic query on the database and returns an ordered range of the matching rows.
187             *
188             * <p>
189             * 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.
190             * </p>
191             *
192             * @param dynamicQuery the dynamic query
193             * @param start the lower bound of the range of model instances
194             * @param end the upper bound of the range of model instances (not inclusive)
195             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
196             * @return the ordered range of matching rows
197             */
198            @Override
199            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
200                    int end, OrderByComparator<T> orderByComparator) {
201                    return ratingsEntryPersistence.findWithDynamicQuery(dynamicQuery,
202                            start, end, orderByComparator);
203            }
204    
205            /**
206             * Returns the number of rows matching the dynamic query.
207             *
208             * @param dynamicQuery the dynamic query
209             * @return the number of rows matching the dynamic query
210             */
211            @Override
212            public long dynamicQueryCount(DynamicQuery dynamicQuery) {
213                    return ratingsEntryPersistence.countWithDynamicQuery(dynamicQuery);
214            }
215    
216            /**
217             * Returns the number of rows matching the dynamic query.
218             *
219             * @param dynamicQuery the dynamic query
220             * @param projection the projection to apply to the query
221             * @return the number of rows matching the dynamic query
222             */
223            @Override
224            public long dynamicQueryCount(DynamicQuery dynamicQuery,
225                    Projection projection) {
226                    return ratingsEntryPersistence.countWithDynamicQuery(dynamicQuery,
227                            projection);
228            }
229    
230            @Override
231            public RatingsEntry fetchRatingsEntry(long entryId) {
232                    return ratingsEntryPersistence.fetchByPrimaryKey(entryId);
233            }
234    
235            /**
236             * Returns the ratings entry with the matching UUID and company.
237             *
238             * @param uuid the ratings entry's UUID
239             * @param companyId the primary key of the company
240             * @return the matching ratings entry, or <code>null</code> if a matching ratings entry could not be found
241             */
242            @Override
243            public RatingsEntry fetchRatingsEntryByUuidAndCompanyId(String uuid,
244                    long companyId) {
245                    return ratingsEntryPersistence.fetchByUuid_C_First(uuid, companyId, null);
246            }
247    
248            /**
249             * Returns the ratings entry with the primary key.
250             *
251             * @param entryId the primary key of the ratings entry
252             * @return the ratings entry
253             * @throws PortalException if a ratings entry with the primary key could not be found
254             */
255            @Override
256            public RatingsEntry getRatingsEntry(long entryId) throws PortalException {
257                    return ratingsEntryPersistence.findByPrimaryKey(entryId);
258            }
259    
260            @Override
261            public ActionableDynamicQuery getActionableDynamicQuery() {
262                    ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
263    
264                    actionableDynamicQuery.setBaseLocalService(ratingsEntryLocalService);
265                    actionableDynamicQuery.setClassLoader(getClassLoader());
266                    actionableDynamicQuery.setModelClass(RatingsEntry.class);
267    
268                    actionableDynamicQuery.setPrimaryKeyPropertyName("entryId");
269    
270                    return actionableDynamicQuery;
271            }
272    
273            @Override
274            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
275                    IndexableActionableDynamicQuery indexableActionableDynamicQuery = new IndexableActionableDynamicQuery();
276    
277                    indexableActionableDynamicQuery.setBaseLocalService(ratingsEntryLocalService);
278                    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
279                    indexableActionableDynamicQuery.setModelClass(RatingsEntry.class);
280    
281                    indexableActionableDynamicQuery.setPrimaryKeyPropertyName("entryId");
282    
283                    return indexableActionableDynamicQuery;
284            }
285    
286            protected void initActionableDynamicQuery(
287                    ActionableDynamicQuery actionableDynamicQuery) {
288                    actionableDynamicQuery.setBaseLocalService(ratingsEntryLocalService);
289                    actionableDynamicQuery.setClassLoader(getClassLoader());
290                    actionableDynamicQuery.setModelClass(RatingsEntry.class);
291    
292                    actionableDynamicQuery.setPrimaryKeyPropertyName("entryId");
293            }
294    
295            @Override
296            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
297                    final PortletDataContext portletDataContext) {
298                    final ExportActionableDynamicQuery exportActionableDynamicQuery = new ExportActionableDynamicQuery() {
299                                    @Override
300                                    public long performCount() throws PortalException {
301                                            ManifestSummary manifestSummary = portletDataContext.getManifestSummary();
302    
303                                            StagedModelType stagedModelType = getStagedModelType();
304    
305                                            long modelAdditionCount = super.performCount();
306    
307                                            manifestSummary.addModelAdditionCount(stagedModelType,
308                                                    modelAdditionCount);
309    
310                                            long modelDeletionCount = ExportImportHelperUtil.getModelDeletionCount(portletDataContext,
311                                                            stagedModelType);
312    
313                                            manifestSummary.addModelDeletionCount(stagedModelType,
314                                                    modelDeletionCount);
315    
316                                            return modelAdditionCount;
317                                    }
318                            };
319    
320                    initActionableDynamicQuery(exportActionableDynamicQuery);
321    
322                    exportActionableDynamicQuery.setAddCriteriaMethod(new ActionableDynamicQuery.AddCriteriaMethod() {
323                                    @Override
324                                    public void addCriteria(DynamicQuery dynamicQuery) {
325                                            portletDataContext.addDateRangeCriteria(dynamicQuery,
326                                                    "modifiedDate");
327    
328                                            StagedModelType stagedModelType = exportActionableDynamicQuery.getStagedModelType();
329    
330                                            long referrerClassNameId = stagedModelType.getReferrerClassNameId();
331    
332                                            Property classNameIdProperty = PropertyFactoryUtil.forName(
333                                                            "classNameId");
334    
335                                            if ((referrerClassNameId != StagedModelType.REFERRER_CLASS_NAME_ID_ALL) &&
336                                                            (referrerClassNameId != StagedModelType.REFERRER_CLASS_NAME_ID_ANY)) {
337                                                    dynamicQuery.add(classNameIdProperty.eq(
338                                                                    stagedModelType.getReferrerClassNameId()));
339                                            }
340                                            else if (referrerClassNameId == StagedModelType.REFERRER_CLASS_NAME_ID_ANY) {
341                                                    dynamicQuery.add(classNameIdProperty.isNotNull());
342                                            }
343                                    }
344                            });
345    
346                    exportActionableDynamicQuery.setCompanyId(portletDataContext.getCompanyId());
347    
348                    exportActionableDynamicQuery.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod<RatingsEntry>() {
349                                    @Override
350                                    public void performAction(RatingsEntry ratingsEntry)
351                                            throws PortalException {
352                                            StagedModelDataHandlerUtil.exportStagedModel(portletDataContext,
353                                                    ratingsEntry);
354                                    }
355                            });
356                    exportActionableDynamicQuery.setStagedModelType(new StagedModelType(
357                                    PortalUtil.getClassNameId(RatingsEntry.class.getName()),
358                                    StagedModelType.REFERRER_CLASS_NAME_ID_ALL));
359    
360                    return exportActionableDynamicQuery;
361            }
362    
363            /**
364             * @throws PortalException
365             */
366            @Override
367            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
368                    throws PortalException {
369                    return ratingsEntryLocalService.deleteRatingsEntry((RatingsEntry)persistedModel);
370            }
371    
372            @Override
373            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
374                    throws PortalException {
375                    return ratingsEntryPersistence.findByPrimaryKey(primaryKeyObj);
376            }
377    
378            /**
379             * Returns the ratings entry with the matching UUID and company.
380             *
381             * @param uuid the ratings entry's UUID
382             * @param companyId the primary key of the company
383             * @return the matching ratings entry
384             * @throws PortalException if a matching ratings entry could not be found
385             */
386            @Override
387            public RatingsEntry getRatingsEntryByUuidAndCompanyId(String uuid,
388                    long companyId) throws PortalException {
389                    return ratingsEntryPersistence.findByUuid_C_First(uuid, companyId, null);
390            }
391    
392            /**
393             * Returns a range of all the ratings entries.
394             *
395             * <p>
396             * 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.
397             * </p>
398             *
399             * @param start the lower bound of the range of ratings entries
400             * @param end the upper bound of the range of ratings entries (not inclusive)
401             * @return the range of ratings entries
402             */
403            @Override
404            public List<RatingsEntry> getRatingsEntries(int start, int end) {
405                    return ratingsEntryPersistence.findAll(start, end);
406            }
407    
408            /**
409             * Returns the number of ratings entries.
410             *
411             * @return the number of ratings entries
412             */
413            @Override
414            public int getRatingsEntriesCount() {
415                    return ratingsEntryPersistence.countAll();
416            }
417    
418            /**
419             * Updates the ratings entry in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
420             *
421             * @param ratingsEntry the ratings entry
422             * @return the ratings entry that was updated
423             */
424            @Indexable(type = IndexableType.REINDEX)
425            @Override
426            public RatingsEntry updateRatingsEntry(RatingsEntry ratingsEntry) {
427                    return ratingsEntryPersistence.update(ratingsEntry);
428            }
429    
430            /**
431             * Returns the ratings entry local service.
432             *
433             * @return the ratings entry local service
434             */
435            public RatingsEntryLocalService getRatingsEntryLocalService() {
436                    return ratingsEntryLocalService;
437            }
438    
439            /**
440             * Sets the ratings entry local service.
441             *
442             * @param ratingsEntryLocalService the ratings entry local service
443             */
444            public void setRatingsEntryLocalService(
445                    RatingsEntryLocalService ratingsEntryLocalService) {
446                    this.ratingsEntryLocalService = ratingsEntryLocalService;
447            }
448    
449            /**
450             * Returns the ratings entry persistence.
451             *
452             * @return the ratings entry persistence
453             */
454            public RatingsEntryPersistence getRatingsEntryPersistence() {
455                    return ratingsEntryPersistence;
456            }
457    
458            /**
459             * Sets the ratings entry persistence.
460             *
461             * @param ratingsEntryPersistence the ratings entry persistence
462             */
463            public void setRatingsEntryPersistence(
464                    RatingsEntryPersistence ratingsEntryPersistence) {
465                    this.ratingsEntryPersistence = ratingsEntryPersistence;
466            }
467    
468            /**
469             * Returns the ratings entry finder.
470             *
471             * @return the ratings entry finder
472             */
473            public RatingsEntryFinder getRatingsEntryFinder() {
474                    return ratingsEntryFinder;
475            }
476    
477            /**
478             * Sets the ratings entry finder.
479             *
480             * @param ratingsEntryFinder the ratings entry finder
481             */
482            public void setRatingsEntryFinder(RatingsEntryFinder ratingsEntryFinder) {
483                    this.ratingsEntryFinder = ratingsEntryFinder;
484            }
485    
486            /**
487             * Returns the ratings stats local service.
488             *
489             * @return the ratings stats local service
490             */
491            public com.liferay.ratings.kernel.service.RatingsStatsLocalService getRatingsStatsLocalService() {
492                    return ratingsStatsLocalService;
493            }
494    
495            /**
496             * Sets the ratings stats local service.
497             *
498             * @param ratingsStatsLocalService the ratings stats local service
499             */
500            public void setRatingsStatsLocalService(
501                    com.liferay.ratings.kernel.service.RatingsStatsLocalService ratingsStatsLocalService) {
502                    this.ratingsStatsLocalService = ratingsStatsLocalService;
503            }
504    
505            /**
506             * Returns the ratings stats persistence.
507             *
508             * @return the ratings stats persistence
509             */
510            public RatingsStatsPersistence getRatingsStatsPersistence() {
511                    return ratingsStatsPersistence;
512            }
513    
514            /**
515             * Sets the ratings stats persistence.
516             *
517             * @param ratingsStatsPersistence the ratings stats persistence
518             */
519            public void setRatingsStatsPersistence(
520                    RatingsStatsPersistence ratingsStatsPersistence) {
521                    this.ratingsStatsPersistence = ratingsStatsPersistence;
522            }
523    
524            /**
525             * Returns the ratings stats finder.
526             *
527             * @return the ratings stats finder
528             */
529            public RatingsStatsFinder getRatingsStatsFinder() {
530                    return ratingsStatsFinder;
531            }
532    
533            /**
534             * Sets the ratings stats finder.
535             *
536             * @param ratingsStatsFinder the ratings stats finder
537             */
538            public void setRatingsStatsFinder(RatingsStatsFinder ratingsStatsFinder) {
539                    this.ratingsStatsFinder = ratingsStatsFinder;
540            }
541    
542            /**
543             * Returns the counter local service.
544             *
545             * @return the counter local service
546             */
547            public com.liferay.counter.kernel.service.CounterLocalService getCounterLocalService() {
548                    return counterLocalService;
549            }
550    
551            /**
552             * Sets the counter local service.
553             *
554             * @param counterLocalService the counter local service
555             */
556            public void setCounterLocalService(
557                    com.liferay.counter.kernel.service.CounterLocalService counterLocalService) {
558                    this.counterLocalService = counterLocalService;
559            }
560    
561            /**
562             * Returns the class name local service.
563             *
564             * @return the class name local service
565             */
566            public com.liferay.portal.kernel.service.ClassNameLocalService getClassNameLocalService() {
567                    return classNameLocalService;
568            }
569    
570            /**
571             * Sets the class name local service.
572             *
573             * @param classNameLocalService the class name local service
574             */
575            public void setClassNameLocalService(
576                    com.liferay.portal.kernel.service.ClassNameLocalService classNameLocalService) {
577                    this.classNameLocalService = classNameLocalService;
578            }
579    
580            /**
581             * Returns the class name persistence.
582             *
583             * @return the class name persistence
584             */
585            public ClassNamePersistence getClassNamePersistence() {
586                    return classNamePersistence;
587            }
588    
589            /**
590             * Sets the class name persistence.
591             *
592             * @param classNamePersistence the class name persistence
593             */
594            public void setClassNamePersistence(
595                    ClassNamePersistence classNamePersistence) {
596                    this.classNamePersistence = classNamePersistence;
597            }
598    
599            /**
600             * Returns the resource local service.
601             *
602             * @return the resource local service
603             */
604            public com.liferay.portal.kernel.service.ResourceLocalService getResourceLocalService() {
605                    return resourceLocalService;
606            }
607    
608            /**
609             * Sets the resource local service.
610             *
611             * @param resourceLocalService the resource local service
612             */
613            public void setResourceLocalService(
614                    com.liferay.portal.kernel.service.ResourceLocalService resourceLocalService) {
615                    this.resourceLocalService = resourceLocalService;
616            }
617    
618            /**
619             * Returns the user local service.
620             *
621             * @return the user local service
622             */
623            public com.liferay.portal.kernel.service.UserLocalService getUserLocalService() {
624                    return userLocalService;
625            }
626    
627            /**
628             * Sets the user local service.
629             *
630             * @param userLocalService the user local service
631             */
632            public void setUserLocalService(
633                    com.liferay.portal.kernel.service.UserLocalService userLocalService) {
634                    this.userLocalService = userLocalService;
635            }
636    
637            /**
638             * Returns the user persistence.
639             *
640             * @return the user persistence
641             */
642            public UserPersistence getUserPersistence() {
643                    return userPersistence;
644            }
645    
646            /**
647             * Sets the user persistence.
648             *
649             * @param userPersistence the user persistence
650             */
651            public void setUserPersistence(UserPersistence userPersistence) {
652                    this.userPersistence = userPersistence;
653            }
654    
655            /**
656             * Returns the user finder.
657             *
658             * @return the user finder
659             */
660            public UserFinder getUserFinder() {
661                    return userFinder;
662            }
663    
664            /**
665             * Sets the user finder.
666             *
667             * @param userFinder the user finder
668             */
669            public void setUserFinder(UserFinder userFinder) {
670                    this.userFinder = userFinder;
671            }
672    
673            /**
674             * Returns the asset entry local service.
675             *
676             * @return the asset entry local service
677             */
678            public com.liferay.asset.kernel.service.AssetEntryLocalService getAssetEntryLocalService() {
679                    return assetEntryLocalService;
680            }
681    
682            /**
683             * Sets the asset entry local service.
684             *
685             * @param assetEntryLocalService the asset entry local service
686             */
687            public void setAssetEntryLocalService(
688                    com.liferay.asset.kernel.service.AssetEntryLocalService assetEntryLocalService) {
689                    this.assetEntryLocalService = assetEntryLocalService;
690            }
691    
692            /**
693             * Returns the asset entry persistence.
694             *
695             * @return the asset entry persistence
696             */
697            public AssetEntryPersistence getAssetEntryPersistence() {
698                    return assetEntryPersistence;
699            }
700    
701            /**
702             * Sets the asset entry persistence.
703             *
704             * @param assetEntryPersistence the asset entry persistence
705             */
706            public void setAssetEntryPersistence(
707                    AssetEntryPersistence assetEntryPersistence) {
708                    this.assetEntryPersistence = assetEntryPersistence;
709            }
710    
711            /**
712             * Returns the asset entry finder.
713             *
714             * @return the asset entry finder
715             */
716            public AssetEntryFinder getAssetEntryFinder() {
717                    return assetEntryFinder;
718            }
719    
720            /**
721             * Sets the asset entry finder.
722             *
723             * @param assetEntryFinder the asset entry finder
724             */
725            public void setAssetEntryFinder(AssetEntryFinder assetEntryFinder) {
726                    this.assetEntryFinder = assetEntryFinder;
727            }
728    
729            /**
730             * Returns the blogs entry local service.
731             *
732             * @return the blogs entry local service
733             */
734            public com.liferay.blogs.kernel.service.BlogsEntryLocalService getBlogsEntryLocalService() {
735                    return blogsEntryLocalService;
736            }
737    
738            /**
739             * Sets the blogs entry local service.
740             *
741             * @param blogsEntryLocalService the blogs entry local service
742             */
743            public void setBlogsEntryLocalService(
744                    com.liferay.blogs.kernel.service.BlogsEntryLocalService blogsEntryLocalService) {
745                    this.blogsEntryLocalService = blogsEntryLocalService;
746            }
747    
748            /**
749             * Returns the blogs entry persistence.
750             *
751             * @return the blogs entry persistence
752             */
753            public BlogsEntryPersistence getBlogsEntryPersistence() {
754                    return blogsEntryPersistence;
755            }
756    
757            /**
758             * Sets the blogs entry persistence.
759             *
760             * @param blogsEntryPersistence the blogs entry persistence
761             */
762            public void setBlogsEntryPersistence(
763                    BlogsEntryPersistence blogsEntryPersistence) {
764                    this.blogsEntryPersistence = blogsEntryPersistence;
765            }
766    
767            /**
768             * Returns the blogs entry finder.
769             *
770             * @return the blogs entry finder
771             */
772            public BlogsEntryFinder getBlogsEntryFinder() {
773                    return blogsEntryFinder;
774            }
775    
776            /**
777             * Sets the blogs entry finder.
778             *
779             * @param blogsEntryFinder the blogs entry finder
780             */
781            public void setBlogsEntryFinder(BlogsEntryFinder blogsEntryFinder) {
782                    this.blogsEntryFinder = blogsEntryFinder;
783            }
784    
785            /**
786             * Returns the blogs stats user local service.
787             *
788             * @return the blogs stats user local service
789             */
790            public com.liferay.blogs.kernel.service.BlogsStatsUserLocalService getBlogsStatsUserLocalService() {
791                    return blogsStatsUserLocalService;
792            }
793    
794            /**
795             * Sets the blogs stats user local service.
796             *
797             * @param blogsStatsUserLocalService the blogs stats user local service
798             */
799            public void setBlogsStatsUserLocalService(
800                    com.liferay.blogs.kernel.service.BlogsStatsUserLocalService blogsStatsUserLocalService) {
801                    this.blogsStatsUserLocalService = blogsStatsUserLocalService;
802            }
803    
804            /**
805             * Returns the blogs stats user persistence.
806             *
807             * @return the blogs stats user persistence
808             */
809            public BlogsStatsUserPersistence getBlogsStatsUserPersistence() {
810                    return blogsStatsUserPersistence;
811            }
812    
813            /**
814             * Sets the blogs stats user persistence.
815             *
816             * @param blogsStatsUserPersistence the blogs stats user persistence
817             */
818            public void setBlogsStatsUserPersistence(
819                    BlogsStatsUserPersistence blogsStatsUserPersistence) {
820                    this.blogsStatsUserPersistence = blogsStatsUserPersistence;
821            }
822    
823            /**
824             * Returns the blogs stats user finder.
825             *
826             * @return the blogs stats user finder
827             */
828            public BlogsStatsUserFinder getBlogsStatsUserFinder() {
829                    return blogsStatsUserFinder;
830            }
831    
832            /**
833             * Sets the blogs stats user finder.
834             *
835             * @param blogsStatsUserFinder the blogs stats user finder
836             */
837            public void setBlogsStatsUserFinder(
838                    BlogsStatsUserFinder blogsStatsUserFinder) {
839                    this.blogsStatsUserFinder = blogsStatsUserFinder;
840            }
841    
842            public void afterPropertiesSet() {
843                    persistedModelLocalServiceRegistry.register("com.liferay.ratings.kernel.model.RatingsEntry",
844                            ratingsEntryLocalService);
845            }
846    
847            public void destroy() {
848                    persistedModelLocalServiceRegistry.unregister(
849                            "com.liferay.ratings.kernel.model.RatingsEntry");
850            }
851    
852            /**
853             * Returns the OSGi service identifier.
854             *
855             * @return the OSGi service identifier
856             */
857            @Override
858            public String getOSGiServiceIdentifier() {
859                    return RatingsEntryLocalService.class.getName();
860            }
861    
862            protected Class<?> getModelClass() {
863                    return RatingsEntry.class;
864            }
865    
866            protected String getModelClassName() {
867                    return RatingsEntry.class.getName();
868            }
869    
870            /**
871             * Performs a SQL query.
872             *
873             * @param sql the sql query
874             */
875            protected void runSQL(String sql) {
876                    try {
877                            DataSource dataSource = ratingsEntryPersistence.getDataSource();
878    
879                            DB db = DBManagerUtil.getDB();
880    
881                            sql = db.buildSQL(sql);
882                            sql = PortalUtil.transformSQL(sql);
883    
884                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
885                                            sql);
886    
887                            sqlUpdate.update();
888                    }
889                    catch (Exception e) {
890                            throw new SystemException(e);
891                    }
892            }
893    
894            @BeanReference(type = RatingsEntryLocalService.class)
895            protected RatingsEntryLocalService ratingsEntryLocalService;
896            @BeanReference(type = RatingsEntryPersistence.class)
897            protected RatingsEntryPersistence ratingsEntryPersistence;
898            @BeanReference(type = RatingsEntryFinder.class)
899            protected RatingsEntryFinder ratingsEntryFinder;
900            @BeanReference(type = com.liferay.ratings.kernel.service.RatingsStatsLocalService.class)
901            protected com.liferay.ratings.kernel.service.RatingsStatsLocalService ratingsStatsLocalService;
902            @BeanReference(type = RatingsStatsPersistence.class)
903            protected RatingsStatsPersistence ratingsStatsPersistence;
904            @BeanReference(type = RatingsStatsFinder.class)
905            protected RatingsStatsFinder ratingsStatsFinder;
906            @BeanReference(type = com.liferay.counter.kernel.service.CounterLocalService.class)
907            protected com.liferay.counter.kernel.service.CounterLocalService counterLocalService;
908            @BeanReference(type = com.liferay.portal.kernel.service.ClassNameLocalService.class)
909            protected com.liferay.portal.kernel.service.ClassNameLocalService classNameLocalService;
910            @BeanReference(type = ClassNamePersistence.class)
911            protected ClassNamePersistence classNamePersistence;
912            @BeanReference(type = com.liferay.portal.kernel.service.ResourceLocalService.class)
913            protected com.liferay.portal.kernel.service.ResourceLocalService resourceLocalService;
914            @BeanReference(type = com.liferay.portal.kernel.service.UserLocalService.class)
915            protected com.liferay.portal.kernel.service.UserLocalService userLocalService;
916            @BeanReference(type = UserPersistence.class)
917            protected UserPersistence userPersistence;
918            @BeanReference(type = UserFinder.class)
919            protected UserFinder userFinder;
920            @BeanReference(type = com.liferay.asset.kernel.service.AssetEntryLocalService.class)
921            protected com.liferay.asset.kernel.service.AssetEntryLocalService assetEntryLocalService;
922            @BeanReference(type = AssetEntryPersistence.class)
923            protected AssetEntryPersistence assetEntryPersistence;
924            @BeanReference(type = AssetEntryFinder.class)
925            protected AssetEntryFinder assetEntryFinder;
926            @BeanReference(type = com.liferay.blogs.kernel.service.BlogsEntryLocalService.class)
927            protected com.liferay.blogs.kernel.service.BlogsEntryLocalService blogsEntryLocalService;
928            @BeanReference(type = BlogsEntryPersistence.class)
929            protected BlogsEntryPersistence blogsEntryPersistence;
930            @BeanReference(type = BlogsEntryFinder.class)
931            protected BlogsEntryFinder blogsEntryFinder;
932            @BeanReference(type = com.liferay.blogs.kernel.service.BlogsStatsUserLocalService.class)
933            protected com.liferay.blogs.kernel.service.BlogsStatsUserLocalService blogsStatsUserLocalService;
934            @BeanReference(type = BlogsStatsUserPersistence.class)
935            protected BlogsStatsUserPersistence blogsStatsUserPersistence;
936            @BeanReference(type = BlogsStatsUserFinder.class)
937            protected BlogsStatsUserFinder blogsStatsUserFinder;
938            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
939            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
940    }