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