001    /**
002     * Copyright (c) 2000-2012 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.mobiledevicerules.service.base;
016    
017    import com.liferay.counter.service.CounterLocalService;
018    
019    import com.liferay.portal.kernel.bean.BeanReference;
020    import com.liferay.portal.kernel.bean.IdentifiableBean;
021    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
022    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
023    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
024    import com.liferay.portal.kernel.exception.PortalException;
025    import com.liferay.portal.kernel.exception.SystemException;
026    import com.liferay.portal.kernel.log.Log;
027    import com.liferay.portal.kernel.log.LogFactoryUtil;
028    import com.liferay.portal.kernel.search.Indexer;
029    import com.liferay.portal.kernel.search.IndexerRegistryUtil;
030    import com.liferay.portal.kernel.search.SearchException;
031    import com.liferay.portal.kernel.util.OrderByComparator;
032    import com.liferay.portal.model.PersistedModel;
033    import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
034    import com.liferay.portal.service.ResourceLocalService;
035    import com.liferay.portal.service.ResourceService;
036    import com.liferay.portal.service.UserLocalService;
037    import com.liferay.portal.service.UserService;
038    import com.liferay.portal.service.persistence.ResourceFinder;
039    import com.liferay.portal.service.persistence.ResourcePersistence;
040    import com.liferay.portal.service.persistence.UserFinder;
041    import com.liferay.portal.service.persistence.UserPersistence;
042    
043    import com.liferay.portlet.mobiledevicerules.model.MDRRule;
044    import com.liferay.portlet.mobiledevicerules.service.MDRActionLocalService;
045    import com.liferay.portlet.mobiledevicerules.service.MDRActionService;
046    import com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceLocalService;
047    import com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceService;
048    import com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalService;
049    import com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupService;
050    import com.liferay.portlet.mobiledevicerules.service.MDRRuleLocalService;
051    import com.liferay.portlet.mobiledevicerules.service.MDRRuleService;
052    import com.liferay.portlet.mobiledevicerules.service.persistence.MDRActionPersistence;
053    import com.liferay.portlet.mobiledevicerules.service.persistence.MDRRuleGroupFinder;
054    import com.liferay.portlet.mobiledevicerules.service.persistence.MDRRuleGroupInstancePersistence;
055    import com.liferay.portlet.mobiledevicerules.service.persistence.MDRRuleGroupPersistence;
056    import com.liferay.portlet.mobiledevicerules.service.persistence.MDRRulePersistence;
057    
058    import java.io.Serializable;
059    
060    import java.util.List;
061    
062    import javax.sql.DataSource;
063    
064    /**
065     * The base implementation of the m d r rule local service.
066     *
067     * <p>
068     * 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.mobiledevicerules.service.impl.MDRRuleLocalServiceImpl}.
069     * </p>
070     *
071     * @author Edward C. Han
072     * @see com.liferay.portlet.mobiledevicerules.service.impl.MDRRuleLocalServiceImpl
073     * @see com.liferay.portlet.mobiledevicerules.service.MDRRuleLocalServiceUtil
074     * @generated
075     */
076    public abstract class MDRRuleLocalServiceBaseImpl implements MDRRuleLocalService,
077            IdentifiableBean {
078            /*
079             * NOTE FOR DEVELOPERS:
080             *
081             * Never modify or reference this class directly. Always use {@link com.liferay.portlet.mobiledevicerules.service.MDRRuleLocalServiceUtil} to access the m d r rule local service.
082             */
083    
084            /**
085             * Adds the m d r rule to the database. Also notifies the appropriate model listeners.
086             *
087             * @param mdrRule the m d r rule
088             * @return the m d r rule that was added
089             * @throws SystemException if a system exception occurred
090             */
091            public MDRRule addMDRRule(MDRRule mdrRule) throws SystemException {
092                    mdrRule.setNew(true);
093    
094                    mdrRule = mdrRulePersistence.update(mdrRule, false);
095    
096                    Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
097    
098                    if (indexer != null) {
099                            try {
100                                    indexer.reindex(mdrRule);
101                            }
102                            catch (SearchException se) {
103                                    if (_log.isWarnEnabled()) {
104                                            _log.warn(se, se);
105                                    }
106                            }
107                    }
108    
109                    return mdrRule;
110            }
111    
112            /**
113             * Creates a new m d r rule with the primary key. Does not add the m d r rule to the database.
114             *
115             * @param ruleId the primary key for the new m d r rule
116             * @return the new m d r rule
117             */
118            public MDRRule createMDRRule(long ruleId) {
119                    return mdrRulePersistence.create(ruleId);
120            }
121    
122            /**
123             * Deletes the m d r rule with the primary key from the database. Also notifies the appropriate model listeners.
124             *
125             * @param ruleId the primary key of the m d r rule
126             * @throws PortalException if a m d r rule with the primary key could not be found
127             * @throws SystemException if a system exception occurred
128             */
129            public void deleteMDRRule(long ruleId)
130                    throws PortalException, SystemException {
131                    MDRRule mdrRule = mdrRulePersistence.remove(ruleId);
132    
133                    Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
134    
135                    if (indexer != null) {
136                            try {
137                                    indexer.delete(mdrRule);
138                            }
139                            catch (SearchException se) {
140                                    if (_log.isWarnEnabled()) {
141                                            _log.warn(se, se);
142                                    }
143                            }
144                    }
145            }
146    
147            /**
148             * Deletes the m d r rule from the database. Also notifies the appropriate model listeners.
149             *
150             * @param mdrRule the m d r rule
151             * @throws SystemException if a system exception occurred
152             */
153            public void deleteMDRRule(MDRRule mdrRule) throws SystemException {
154                    mdrRulePersistence.remove(mdrRule);
155    
156                    Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
157    
158                    if (indexer != null) {
159                            try {
160                                    indexer.delete(mdrRule);
161                            }
162                            catch (SearchException se) {
163                                    if (_log.isWarnEnabled()) {
164                                            _log.warn(se, se);
165                                    }
166                            }
167                    }
168            }
169    
170            /**
171             * Performs a dynamic query on the database and returns the matching rows.
172             *
173             * @param dynamicQuery the dynamic query
174             * @return the matching rows
175             * @throws SystemException if a system exception occurred
176             */
177            @SuppressWarnings("rawtypes")
178            public List dynamicQuery(DynamicQuery dynamicQuery)
179                    throws SystemException {
180                    return mdrRulePersistence.findWithDynamicQuery(dynamicQuery);
181            }
182    
183            /**
184             * Performs a dynamic query on the database and returns a 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.
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             * @return the range of matching rows
194             * @throws SystemException if a system exception occurred
195             */
196            @SuppressWarnings("rawtypes")
197            public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
198                    throws SystemException {
199                    return mdrRulePersistence.findWithDynamicQuery(dynamicQuery, start, end);
200            }
201    
202            /**
203             * Performs a dynamic query on the database and returns an ordered range of the matching rows.
204             *
205             * <p>
206             * 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.
207             * </p>
208             *
209             * @param dynamicQuery the dynamic query
210             * @param start the lower bound of the range of model instances
211             * @param end the upper bound of the range of model instances (not inclusive)
212             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
213             * @return the ordered range of matching rows
214             * @throws SystemException if a system exception occurred
215             */
216            @SuppressWarnings("rawtypes")
217            public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
218                    OrderByComparator orderByComparator) throws SystemException {
219                    return mdrRulePersistence.findWithDynamicQuery(dynamicQuery, start,
220                            end, orderByComparator);
221            }
222    
223            /**
224             * Returns the number of rows that match the dynamic query.
225             *
226             * @param dynamicQuery the dynamic query
227             * @return the number of rows that match the dynamic query
228             * @throws SystemException if a system exception occurred
229             */
230            public long dynamicQueryCount(DynamicQuery dynamicQuery)
231                    throws SystemException {
232                    return mdrRulePersistence.countWithDynamicQuery(dynamicQuery);
233            }
234    
235            public MDRRule fetchMDRRule(long ruleId) throws SystemException {
236                    return mdrRulePersistence.fetchByPrimaryKey(ruleId);
237            }
238    
239            /**
240             * Returns the m d r rule with the primary key.
241             *
242             * @param ruleId the primary key of the m d r rule
243             * @return the m d r rule
244             * @throws PortalException if a m d r rule with the primary key could not be found
245             * @throws SystemException if a system exception occurred
246             */
247            public MDRRule getMDRRule(long ruleId)
248                    throws PortalException, SystemException {
249                    return mdrRulePersistence.findByPrimaryKey(ruleId);
250            }
251    
252            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
253                    throws PortalException, SystemException {
254                    return mdrRulePersistence.findByPrimaryKey(primaryKeyObj);
255            }
256    
257            /**
258             * Returns the m d r rule with the UUID in the group.
259             *
260             * @param uuid the UUID of m d r rule
261             * @param groupId the group id of the m d r rule
262             * @return the m d r rule
263             * @throws PortalException if a m d r rule with the UUID in the group could not be found
264             * @throws SystemException if a system exception occurred
265             */
266            public MDRRule getMDRRuleByUuidAndGroupId(String uuid, long groupId)
267                    throws PortalException, SystemException {
268                    return mdrRulePersistence.findByUUID_G(uuid, groupId);
269            }
270    
271            /**
272             * Returns a range of all the m d r rules.
273             *
274             * <p>
275             * 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.
276             * </p>
277             *
278             * @param start the lower bound of the range of m d r rules
279             * @param end the upper bound of the range of m d r rules (not inclusive)
280             * @return the range of m d r rules
281             * @throws SystemException if a system exception occurred
282             */
283            public List<MDRRule> getMDRRules(int start, int end)
284                    throws SystemException {
285                    return mdrRulePersistence.findAll(start, end);
286            }
287    
288            /**
289             * Returns the number of m d r rules.
290             *
291             * @return the number of m d r rules
292             * @throws SystemException if a system exception occurred
293             */
294            public int getMDRRulesCount() throws SystemException {
295                    return mdrRulePersistence.countAll();
296            }
297    
298            /**
299             * Updates the m d r rule in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
300             *
301             * @param mdrRule the m d r rule
302             * @return the m d r rule that was updated
303             * @throws SystemException if a system exception occurred
304             */
305            public MDRRule updateMDRRule(MDRRule mdrRule) throws SystemException {
306                    return updateMDRRule(mdrRule, true);
307            }
308    
309            /**
310             * Updates the m d r rule in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
311             *
312             * @param mdrRule the m d r rule
313             * @param merge whether to merge the m d r rule with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
314             * @return the m d r rule that was updated
315             * @throws SystemException if a system exception occurred
316             */
317            public MDRRule updateMDRRule(MDRRule mdrRule, boolean merge)
318                    throws SystemException {
319                    mdrRule.setNew(false);
320    
321                    mdrRule = mdrRulePersistence.update(mdrRule, merge);
322    
323                    Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
324    
325                    if (indexer != null) {
326                            try {
327                                    indexer.reindex(mdrRule);
328                            }
329                            catch (SearchException se) {
330                                    if (_log.isWarnEnabled()) {
331                                            _log.warn(se, se);
332                                    }
333                            }
334                    }
335    
336                    return mdrRule;
337            }
338    
339            /**
340             * Returns the m d r action local service.
341             *
342             * @return the m d r action local service
343             */
344            public MDRActionLocalService getMDRActionLocalService() {
345                    return mdrActionLocalService;
346            }
347    
348            /**
349             * Sets the m d r action local service.
350             *
351             * @param mdrActionLocalService the m d r action local service
352             */
353            public void setMDRActionLocalService(
354                    MDRActionLocalService mdrActionLocalService) {
355                    this.mdrActionLocalService = mdrActionLocalService;
356            }
357    
358            /**
359             * Returns the m d r action remote service.
360             *
361             * @return the m d r action remote service
362             */
363            public MDRActionService getMDRActionService() {
364                    return mdrActionService;
365            }
366    
367            /**
368             * Sets the m d r action remote service.
369             *
370             * @param mdrActionService the m d r action remote service
371             */
372            public void setMDRActionService(MDRActionService mdrActionService) {
373                    this.mdrActionService = mdrActionService;
374            }
375    
376            /**
377             * Returns the m d r action persistence.
378             *
379             * @return the m d r action persistence
380             */
381            public MDRActionPersistence getMDRActionPersistence() {
382                    return mdrActionPersistence;
383            }
384    
385            /**
386             * Sets the m d r action persistence.
387             *
388             * @param mdrActionPersistence the m d r action persistence
389             */
390            public void setMDRActionPersistence(
391                    MDRActionPersistence mdrActionPersistence) {
392                    this.mdrActionPersistence = mdrActionPersistence;
393            }
394    
395            /**
396             * Returns the m d r rule local service.
397             *
398             * @return the m d r rule local service
399             */
400            public MDRRuleLocalService getMDRRuleLocalService() {
401                    return mdrRuleLocalService;
402            }
403    
404            /**
405             * Sets the m d r rule local service.
406             *
407             * @param mdrRuleLocalService the m d r rule local service
408             */
409            public void setMDRRuleLocalService(MDRRuleLocalService mdrRuleLocalService) {
410                    this.mdrRuleLocalService = mdrRuleLocalService;
411            }
412    
413            /**
414             * Returns the m d r rule remote service.
415             *
416             * @return the m d r rule remote service
417             */
418            public MDRRuleService getMDRRuleService() {
419                    return mdrRuleService;
420            }
421    
422            /**
423             * Sets the m d r rule remote service.
424             *
425             * @param mdrRuleService the m d r rule remote service
426             */
427            public void setMDRRuleService(MDRRuleService mdrRuleService) {
428                    this.mdrRuleService = mdrRuleService;
429            }
430    
431            /**
432             * Returns the m d r rule persistence.
433             *
434             * @return the m d r rule persistence
435             */
436            public MDRRulePersistence getMDRRulePersistence() {
437                    return mdrRulePersistence;
438            }
439    
440            /**
441             * Sets the m d r rule persistence.
442             *
443             * @param mdrRulePersistence the m d r rule persistence
444             */
445            public void setMDRRulePersistence(MDRRulePersistence mdrRulePersistence) {
446                    this.mdrRulePersistence = mdrRulePersistence;
447            }
448    
449            /**
450             * Returns the m d r rule group local service.
451             *
452             * @return the m d r rule group local service
453             */
454            public MDRRuleGroupLocalService getMDRRuleGroupLocalService() {
455                    return mdrRuleGroupLocalService;
456            }
457    
458            /**
459             * Sets the m d r rule group local service.
460             *
461             * @param mdrRuleGroupLocalService the m d r rule group local service
462             */
463            public void setMDRRuleGroupLocalService(
464                    MDRRuleGroupLocalService mdrRuleGroupLocalService) {
465                    this.mdrRuleGroupLocalService = mdrRuleGroupLocalService;
466            }
467    
468            /**
469             * Returns the m d r rule group remote service.
470             *
471             * @return the m d r rule group remote service
472             */
473            public MDRRuleGroupService getMDRRuleGroupService() {
474                    return mdrRuleGroupService;
475            }
476    
477            /**
478             * Sets the m d r rule group remote service.
479             *
480             * @param mdrRuleGroupService the m d r rule group remote service
481             */
482            public void setMDRRuleGroupService(MDRRuleGroupService mdrRuleGroupService) {
483                    this.mdrRuleGroupService = mdrRuleGroupService;
484            }
485    
486            /**
487             * Returns the m d r rule group persistence.
488             *
489             * @return the m d r rule group persistence
490             */
491            public MDRRuleGroupPersistence getMDRRuleGroupPersistence() {
492                    return mdrRuleGroupPersistence;
493            }
494    
495            /**
496             * Sets the m d r rule group persistence.
497             *
498             * @param mdrRuleGroupPersistence the m d r rule group persistence
499             */
500            public void setMDRRuleGroupPersistence(
501                    MDRRuleGroupPersistence mdrRuleGroupPersistence) {
502                    this.mdrRuleGroupPersistence = mdrRuleGroupPersistence;
503            }
504    
505            /**
506             * Returns the m d r rule group finder.
507             *
508             * @return the m d r rule group finder
509             */
510            public MDRRuleGroupFinder getMDRRuleGroupFinder() {
511                    return mdrRuleGroupFinder;
512            }
513    
514            /**
515             * Sets the m d r rule group finder.
516             *
517             * @param mdrRuleGroupFinder the m d r rule group finder
518             */
519            public void setMDRRuleGroupFinder(MDRRuleGroupFinder mdrRuleGroupFinder) {
520                    this.mdrRuleGroupFinder = mdrRuleGroupFinder;
521            }
522    
523            /**
524             * Returns the m d r rule group instance local service.
525             *
526             * @return the m d r rule group instance local service
527             */
528            public MDRRuleGroupInstanceLocalService getMDRRuleGroupInstanceLocalService() {
529                    return mdrRuleGroupInstanceLocalService;
530            }
531    
532            /**
533             * Sets the m d r rule group instance local service.
534             *
535             * @param mdrRuleGroupInstanceLocalService the m d r rule group instance local service
536             */
537            public void setMDRRuleGroupInstanceLocalService(
538                    MDRRuleGroupInstanceLocalService mdrRuleGroupInstanceLocalService) {
539                    this.mdrRuleGroupInstanceLocalService = mdrRuleGroupInstanceLocalService;
540            }
541    
542            /**
543             * Returns the m d r rule group instance remote service.
544             *
545             * @return the m d r rule group instance remote service
546             */
547            public MDRRuleGroupInstanceService getMDRRuleGroupInstanceService() {
548                    return mdrRuleGroupInstanceService;
549            }
550    
551            /**
552             * Sets the m d r rule group instance remote service.
553             *
554             * @param mdrRuleGroupInstanceService the m d r rule group instance remote service
555             */
556            public void setMDRRuleGroupInstanceService(
557                    MDRRuleGroupInstanceService mdrRuleGroupInstanceService) {
558                    this.mdrRuleGroupInstanceService = mdrRuleGroupInstanceService;
559            }
560    
561            /**
562             * Returns the m d r rule group instance persistence.
563             *
564             * @return the m d r rule group instance persistence
565             */
566            public MDRRuleGroupInstancePersistence getMDRRuleGroupInstancePersistence() {
567                    return mdrRuleGroupInstancePersistence;
568            }
569    
570            /**
571             * Sets the m d r rule group instance persistence.
572             *
573             * @param mdrRuleGroupInstancePersistence the m d r rule group instance persistence
574             */
575            public void setMDRRuleGroupInstancePersistence(
576                    MDRRuleGroupInstancePersistence mdrRuleGroupInstancePersistence) {
577                    this.mdrRuleGroupInstancePersistence = mdrRuleGroupInstancePersistence;
578            }
579    
580            /**
581             * Returns the counter local service.
582             *
583             * @return the counter local service
584             */
585            public CounterLocalService getCounterLocalService() {
586                    return counterLocalService;
587            }
588    
589            /**
590             * Sets the counter local service.
591             *
592             * @param counterLocalService the counter local service
593             */
594            public void setCounterLocalService(CounterLocalService counterLocalService) {
595                    this.counterLocalService = counterLocalService;
596            }
597    
598            /**
599             * Returns the resource local service.
600             *
601             * @return the resource local service
602             */
603            public ResourceLocalService getResourceLocalService() {
604                    return resourceLocalService;
605            }
606    
607            /**
608             * Sets the resource local service.
609             *
610             * @param resourceLocalService the resource local service
611             */
612            public void setResourceLocalService(
613                    ResourceLocalService resourceLocalService) {
614                    this.resourceLocalService = resourceLocalService;
615            }
616    
617            /**
618             * Returns the resource remote service.
619             *
620             * @return the resource remote service
621             */
622            public ResourceService getResourceService() {
623                    return resourceService;
624            }
625    
626            /**
627             * Sets the resource remote service.
628             *
629             * @param resourceService the resource remote service
630             */
631            public void setResourceService(ResourceService resourceService) {
632                    this.resourceService = resourceService;
633            }
634    
635            /**
636             * Returns the resource persistence.
637             *
638             * @return the resource persistence
639             */
640            public ResourcePersistence getResourcePersistence() {
641                    return resourcePersistence;
642            }
643    
644            /**
645             * Sets the resource persistence.
646             *
647             * @param resourcePersistence the resource persistence
648             */
649            public void setResourcePersistence(ResourcePersistence resourcePersistence) {
650                    this.resourcePersistence = resourcePersistence;
651            }
652    
653            /**
654             * Returns the resource finder.
655             *
656             * @return the resource finder
657             */
658            public ResourceFinder getResourceFinder() {
659                    return resourceFinder;
660            }
661    
662            /**
663             * Sets the resource finder.
664             *
665             * @param resourceFinder the resource finder
666             */
667            public void setResourceFinder(ResourceFinder resourceFinder) {
668                    this.resourceFinder = resourceFinder;
669            }
670    
671            /**
672             * Returns the user local service.
673             *
674             * @return the user local service
675             */
676            public UserLocalService getUserLocalService() {
677                    return userLocalService;
678            }
679    
680            /**
681             * Sets the user local service.
682             *
683             * @param userLocalService the user local service
684             */
685            public void setUserLocalService(UserLocalService userLocalService) {
686                    this.userLocalService = userLocalService;
687            }
688    
689            /**
690             * Returns the user remote service.
691             *
692             * @return the user remote service
693             */
694            public UserService getUserService() {
695                    return userService;
696            }
697    
698            /**
699             * Sets the user remote service.
700             *
701             * @param userService the user remote service
702             */
703            public void setUserService(UserService userService) {
704                    this.userService = userService;
705            }
706    
707            /**
708             * Returns the user persistence.
709             *
710             * @return the user persistence
711             */
712            public UserPersistence getUserPersistence() {
713                    return userPersistence;
714            }
715    
716            /**
717             * Sets the user persistence.
718             *
719             * @param userPersistence the user persistence
720             */
721            public void setUserPersistence(UserPersistence userPersistence) {
722                    this.userPersistence = userPersistence;
723            }
724    
725            /**
726             * Returns the user finder.
727             *
728             * @return the user finder
729             */
730            public UserFinder getUserFinder() {
731                    return userFinder;
732            }
733    
734            /**
735             * Sets the user finder.
736             *
737             * @param userFinder the user finder
738             */
739            public void setUserFinder(UserFinder userFinder) {
740                    this.userFinder = userFinder;
741            }
742    
743            public void afterPropertiesSet() {
744                    persistedModelLocalServiceRegistry.register("com.liferay.portlet.mobiledevicerules.model.MDRRule",
745                            mdrRuleLocalService);
746            }
747    
748            public void destroy() {
749                    persistedModelLocalServiceRegistry.unregister(
750                            "com.liferay.portlet.mobiledevicerules.model.MDRRule");
751            }
752    
753            /**
754             * Returns the Spring bean ID for this bean.
755             *
756             * @return the Spring bean ID for this bean
757             */
758            public String getBeanIdentifier() {
759                    return _beanIdentifier;
760            }
761    
762            /**
763             * Sets the Spring bean ID for this bean.
764             *
765             * @param beanIdentifier the Spring bean ID for this bean
766             */
767            public void setBeanIdentifier(String beanIdentifier) {
768                    _beanIdentifier = beanIdentifier;
769            }
770    
771            protected ClassLoader getClassLoader() {
772                    Class<?> clazz = getClass();
773    
774                    return clazz.getClassLoader();
775            }
776    
777            protected Class<?> getModelClass() {
778                    return MDRRule.class;
779            }
780    
781            protected String getModelClassName() {
782                    return MDRRule.class.getName();
783            }
784    
785            /**
786             * Performs an SQL query.
787             *
788             * @param sql the sql query
789             */
790            protected void runSQL(String sql) throws SystemException {
791                    try {
792                            DataSource dataSource = mdrRulePersistence.getDataSource();
793    
794                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
795                                            sql, new int[0]);
796    
797                            sqlUpdate.update();
798                    }
799                    catch (Exception e) {
800                            throw new SystemException(e);
801                    }
802            }
803    
804            @BeanReference(type = MDRActionLocalService.class)
805            protected MDRActionLocalService mdrActionLocalService;
806            @BeanReference(type = MDRActionService.class)
807            protected MDRActionService mdrActionService;
808            @BeanReference(type = MDRActionPersistence.class)
809            protected MDRActionPersistence mdrActionPersistence;
810            @BeanReference(type = MDRRuleLocalService.class)
811            protected MDRRuleLocalService mdrRuleLocalService;
812            @BeanReference(type = MDRRuleService.class)
813            protected MDRRuleService mdrRuleService;
814            @BeanReference(type = MDRRulePersistence.class)
815            protected MDRRulePersistence mdrRulePersistence;
816            @BeanReference(type = MDRRuleGroupLocalService.class)
817            protected MDRRuleGroupLocalService mdrRuleGroupLocalService;
818            @BeanReference(type = MDRRuleGroupService.class)
819            protected MDRRuleGroupService mdrRuleGroupService;
820            @BeanReference(type = MDRRuleGroupPersistence.class)
821            protected MDRRuleGroupPersistence mdrRuleGroupPersistence;
822            @BeanReference(type = MDRRuleGroupFinder.class)
823            protected MDRRuleGroupFinder mdrRuleGroupFinder;
824            @BeanReference(type = MDRRuleGroupInstanceLocalService.class)
825            protected MDRRuleGroupInstanceLocalService mdrRuleGroupInstanceLocalService;
826            @BeanReference(type = MDRRuleGroupInstanceService.class)
827            protected MDRRuleGroupInstanceService mdrRuleGroupInstanceService;
828            @BeanReference(type = MDRRuleGroupInstancePersistence.class)
829            protected MDRRuleGroupInstancePersistence mdrRuleGroupInstancePersistence;
830            @BeanReference(type = CounterLocalService.class)
831            protected CounterLocalService counterLocalService;
832            @BeanReference(type = ResourceLocalService.class)
833            protected ResourceLocalService resourceLocalService;
834            @BeanReference(type = ResourceService.class)
835            protected ResourceService resourceService;
836            @BeanReference(type = ResourcePersistence.class)
837            protected ResourcePersistence resourcePersistence;
838            @BeanReference(type = ResourceFinder.class)
839            protected ResourceFinder resourceFinder;
840            @BeanReference(type = UserLocalService.class)
841            protected UserLocalService userLocalService;
842            @BeanReference(type = UserService.class)
843            protected UserService userService;
844            @BeanReference(type = UserPersistence.class)
845            protected UserPersistence userPersistence;
846            @BeanReference(type = UserFinder.class)
847            protected UserFinder userFinder;
848            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
849            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
850            private static Log _log = LogFactoryUtil.getLog(MDRRuleLocalServiceBaseImpl.class);
851            private String _beanIdentifier;
852    }