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.portal.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.Projection;
030    import com.liferay.portal.kernel.exception.PortalException;
031    import com.liferay.portal.kernel.exception.SystemException;
032    import com.liferay.portal.kernel.search.Indexable;
033    import com.liferay.portal.kernel.search.IndexableType;
034    import com.liferay.portal.kernel.util.OrderByComparator;
035    import com.liferay.portal.model.PersistedModel;
036    import com.liferay.portal.model.Subscription;
037    import com.liferay.portal.service.BaseLocalServiceImpl;
038    import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
039    import com.liferay.portal.service.SubscriptionLocalService;
040    import com.liferay.portal.service.persistence.ClassNamePersistence;
041    import com.liferay.portal.service.persistence.SubscriptionPersistence;
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.messageboards.service.persistence.MBThreadFinder;
049    import com.liferay.portlet.messageboards.service.persistence.MBThreadPersistence;
050    import com.liferay.portlet.social.service.persistence.SocialActivityFinder;
051    import com.liferay.portlet.social.service.persistence.SocialActivityPersistence;
052    
053    import java.io.Serializable;
054    
055    import java.util.List;
056    
057    import javax.sql.DataSource;
058    
059    /**
060     * Provides the base implementation for the subscription local service.
061     *
062     * <p>
063     * 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.portal.service.impl.SubscriptionLocalServiceImpl}.
064     * </p>
065     *
066     * @author Brian Wing Shun Chan
067     * @see com.liferay.portal.service.impl.SubscriptionLocalServiceImpl
068     * @see com.liferay.portal.service.SubscriptionLocalServiceUtil
069     * @generated
070     */
071    @ProviderType
072    public abstract class SubscriptionLocalServiceBaseImpl
073            extends BaseLocalServiceImpl implements SubscriptionLocalService,
074                    IdentifiableBean {
075            /*
076             * NOTE FOR DEVELOPERS:
077             *
078             * Never modify or reference this class directly. Always use {@link com.liferay.portal.service.SubscriptionLocalServiceUtil} to access the subscription local service.
079             */
080    
081            /**
082             * Adds the subscription to the database. Also notifies the appropriate model listeners.
083             *
084             * @param subscription the subscription
085             * @return the subscription that was added
086             */
087            @Indexable(type = IndexableType.REINDEX)
088            @Override
089            public Subscription addSubscription(Subscription subscription) {
090                    subscription.setNew(true);
091    
092                    return subscriptionPersistence.update(subscription);
093            }
094    
095            /**
096             * Creates a new subscription with the primary key. Does not add the subscription to the database.
097             *
098             * @param subscriptionId the primary key for the new subscription
099             * @return the new subscription
100             */
101            @Override
102            public Subscription createSubscription(long subscriptionId) {
103                    return subscriptionPersistence.create(subscriptionId);
104            }
105    
106            /**
107             * Deletes the subscription with the primary key from the database. Also notifies the appropriate model listeners.
108             *
109             * @param subscriptionId the primary key of the subscription
110             * @return the subscription that was removed
111             * @throws PortalException if a subscription with the primary key could not be found
112             */
113            @Indexable(type = IndexableType.DELETE)
114            @Override
115            public Subscription deleteSubscription(long subscriptionId)
116                    throws PortalException {
117                    return subscriptionPersistence.remove(subscriptionId);
118            }
119    
120            /**
121             * Deletes the subscription from the database. Also notifies the appropriate model listeners.
122             *
123             * @param subscription the subscription
124             * @return the subscription that was removed
125             * @throws PortalException
126             */
127            @Indexable(type = IndexableType.DELETE)
128            @Override
129            public Subscription deleteSubscription(Subscription subscription)
130                    throws PortalException {
131                    return subscriptionPersistence.remove(subscription);
132            }
133    
134            @Override
135            public DynamicQuery dynamicQuery() {
136                    Class<?> clazz = getClass();
137    
138                    return DynamicQueryFactoryUtil.forClass(Subscription.class,
139                            clazz.getClassLoader());
140            }
141    
142            /**
143             * Performs a dynamic query on the database and returns the matching rows.
144             *
145             * @param dynamicQuery the dynamic query
146             * @return the matching rows
147             */
148            @Override
149            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
150                    return subscriptionPersistence.findWithDynamicQuery(dynamicQuery);
151            }
152    
153            /**
154             * Performs a dynamic query on the database and returns a range of the matching rows.
155             *
156             * <p>
157             * 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.portal.model.impl.SubscriptionModelImpl}. 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.
158             * </p>
159             *
160             * @param dynamicQuery the dynamic query
161             * @param start the lower bound of the range of model instances
162             * @param end the upper bound of the range of model instances (not inclusive)
163             * @return the range of matching rows
164             */
165            @Override
166            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
167                    int end) {
168                    return subscriptionPersistence.findWithDynamicQuery(dynamicQuery,
169                            start, end);
170            }
171    
172            /**
173             * Performs a dynamic query on the database and returns an ordered range of the matching rows.
174             *
175             * <p>
176             * 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.portal.model.impl.SubscriptionModelImpl}. 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.
177             * </p>
178             *
179             * @param dynamicQuery the dynamic query
180             * @param start the lower bound of the range of model instances
181             * @param end the upper bound of the range of model instances (not inclusive)
182             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
183             * @return the ordered range of matching rows
184             */
185            @Override
186            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
187                    int end, OrderByComparator<T> orderByComparator) {
188                    return subscriptionPersistence.findWithDynamicQuery(dynamicQuery,
189                            start, end, orderByComparator);
190            }
191    
192            /**
193             * Returns the number of rows matching the dynamic query.
194             *
195             * @param dynamicQuery the dynamic query
196             * @return the number of rows matching the dynamic query
197             */
198            @Override
199            public long dynamicQueryCount(DynamicQuery dynamicQuery) {
200                    return subscriptionPersistence.countWithDynamicQuery(dynamicQuery);
201            }
202    
203            /**
204             * Returns the number of rows matching the dynamic query.
205             *
206             * @param dynamicQuery the dynamic query
207             * @param projection the projection to apply to the query
208             * @return the number of rows matching the dynamic query
209             */
210            @Override
211            public long dynamicQueryCount(DynamicQuery dynamicQuery,
212                    Projection projection) {
213                    return subscriptionPersistence.countWithDynamicQuery(dynamicQuery,
214                            projection);
215            }
216    
217            @Override
218            public Subscription fetchSubscription(long subscriptionId) {
219                    return subscriptionPersistence.fetchByPrimaryKey(subscriptionId);
220            }
221    
222            /**
223             * Returns the subscription with the primary key.
224             *
225             * @param subscriptionId the primary key of the subscription
226             * @return the subscription
227             * @throws PortalException if a subscription with the primary key could not be found
228             */
229            @Override
230            public Subscription getSubscription(long subscriptionId)
231                    throws PortalException {
232                    return subscriptionPersistence.findByPrimaryKey(subscriptionId);
233            }
234    
235            @Override
236            public ActionableDynamicQuery getActionableDynamicQuery() {
237                    ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
238    
239                    actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.SubscriptionLocalServiceUtil.getService());
240                    actionableDynamicQuery.setClass(Subscription.class);
241                    actionableDynamicQuery.setClassLoader(getClassLoader());
242    
243                    actionableDynamicQuery.setPrimaryKeyPropertyName("subscriptionId");
244    
245                    return actionableDynamicQuery;
246            }
247    
248            protected void initActionableDynamicQuery(
249                    ActionableDynamicQuery actionableDynamicQuery) {
250                    actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.SubscriptionLocalServiceUtil.getService());
251                    actionableDynamicQuery.setClass(Subscription.class);
252                    actionableDynamicQuery.setClassLoader(getClassLoader());
253    
254                    actionableDynamicQuery.setPrimaryKeyPropertyName("subscriptionId");
255            }
256    
257            /**
258             * @throws PortalException
259             */
260            @Override
261            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
262                    throws PortalException {
263                    return subscriptionLocalService.deleteSubscription((Subscription)persistedModel);
264            }
265    
266            @Override
267            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
268                    throws PortalException {
269                    return subscriptionPersistence.findByPrimaryKey(primaryKeyObj);
270            }
271    
272            /**
273             * Returns a range of all the subscriptions.
274             *
275             * <p>
276             * 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.portal.model.impl.SubscriptionModelImpl}. 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.
277             * </p>
278             *
279             * @param start the lower bound of the range of subscriptions
280             * @param end the upper bound of the range of subscriptions (not inclusive)
281             * @return the range of subscriptions
282             */
283            @Override
284            public List<Subscription> getSubscriptions(int start, int end) {
285                    return subscriptionPersistence.findAll(start, end);
286            }
287    
288            /**
289             * Returns the number of subscriptions.
290             *
291             * @return the number of subscriptions
292             */
293            @Override
294            public int getSubscriptionsCount() {
295                    return subscriptionPersistence.countAll();
296            }
297    
298            /**
299             * Updates the subscription in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
300             *
301             * @param subscription the subscription
302             * @return the subscription that was updated
303             */
304            @Indexable(type = IndexableType.REINDEX)
305            @Override
306            public Subscription updateSubscription(Subscription subscription) {
307                    return subscriptionPersistence.update(subscription);
308            }
309    
310            /**
311             * Returns the subscription local service.
312             *
313             * @return the subscription local service
314             */
315            public com.liferay.portal.service.SubscriptionLocalService getSubscriptionLocalService() {
316                    return subscriptionLocalService;
317            }
318    
319            /**
320             * Sets the subscription local service.
321             *
322             * @param subscriptionLocalService the subscription local service
323             */
324            public void setSubscriptionLocalService(
325                    com.liferay.portal.service.SubscriptionLocalService subscriptionLocalService) {
326                    this.subscriptionLocalService = subscriptionLocalService;
327            }
328    
329            /**
330             * Returns the subscription persistence.
331             *
332             * @return the subscription persistence
333             */
334            public SubscriptionPersistence getSubscriptionPersistence() {
335                    return subscriptionPersistence;
336            }
337    
338            /**
339             * Sets the subscription persistence.
340             *
341             * @param subscriptionPersistence the subscription persistence
342             */
343            public void setSubscriptionPersistence(
344                    SubscriptionPersistence subscriptionPersistence) {
345                    this.subscriptionPersistence = subscriptionPersistence;
346            }
347    
348            /**
349             * Returns the counter local service.
350             *
351             * @return the counter local service
352             */
353            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
354                    return counterLocalService;
355            }
356    
357            /**
358             * Sets the counter local service.
359             *
360             * @param counterLocalService the counter local service
361             */
362            public void setCounterLocalService(
363                    com.liferay.counter.service.CounterLocalService counterLocalService) {
364                    this.counterLocalService = counterLocalService;
365            }
366    
367            /**
368             * Returns the class name local service.
369             *
370             * @return the class name local service
371             */
372            public com.liferay.portal.service.ClassNameLocalService getClassNameLocalService() {
373                    return classNameLocalService;
374            }
375    
376            /**
377             * Sets the class name local service.
378             *
379             * @param classNameLocalService the class name local service
380             */
381            public void setClassNameLocalService(
382                    com.liferay.portal.service.ClassNameLocalService classNameLocalService) {
383                    this.classNameLocalService = classNameLocalService;
384            }
385    
386            /**
387             * Returns the class name remote service.
388             *
389             * @return the class name remote service
390             */
391            public com.liferay.portal.service.ClassNameService getClassNameService() {
392                    return classNameService;
393            }
394    
395            /**
396             * Sets the class name remote service.
397             *
398             * @param classNameService the class name remote service
399             */
400            public void setClassNameService(
401                    com.liferay.portal.service.ClassNameService classNameService) {
402                    this.classNameService = classNameService;
403            }
404    
405            /**
406             * Returns the class name persistence.
407             *
408             * @return the class name persistence
409             */
410            public ClassNamePersistence getClassNamePersistence() {
411                    return classNamePersistence;
412            }
413    
414            /**
415             * Sets the class name persistence.
416             *
417             * @param classNamePersistence the class name persistence
418             */
419            public void setClassNamePersistence(
420                    ClassNamePersistence classNamePersistence) {
421                    this.classNamePersistence = classNamePersistence;
422            }
423    
424            /**
425             * Returns the asset entry local service.
426             *
427             * @return the asset entry local service
428             */
429            public com.liferay.portlet.asset.service.AssetEntryLocalService getAssetEntryLocalService() {
430                    return assetEntryLocalService;
431            }
432    
433            /**
434             * Sets the asset entry local service.
435             *
436             * @param assetEntryLocalService the asset entry local service
437             */
438            public void setAssetEntryLocalService(
439                    com.liferay.portlet.asset.service.AssetEntryLocalService assetEntryLocalService) {
440                    this.assetEntryLocalService = assetEntryLocalService;
441            }
442    
443            /**
444             * Returns the asset entry remote service.
445             *
446             * @return the asset entry remote service
447             */
448            public com.liferay.portlet.asset.service.AssetEntryService getAssetEntryService() {
449                    return assetEntryService;
450            }
451    
452            /**
453             * Sets the asset entry remote service.
454             *
455             * @param assetEntryService the asset entry remote service
456             */
457            public void setAssetEntryService(
458                    com.liferay.portlet.asset.service.AssetEntryService assetEntryService) {
459                    this.assetEntryService = assetEntryService;
460            }
461    
462            /**
463             * Returns the asset entry persistence.
464             *
465             * @return the asset entry persistence
466             */
467            public AssetEntryPersistence getAssetEntryPersistence() {
468                    return assetEntryPersistence;
469            }
470    
471            /**
472             * Sets the asset entry persistence.
473             *
474             * @param assetEntryPersistence the asset entry persistence
475             */
476            public void setAssetEntryPersistence(
477                    AssetEntryPersistence assetEntryPersistence) {
478                    this.assetEntryPersistence = assetEntryPersistence;
479            }
480    
481            /**
482             * Returns the asset entry finder.
483             *
484             * @return the asset entry finder
485             */
486            public AssetEntryFinder getAssetEntryFinder() {
487                    return assetEntryFinder;
488            }
489    
490            /**
491             * Sets the asset entry finder.
492             *
493             * @param assetEntryFinder the asset entry finder
494             */
495            public void setAssetEntryFinder(AssetEntryFinder assetEntryFinder) {
496                    this.assetEntryFinder = assetEntryFinder;
497            }
498    
499            /**
500             * Returns the message boards thread local service.
501             *
502             * @return the message boards thread local service
503             */
504            public com.liferay.portlet.messageboards.service.MBThreadLocalService getMBThreadLocalService() {
505                    return mbThreadLocalService;
506            }
507    
508            /**
509             * Sets the message boards thread local service.
510             *
511             * @param mbThreadLocalService the message boards thread local service
512             */
513            public void setMBThreadLocalService(
514                    com.liferay.portlet.messageboards.service.MBThreadLocalService mbThreadLocalService) {
515                    this.mbThreadLocalService = mbThreadLocalService;
516            }
517    
518            /**
519             * Returns the message boards thread remote service.
520             *
521             * @return the message boards thread remote service
522             */
523            public com.liferay.portlet.messageboards.service.MBThreadService getMBThreadService() {
524                    return mbThreadService;
525            }
526    
527            /**
528             * Sets the message boards thread remote service.
529             *
530             * @param mbThreadService the message boards thread remote service
531             */
532            public void setMBThreadService(
533                    com.liferay.portlet.messageboards.service.MBThreadService mbThreadService) {
534                    this.mbThreadService = mbThreadService;
535            }
536    
537            /**
538             * Returns the message boards thread persistence.
539             *
540             * @return the message boards thread persistence
541             */
542            public MBThreadPersistence getMBThreadPersistence() {
543                    return mbThreadPersistence;
544            }
545    
546            /**
547             * Sets the message boards thread persistence.
548             *
549             * @param mbThreadPersistence the message boards thread persistence
550             */
551            public void setMBThreadPersistence(MBThreadPersistence mbThreadPersistence) {
552                    this.mbThreadPersistence = mbThreadPersistence;
553            }
554    
555            /**
556             * Returns the message boards thread finder.
557             *
558             * @return the message boards thread finder
559             */
560            public MBThreadFinder getMBThreadFinder() {
561                    return mbThreadFinder;
562            }
563    
564            /**
565             * Sets the message boards thread finder.
566             *
567             * @param mbThreadFinder the message boards thread finder
568             */
569            public void setMBThreadFinder(MBThreadFinder mbThreadFinder) {
570                    this.mbThreadFinder = mbThreadFinder;
571            }
572    
573            /**
574             * Returns the social activity local service.
575             *
576             * @return the social activity local service
577             */
578            public com.liferay.portlet.social.service.SocialActivityLocalService getSocialActivityLocalService() {
579                    return socialActivityLocalService;
580            }
581    
582            /**
583             * Sets the social activity local service.
584             *
585             * @param socialActivityLocalService the social activity local service
586             */
587            public void setSocialActivityLocalService(
588                    com.liferay.portlet.social.service.SocialActivityLocalService socialActivityLocalService) {
589                    this.socialActivityLocalService = socialActivityLocalService;
590            }
591    
592            /**
593             * Returns the social activity remote service.
594             *
595             * @return the social activity remote service
596             */
597            public com.liferay.portlet.social.service.SocialActivityService getSocialActivityService() {
598                    return socialActivityService;
599            }
600    
601            /**
602             * Sets the social activity remote service.
603             *
604             * @param socialActivityService the social activity remote service
605             */
606            public void setSocialActivityService(
607                    com.liferay.portlet.social.service.SocialActivityService socialActivityService) {
608                    this.socialActivityService = socialActivityService;
609            }
610    
611            /**
612             * Returns the social activity persistence.
613             *
614             * @return the social activity persistence
615             */
616            public SocialActivityPersistence getSocialActivityPersistence() {
617                    return socialActivityPersistence;
618            }
619    
620            /**
621             * Sets the social activity persistence.
622             *
623             * @param socialActivityPersistence the social activity persistence
624             */
625            public void setSocialActivityPersistence(
626                    SocialActivityPersistence socialActivityPersistence) {
627                    this.socialActivityPersistence = socialActivityPersistence;
628            }
629    
630            /**
631             * Returns the social activity finder.
632             *
633             * @return the social activity finder
634             */
635            public SocialActivityFinder getSocialActivityFinder() {
636                    return socialActivityFinder;
637            }
638    
639            /**
640             * Sets the social activity finder.
641             *
642             * @param socialActivityFinder the social activity finder
643             */
644            public void setSocialActivityFinder(
645                    SocialActivityFinder socialActivityFinder) {
646                    this.socialActivityFinder = socialActivityFinder;
647            }
648    
649            /**
650             * Returns the user local service.
651             *
652             * @return the user local service
653             */
654            public com.liferay.portal.service.UserLocalService getUserLocalService() {
655                    return userLocalService;
656            }
657    
658            /**
659             * Sets the user local service.
660             *
661             * @param userLocalService the user local service
662             */
663            public void setUserLocalService(
664                    com.liferay.portal.service.UserLocalService userLocalService) {
665                    this.userLocalService = userLocalService;
666            }
667    
668            /**
669             * Returns the user remote service.
670             *
671             * @return the user remote service
672             */
673            public com.liferay.portal.service.UserService getUserService() {
674                    return userService;
675            }
676    
677            /**
678             * Sets the user remote service.
679             *
680             * @param userService the user remote service
681             */
682            public void setUserService(
683                    com.liferay.portal.service.UserService userService) {
684                    this.userService = userService;
685            }
686    
687            /**
688             * Returns the user persistence.
689             *
690             * @return the user persistence
691             */
692            public UserPersistence getUserPersistence() {
693                    return userPersistence;
694            }
695    
696            /**
697             * Sets the user persistence.
698             *
699             * @param userPersistence the user persistence
700             */
701            public void setUserPersistence(UserPersistence userPersistence) {
702                    this.userPersistence = userPersistence;
703            }
704    
705            /**
706             * Returns the user finder.
707             *
708             * @return the user finder
709             */
710            public UserFinder getUserFinder() {
711                    return userFinder;
712            }
713    
714            /**
715             * Sets the user finder.
716             *
717             * @param userFinder the user finder
718             */
719            public void setUserFinder(UserFinder userFinder) {
720                    this.userFinder = userFinder;
721            }
722    
723            public void afterPropertiesSet() {
724                    persistedModelLocalServiceRegistry.register("com.liferay.portal.model.Subscription",
725                            subscriptionLocalService);
726            }
727    
728            public void destroy() {
729                    persistedModelLocalServiceRegistry.unregister(
730                            "com.liferay.portal.model.Subscription");
731            }
732    
733            /**
734             * Returns the Spring bean ID for this bean.
735             *
736             * @return the Spring bean ID for this bean
737             */
738            @Override
739            public String getBeanIdentifier() {
740                    return _beanIdentifier;
741            }
742    
743            /**
744             * Sets the Spring bean ID for this bean.
745             *
746             * @param beanIdentifier the Spring bean ID for this bean
747             */
748            @Override
749            public void setBeanIdentifier(String beanIdentifier) {
750                    _beanIdentifier = beanIdentifier;
751            }
752    
753            protected Class<?> getModelClass() {
754                    return Subscription.class;
755            }
756    
757            protected String getModelClassName() {
758                    return Subscription.class.getName();
759            }
760    
761            /**
762             * Performs a SQL query.
763             *
764             * @param sql the sql query
765             */
766            protected void runSQL(String sql) {
767                    try {
768                            DataSource dataSource = subscriptionPersistence.getDataSource();
769    
770                            DB db = DBFactoryUtil.getDB();
771    
772                            sql = db.buildSQL(sql);
773                            sql = PortalUtil.transformSQL(sql);
774    
775                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
776                                            sql, new int[0]);
777    
778                            sqlUpdate.update();
779                    }
780                    catch (Exception e) {
781                            throw new SystemException(e);
782                    }
783            }
784    
785            @BeanReference(type = com.liferay.portal.service.SubscriptionLocalService.class)
786            protected com.liferay.portal.service.SubscriptionLocalService subscriptionLocalService;
787            @BeanReference(type = SubscriptionPersistence.class)
788            protected SubscriptionPersistence subscriptionPersistence;
789            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
790            protected com.liferay.counter.service.CounterLocalService counterLocalService;
791            @BeanReference(type = com.liferay.portal.service.ClassNameLocalService.class)
792            protected com.liferay.portal.service.ClassNameLocalService classNameLocalService;
793            @BeanReference(type = com.liferay.portal.service.ClassNameService.class)
794            protected com.liferay.portal.service.ClassNameService classNameService;
795            @BeanReference(type = ClassNamePersistence.class)
796            protected ClassNamePersistence classNamePersistence;
797            @BeanReference(type = com.liferay.portlet.asset.service.AssetEntryLocalService.class)
798            protected com.liferay.portlet.asset.service.AssetEntryLocalService assetEntryLocalService;
799            @BeanReference(type = com.liferay.portlet.asset.service.AssetEntryService.class)
800            protected com.liferay.portlet.asset.service.AssetEntryService assetEntryService;
801            @BeanReference(type = AssetEntryPersistence.class)
802            protected AssetEntryPersistence assetEntryPersistence;
803            @BeanReference(type = AssetEntryFinder.class)
804            protected AssetEntryFinder assetEntryFinder;
805            @BeanReference(type = com.liferay.portlet.messageboards.service.MBThreadLocalService.class)
806            protected com.liferay.portlet.messageboards.service.MBThreadLocalService mbThreadLocalService;
807            @BeanReference(type = com.liferay.portlet.messageboards.service.MBThreadService.class)
808            protected com.liferay.portlet.messageboards.service.MBThreadService mbThreadService;
809            @BeanReference(type = MBThreadPersistence.class)
810            protected MBThreadPersistence mbThreadPersistence;
811            @BeanReference(type = MBThreadFinder.class)
812            protected MBThreadFinder mbThreadFinder;
813            @BeanReference(type = com.liferay.portlet.social.service.SocialActivityLocalService.class)
814            protected com.liferay.portlet.social.service.SocialActivityLocalService socialActivityLocalService;
815            @BeanReference(type = com.liferay.portlet.social.service.SocialActivityService.class)
816            protected com.liferay.portlet.social.service.SocialActivityService socialActivityService;
817            @BeanReference(type = SocialActivityPersistence.class)
818            protected SocialActivityPersistence socialActivityPersistence;
819            @BeanReference(type = SocialActivityFinder.class)
820            protected SocialActivityFinder socialActivityFinder;
821            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
822            protected com.liferay.portal.service.UserLocalService userLocalService;
823            @BeanReference(type = com.liferay.portal.service.UserService.class)
824            protected com.liferay.portal.service.UserService userService;
825            @BeanReference(type = UserPersistence.class)
826            protected UserPersistence userPersistence;
827            @BeanReference(type = UserFinder.class)
828            protected UserFinder userFinder;
829            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
830            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
831            private String _beanIdentifier;
832    }