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