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.mobiledevicerules.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.exception.PortalException;
032    import com.liferay.portal.kernel.exception.SystemException;
033    import com.liferay.portal.kernel.lar.ExportImportHelperUtil;
034    import com.liferay.portal.kernel.lar.ManifestSummary;
035    import com.liferay.portal.kernel.lar.PortletDataContext;
036    import com.liferay.portal.kernel.lar.StagedModelDataHandlerUtil;
037    import com.liferay.portal.kernel.lar.StagedModelType;
038    import com.liferay.portal.kernel.search.Indexable;
039    import com.liferay.portal.kernel.search.IndexableType;
040    import com.liferay.portal.kernel.util.OrderByComparator;
041    import com.liferay.portal.model.PersistedModel;
042    import com.liferay.portal.service.BaseLocalServiceImpl;
043    import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
044    import com.liferay.portal.service.persistence.SystemEventPersistence;
045    import com.liferay.portal.service.persistence.UserFinder;
046    import com.liferay.portal.service.persistence.UserPersistence;
047    import com.liferay.portal.util.PortalUtil;
048    
049    import com.liferay.portlet.mobiledevicerules.model.MDRRule;
050    import com.liferay.portlet.mobiledevicerules.service.MDRRuleLocalService;
051    import com.liferay.portlet.mobiledevicerules.service.persistence.MDRRuleGroupFinder;
052    import com.liferay.portlet.mobiledevicerules.service.persistence.MDRRuleGroupPersistence;
053    import com.liferay.portlet.mobiledevicerules.service.persistence.MDRRulePersistence;
054    
055    import java.io.Serializable;
056    
057    import java.util.List;
058    
059    import javax.sql.DataSource;
060    
061    /**
062     * Provides the base implementation for the m d r rule local service.
063     *
064     * <p>
065     * 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}.
066     * </p>
067     *
068     * @author Edward C. Han
069     * @see com.liferay.portlet.mobiledevicerules.service.impl.MDRRuleLocalServiceImpl
070     * @see com.liferay.portlet.mobiledevicerules.service.MDRRuleLocalServiceUtil
071     * @generated
072     */
073    @ProviderType
074    public abstract class MDRRuleLocalServiceBaseImpl extends BaseLocalServiceImpl
075            implements MDRRuleLocalService, IdentifiableBean {
076            /*
077             * NOTE FOR DEVELOPERS:
078             *
079             * 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.
080             */
081    
082            /**
083             * Adds the m d r rule to the database. Also notifies the appropriate model listeners.
084             *
085             * @param mdrRule the m d r rule
086             * @return the m d r rule that was added
087             */
088            @Indexable(type = IndexableType.REINDEX)
089            @Override
090            public MDRRule addMDRRule(MDRRule mdrRule) {
091                    mdrRule.setNew(true);
092    
093                    return mdrRulePersistence.update(mdrRule);
094            }
095    
096            /**
097             * Creates a new m d r rule with the primary key. Does not add the m d r rule to the database.
098             *
099             * @param ruleId the primary key for the new m d r rule
100             * @return the new m d r rule
101             */
102            @Override
103            public MDRRule createMDRRule(long ruleId) {
104                    return mdrRulePersistence.create(ruleId);
105            }
106    
107            /**
108             * Deletes the m d r rule with the primary key from the database. Also notifies the appropriate model listeners.
109             *
110             * @param ruleId the primary key of the m d r rule
111             * @return the m d r rule that was removed
112             * @throws PortalException if a m d r rule with the primary key could not be found
113             */
114            @Indexable(type = IndexableType.DELETE)
115            @Override
116            public MDRRule deleteMDRRule(long ruleId) throws PortalException {
117                    return mdrRulePersistence.remove(ruleId);
118            }
119    
120            /**
121             * Deletes the m d r rule from the database. Also notifies the appropriate model listeners.
122             *
123             * @param mdrRule the m d r rule
124             * @return the m d r rule that was removed
125             */
126            @Indexable(type = IndexableType.DELETE)
127            @Override
128            public MDRRule deleteMDRRule(MDRRule mdrRule) {
129                    return mdrRulePersistence.remove(mdrRule);
130            }
131    
132            @Override
133            public DynamicQuery dynamicQuery() {
134                    Class<?> clazz = getClass();
135    
136                    return DynamicQueryFactoryUtil.forClass(MDRRule.class,
137                            clazz.getClassLoader());
138            }
139    
140            /**
141             * Performs a dynamic query on the database and returns the matching rows.
142             *
143             * @param dynamicQuery the dynamic query
144             * @return the matching rows
145             */
146            @Override
147            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
148                    return mdrRulePersistence.findWithDynamicQuery(dynamicQuery);
149            }
150    
151            /**
152             * Performs a dynamic query on the database and returns a range of the matching rows.
153             *
154             * <p>
155             * 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.mobiledevicerules.model.impl.MDRRuleModelImpl}. 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.
156             * </p>
157             *
158             * @param dynamicQuery the dynamic query
159             * @param start the lower bound of the range of model instances
160             * @param end the upper bound of the range of model instances (not inclusive)
161             * @return the range of matching rows
162             */
163            @Override
164            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
165                    int end) {
166                    return mdrRulePersistence.findWithDynamicQuery(dynamicQuery, start, end);
167            }
168    
169            /**
170             * Performs a dynamic query on the database and returns an ordered range of the matching rows.
171             *
172             * <p>
173             * 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.mobiledevicerules.model.impl.MDRRuleModelImpl}. 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.
174             * </p>
175             *
176             * @param dynamicQuery the dynamic query
177             * @param start the lower bound of the range of model instances
178             * @param end the upper bound of the range of model instances (not inclusive)
179             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
180             * @return the ordered range of matching rows
181             */
182            @Override
183            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
184                    int end, OrderByComparator<T> orderByComparator) {
185                    return mdrRulePersistence.findWithDynamicQuery(dynamicQuery, start,
186                            end, orderByComparator);
187            }
188    
189            /**
190             * Returns the number of rows matching the dynamic query.
191             *
192             * @param dynamicQuery the dynamic query
193             * @return the number of rows matching the dynamic query
194             */
195            @Override
196            public long dynamicQueryCount(DynamicQuery dynamicQuery) {
197                    return mdrRulePersistence.countWithDynamicQuery(dynamicQuery);
198            }
199    
200            /**
201             * Returns the number of rows matching the dynamic query.
202             *
203             * @param dynamicQuery the dynamic query
204             * @param projection the projection to apply to the query
205             * @return the number of rows matching the dynamic query
206             */
207            @Override
208            public long dynamicQueryCount(DynamicQuery dynamicQuery,
209                    Projection projection) {
210                    return mdrRulePersistence.countWithDynamicQuery(dynamicQuery, projection);
211            }
212    
213            @Override
214            public MDRRule fetchMDRRule(long ruleId) {
215                    return mdrRulePersistence.fetchByPrimaryKey(ruleId);
216            }
217    
218            /**
219             * Returns the m d r rule matching the UUID and group.
220             *
221             * @param uuid the m d r rule's UUID
222             * @param groupId the primary key of the group
223             * @return the matching m d r rule, or <code>null</code> if a matching m d r rule could not be found
224             */
225            @Override
226            public MDRRule fetchMDRRuleByUuidAndGroupId(String uuid, long groupId) {
227                    return mdrRulePersistence.fetchByUUID_G(uuid, groupId);
228            }
229    
230            /**
231             * Returns the m d r rule with the primary key.
232             *
233             * @param ruleId the primary key of the m d r rule
234             * @return the m d r rule
235             * @throws PortalException if a m d r rule with the primary key could not be found
236             */
237            @Override
238            public MDRRule getMDRRule(long ruleId) throws PortalException {
239                    return mdrRulePersistence.findByPrimaryKey(ruleId);
240            }
241    
242            @Override
243            public ActionableDynamicQuery getActionableDynamicQuery() {
244                    ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
245    
246                    actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.mobiledevicerules.service.MDRRuleLocalServiceUtil.getService());
247                    actionableDynamicQuery.setClass(MDRRule.class);
248                    actionableDynamicQuery.setClassLoader(getClassLoader());
249    
250                    actionableDynamicQuery.setPrimaryKeyPropertyName("ruleId");
251    
252                    return actionableDynamicQuery;
253            }
254    
255            protected void initActionableDynamicQuery(
256                    ActionableDynamicQuery actionableDynamicQuery) {
257                    actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.mobiledevicerules.service.MDRRuleLocalServiceUtil.getService());
258                    actionableDynamicQuery.setClass(MDRRule.class);
259                    actionableDynamicQuery.setClassLoader(getClassLoader());
260    
261                    actionableDynamicQuery.setPrimaryKeyPropertyName("ruleId");
262            }
263    
264            @Override
265            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
266                    final PortletDataContext portletDataContext) {
267                    final ExportActionableDynamicQuery exportActionableDynamicQuery = new ExportActionableDynamicQuery() {
268                                    @Override
269                                    public long performCount() throws PortalException {
270                                            ManifestSummary manifestSummary = portletDataContext.getManifestSummary();
271    
272                                            StagedModelType stagedModelType = getStagedModelType();
273    
274                                            long modelAdditionCount = super.performCount();
275    
276                                            manifestSummary.addModelAdditionCount(stagedModelType.toString(),
277                                                    modelAdditionCount);
278    
279                                            long modelDeletionCount = ExportImportHelperUtil.getModelDeletionCount(portletDataContext,
280                                                            stagedModelType);
281    
282                                            manifestSummary.addModelDeletionCount(stagedModelType.toString(),
283                                                    modelDeletionCount);
284    
285                                            return modelAdditionCount;
286                                    }
287                            };
288    
289                    initActionableDynamicQuery(exportActionableDynamicQuery);
290    
291                    exportActionableDynamicQuery.setAddCriteriaMethod(new ActionableDynamicQuery.AddCriteriaMethod() {
292                                    @Override
293                                    public void addCriteria(DynamicQuery dynamicQuery) {
294                                            portletDataContext.addDateRangeCriteria(dynamicQuery,
295                                                    "modifiedDate");
296                                    }
297                            });
298    
299                    exportActionableDynamicQuery.setCompanyId(portletDataContext.getCompanyId());
300    
301                    exportActionableDynamicQuery.setGroupId(portletDataContext.getScopeGroupId());
302    
303                    exportActionableDynamicQuery.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod() {
304                                    @Override
305                                    public void performAction(Object object)
306                                            throws PortalException {
307                                            MDRRule stagedModel = (MDRRule)object;
308    
309                                            StagedModelDataHandlerUtil.exportStagedModel(portletDataContext,
310                                                    stagedModel);
311                                    }
312                            });
313                    exportActionableDynamicQuery.setStagedModelType(new StagedModelType(
314                                    PortalUtil.getClassNameId(MDRRule.class.getName())));
315    
316                    return exportActionableDynamicQuery;
317            }
318    
319            /**
320             * @throws PortalException
321             */
322            @Override
323            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
324                    throws PortalException {
325                    return mdrRuleLocalService.deleteMDRRule((MDRRule)persistedModel);
326            }
327    
328            @Override
329            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
330                    throws PortalException {
331                    return mdrRulePersistence.findByPrimaryKey(primaryKeyObj);
332            }
333    
334            /**
335             * Returns all the m d r rules matching the UUID and company.
336             *
337             * @param uuid the UUID of the m d r rules
338             * @param companyId the primary key of the company
339             * @return the matching m d r rules, or an empty list if no matches were found
340             */
341            @Override
342            public List<MDRRule> getMDRRulesByUuidAndCompanyId(String uuid,
343                    long companyId) {
344                    return mdrRulePersistence.findByUuid_C(uuid, companyId);
345            }
346    
347            /**
348             * Returns a range of m d r rules matching the UUID and company.
349             *
350             * @param uuid the UUID of the m d r rules
351             * @param companyId the primary key of the company
352             * @param start the lower bound of the range of m d r rules
353             * @param end the upper bound of the range of m d r rules (not inclusive)
354             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
355             * @return the range of matching m d r rules, or an empty list if no matches were found
356             */
357            @Override
358            public List<MDRRule> getMDRRulesByUuidAndCompanyId(String uuid,
359                    long companyId, int start, int end,
360                    OrderByComparator<MDRRule> orderByComparator) {
361                    return mdrRulePersistence.findByUuid_C(uuid, companyId, start, end,
362                            orderByComparator);
363            }
364    
365            /**
366             * Returns the m d r rule matching the UUID and group.
367             *
368             * @param uuid the m d r rule's UUID
369             * @param groupId the primary key of the group
370             * @return the matching m d r rule
371             * @throws PortalException if a matching m d r rule could not be found
372             */
373            @Override
374            public MDRRule getMDRRuleByUuidAndGroupId(String uuid, long groupId)
375                    throws PortalException {
376                    return mdrRulePersistence.findByUUID_G(uuid, groupId);
377            }
378    
379            /**
380             * Returns a range of all the m d r rules.
381             *
382             * <p>
383             * 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.mobiledevicerules.model.impl.MDRRuleModelImpl}. 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.
384             * </p>
385             *
386             * @param start the lower bound of the range of m d r rules
387             * @param end the upper bound of the range of m d r rules (not inclusive)
388             * @return the range of m d r rules
389             */
390            @Override
391            public List<MDRRule> getMDRRules(int start, int end) {
392                    return mdrRulePersistence.findAll(start, end);
393            }
394    
395            /**
396             * Returns the number of m d r rules.
397             *
398             * @return the number of m d r rules
399             */
400            @Override
401            public int getMDRRulesCount() {
402                    return mdrRulePersistence.countAll();
403            }
404    
405            /**
406             * Updates the m d r rule in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
407             *
408             * @param mdrRule the m d r rule
409             * @return the m d r rule that was updated
410             */
411            @Indexable(type = IndexableType.REINDEX)
412            @Override
413            public MDRRule updateMDRRule(MDRRule mdrRule) {
414                    return mdrRulePersistence.update(mdrRule);
415            }
416    
417            /**
418             * Returns the m d r rule local service.
419             *
420             * @return the m d r rule local service
421             */
422            public com.liferay.portlet.mobiledevicerules.service.MDRRuleLocalService getMDRRuleLocalService() {
423                    return mdrRuleLocalService;
424            }
425    
426            /**
427             * Sets the m d r rule local service.
428             *
429             * @param mdrRuleLocalService the m d r rule local service
430             */
431            public void setMDRRuleLocalService(
432                    com.liferay.portlet.mobiledevicerules.service.MDRRuleLocalService mdrRuleLocalService) {
433                    this.mdrRuleLocalService = mdrRuleLocalService;
434            }
435    
436            /**
437             * Returns the m d r rule remote service.
438             *
439             * @return the m d r rule remote service
440             */
441            public com.liferay.portlet.mobiledevicerules.service.MDRRuleService getMDRRuleService() {
442                    return mdrRuleService;
443            }
444    
445            /**
446             * Sets the m d r rule remote service.
447             *
448             * @param mdrRuleService the m d r rule remote service
449             */
450            public void setMDRRuleService(
451                    com.liferay.portlet.mobiledevicerules.service.MDRRuleService mdrRuleService) {
452                    this.mdrRuleService = mdrRuleService;
453            }
454    
455            /**
456             * Returns the m d r rule persistence.
457             *
458             * @return the m d r rule persistence
459             */
460            public MDRRulePersistence getMDRRulePersistence() {
461                    return mdrRulePersistence;
462            }
463    
464            /**
465             * Sets the m d r rule persistence.
466             *
467             * @param mdrRulePersistence the m d r rule persistence
468             */
469            public void setMDRRulePersistence(MDRRulePersistence mdrRulePersistence) {
470                    this.mdrRulePersistence = mdrRulePersistence;
471            }
472    
473            /**
474             * Returns the counter local service.
475             *
476             * @return the counter local service
477             */
478            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
479                    return counterLocalService;
480            }
481    
482            /**
483             * Sets the counter local service.
484             *
485             * @param counterLocalService the counter local service
486             */
487            public void setCounterLocalService(
488                    com.liferay.counter.service.CounterLocalService counterLocalService) {
489                    this.counterLocalService = counterLocalService;
490            }
491    
492            /**
493             * Returns the system event local service.
494             *
495             * @return the system event local service
496             */
497            public com.liferay.portal.service.SystemEventLocalService getSystemEventLocalService() {
498                    return systemEventLocalService;
499            }
500    
501            /**
502             * Sets the system event local service.
503             *
504             * @param systemEventLocalService the system event local service
505             */
506            public void setSystemEventLocalService(
507                    com.liferay.portal.service.SystemEventLocalService systemEventLocalService) {
508                    this.systemEventLocalService = systemEventLocalService;
509            }
510    
511            /**
512             * Returns the system event persistence.
513             *
514             * @return the system event persistence
515             */
516            public SystemEventPersistence getSystemEventPersistence() {
517                    return systemEventPersistence;
518            }
519    
520            /**
521             * Sets the system event persistence.
522             *
523             * @param systemEventPersistence the system event persistence
524             */
525            public void setSystemEventPersistence(
526                    SystemEventPersistence systemEventPersistence) {
527                    this.systemEventPersistence = systemEventPersistence;
528            }
529    
530            /**
531             * Returns the user local service.
532             *
533             * @return the user local service
534             */
535            public com.liferay.portal.service.UserLocalService getUserLocalService() {
536                    return userLocalService;
537            }
538    
539            /**
540             * Sets the user local service.
541             *
542             * @param userLocalService the user local service
543             */
544            public void setUserLocalService(
545                    com.liferay.portal.service.UserLocalService userLocalService) {
546                    this.userLocalService = userLocalService;
547            }
548    
549            /**
550             * Returns the user remote service.
551             *
552             * @return the user remote service
553             */
554            public com.liferay.portal.service.UserService getUserService() {
555                    return userService;
556            }
557    
558            /**
559             * Sets the user remote service.
560             *
561             * @param userService the user remote service
562             */
563            public void setUserService(
564                    com.liferay.portal.service.UserService userService) {
565                    this.userService = userService;
566            }
567    
568            /**
569             * Returns the user persistence.
570             *
571             * @return the user persistence
572             */
573            public UserPersistence getUserPersistence() {
574                    return userPersistence;
575            }
576    
577            /**
578             * Sets the user persistence.
579             *
580             * @param userPersistence the user persistence
581             */
582            public void setUserPersistence(UserPersistence userPersistence) {
583                    this.userPersistence = userPersistence;
584            }
585    
586            /**
587             * Returns the user finder.
588             *
589             * @return the user finder
590             */
591            public UserFinder getUserFinder() {
592                    return userFinder;
593            }
594    
595            /**
596             * Sets the user finder.
597             *
598             * @param userFinder the user finder
599             */
600            public void setUserFinder(UserFinder userFinder) {
601                    this.userFinder = userFinder;
602            }
603    
604            /**
605             * Returns the m d r rule group local service.
606             *
607             * @return the m d r rule group local service
608             */
609            public com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalService getMDRRuleGroupLocalService() {
610                    return mdrRuleGroupLocalService;
611            }
612    
613            /**
614             * Sets the m d r rule group local service.
615             *
616             * @param mdrRuleGroupLocalService the m d r rule group local service
617             */
618            public void setMDRRuleGroupLocalService(
619                    com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalService mdrRuleGroupLocalService) {
620                    this.mdrRuleGroupLocalService = mdrRuleGroupLocalService;
621            }
622    
623            /**
624             * Returns the m d r rule group remote service.
625             *
626             * @return the m d r rule group remote service
627             */
628            public com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupService getMDRRuleGroupService() {
629                    return mdrRuleGroupService;
630            }
631    
632            /**
633             * Sets the m d r rule group remote service.
634             *
635             * @param mdrRuleGroupService the m d r rule group remote service
636             */
637            public void setMDRRuleGroupService(
638                    com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupService mdrRuleGroupService) {
639                    this.mdrRuleGroupService = mdrRuleGroupService;
640            }
641    
642            /**
643             * Returns the m d r rule group persistence.
644             *
645             * @return the m d r rule group persistence
646             */
647            public MDRRuleGroupPersistence getMDRRuleGroupPersistence() {
648                    return mdrRuleGroupPersistence;
649            }
650    
651            /**
652             * Sets the m d r rule group persistence.
653             *
654             * @param mdrRuleGroupPersistence the m d r rule group persistence
655             */
656            public void setMDRRuleGroupPersistence(
657                    MDRRuleGroupPersistence mdrRuleGroupPersistence) {
658                    this.mdrRuleGroupPersistence = mdrRuleGroupPersistence;
659            }
660    
661            /**
662             * Returns the m d r rule group finder.
663             *
664             * @return the m d r rule group finder
665             */
666            public MDRRuleGroupFinder getMDRRuleGroupFinder() {
667                    return mdrRuleGroupFinder;
668            }
669    
670            /**
671             * Sets the m d r rule group finder.
672             *
673             * @param mdrRuleGroupFinder the m d r rule group finder
674             */
675            public void setMDRRuleGroupFinder(MDRRuleGroupFinder mdrRuleGroupFinder) {
676                    this.mdrRuleGroupFinder = mdrRuleGroupFinder;
677            }
678    
679            public void afterPropertiesSet() {
680                    persistedModelLocalServiceRegistry.register("com.liferay.portlet.mobiledevicerules.model.MDRRule",
681                            mdrRuleLocalService);
682            }
683    
684            public void destroy() {
685                    persistedModelLocalServiceRegistry.unregister(
686                            "com.liferay.portlet.mobiledevicerules.model.MDRRule");
687            }
688    
689            /**
690             * Returns the Spring bean ID for this bean.
691             *
692             * @return the Spring bean ID for this bean
693             */
694            @Override
695            public String getBeanIdentifier() {
696                    return _beanIdentifier;
697            }
698    
699            /**
700             * Sets the Spring bean ID for this bean.
701             *
702             * @param beanIdentifier the Spring bean ID for this bean
703             */
704            @Override
705            public void setBeanIdentifier(String beanIdentifier) {
706                    _beanIdentifier = beanIdentifier;
707            }
708    
709            protected Class<?> getModelClass() {
710                    return MDRRule.class;
711            }
712    
713            protected String getModelClassName() {
714                    return MDRRule.class.getName();
715            }
716    
717            /**
718             * Performs a SQL query.
719             *
720             * @param sql the sql query
721             */
722            protected void runSQL(String sql) {
723                    try {
724                            DataSource dataSource = mdrRulePersistence.getDataSource();
725    
726                            DB db = DBFactoryUtil.getDB();
727    
728                            sql = db.buildSQL(sql);
729                            sql = PortalUtil.transformSQL(sql);
730    
731                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
732                                            sql, new int[0]);
733    
734                            sqlUpdate.update();
735                    }
736                    catch (Exception e) {
737                            throw new SystemException(e);
738                    }
739            }
740    
741            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRRuleLocalService.class)
742            protected com.liferay.portlet.mobiledevicerules.service.MDRRuleLocalService mdrRuleLocalService;
743            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRRuleService.class)
744            protected com.liferay.portlet.mobiledevicerules.service.MDRRuleService mdrRuleService;
745            @BeanReference(type = MDRRulePersistence.class)
746            protected MDRRulePersistence mdrRulePersistence;
747            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
748            protected com.liferay.counter.service.CounterLocalService counterLocalService;
749            @BeanReference(type = com.liferay.portal.service.SystemEventLocalService.class)
750            protected com.liferay.portal.service.SystemEventLocalService systemEventLocalService;
751            @BeanReference(type = SystemEventPersistence.class)
752            protected SystemEventPersistence systemEventPersistence;
753            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
754            protected com.liferay.portal.service.UserLocalService userLocalService;
755            @BeanReference(type = com.liferay.portal.service.UserService.class)
756            protected com.liferay.portal.service.UserService userService;
757            @BeanReference(type = UserPersistence.class)
758            protected UserPersistence userPersistence;
759            @BeanReference(type = UserFinder.class)
760            protected UserFinder userFinder;
761            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalService.class)
762            protected com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalService mdrRuleGroupLocalService;
763            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupService.class)
764            protected com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupService mdrRuleGroupService;
765            @BeanReference(type = MDRRuleGroupPersistence.class)
766            protected MDRRuleGroupPersistence mdrRuleGroupPersistence;
767            @BeanReference(type = MDRRuleGroupFinder.class)
768            protected MDRRuleGroupFinder mdrRuleGroupFinder;
769            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
770            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
771            private String _beanIdentifier;
772    }