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.search.Indexable;
034    import com.liferay.portal.kernel.search.IndexableType;
035    import com.liferay.portal.kernel.util.OrderByComparator;
036    import com.liferay.portal.model.PersistedModel;
037    import com.liferay.portal.service.BaseLocalServiceImpl;
038    import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
039    import com.liferay.portal.service.persistence.SystemEventPersistence;
040    import com.liferay.portal.service.persistence.UserFinder;
041    import com.liferay.portal.service.persistence.UserPersistence;
042    import com.liferay.portal.util.PortalUtil;
043    
044    import com.liferay.portlet.exportimport.lar.ExportImportHelperUtil;
045    import com.liferay.portlet.exportimport.lar.ManifestSummary;
046    import com.liferay.portlet.exportimport.lar.PortletDataContext;
047    import com.liferay.portlet.exportimport.lar.StagedModelDataHandlerUtil;
048    import com.liferay.portlet.exportimport.lar.StagedModelType;
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 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(MDRRuleLocalService mdrRuleLocalService) {
432                    this.mdrRuleLocalService = mdrRuleLocalService;
433            }
434    
435            /**
436             * Returns the m d r rule remote service.
437             *
438             * @return the m d r rule remote service
439             */
440            public com.liferay.portlet.mobiledevicerules.service.MDRRuleService getMDRRuleService() {
441                    return mdrRuleService;
442            }
443    
444            /**
445             * Sets the m d r rule remote service.
446             *
447             * @param mdrRuleService the m d r rule remote service
448             */
449            public void setMDRRuleService(
450                    com.liferay.portlet.mobiledevicerules.service.MDRRuleService mdrRuleService) {
451                    this.mdrRuleService = mdrRuleService;
452            }
453    
454            /**
455             * Returns the m d r rule persistence.
456             *
457             * @return the m d r rule persistence
458             */
459            public MDRRulePersistence getMDRRulePersistence() {
460                    return mdrRulePersistence;
461            }
462    
463            /**
464             * Sets the m d r rule persistence.
465             *
466             * @param mdrRulePersistence the m d r rule persistence
467             */
468            public void setMDRRulePersistence(MDRRulePersistence mdrRulePersistence) {
469                    this.mdrRulePersistence = mdrRulePersistence;
470            }
471    
472            /**
473             * Returns the counter local service.
474             *
475             * @return the counter local service
476             */
477            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
478                    return counterLocalService;
479            }
480    
481            /**
482             * Sets the counter local service.
483             *
484             * @param counterLocalService the counter local service
485             */
486            public void setCounterLocalService(
487                    com.liferay.counter.service.CounterLocalService counterLocalService) {
488                    this.counterLocalService = counterLocalService;
489            }
490    
491            /**
492             * Returns the system event local service.
493             *
494             * @return the system event local service
495             */
496            public com.liferay.portal.service.SystemEventLocalService getSystemEventLocalService() {
497                    return systemEventLocalService;
498            }
499    
500            /**
501             * Sets the system event local service.
502             *
503             * @param systemEventLocalService the system event local service
504             */
505            public void setSystemEventLocalService(
506                    com.liferay.portal.service.SystemEventLocalService systemEventLocalService) {
507                    this.systemEventLocalService = systemEventLocalService;
508            }
509    
510            /**
511             * Returns the system event persistence.
512             *
513             * @return the system event persistence
514             */
515            public SystemEventPersistence getSystemEventPersistence() {
516                    return systemEventPersistence;
517            }
518    
519            /**
520             * Sets the system event persistence.
521             *
522             * @param systemEventPersistence the system event persistence
523             */
524            public void setSystemEventPersistence(
525                    SystemEventPersistence systemEventPersistence) {
526                    this.systemEventPersistence = systemEventPersistence;
527            }
528    
529            /**
530             * Returns the user local service.
531             *
532             * @return the user local service
533             */
534            public com.liferay.portal.service.UserLocalService getUserLocalService() {
535                    return userLocalService;
536            }
537    
538            /**
539             * Sets the user local service.
540             *
541             * @param userLocalService the user local service
542             */
543            public void setUserLocalService(
544                    com.liferay.portal.service.UserLocalService userLocalService) {
545                    this.userLocalService = userLocalService;
546            }
547    
548            /**
549             * Returns the user remote service.
550             *
551             * @return the user remote service
552             */
553            public com.liferay.portal.service.UserService getUserService() {
554                    return userService;
555            }
556    
557            /**
558             * Sets the user remote service.
559             *
560             * @param userService the user remote service
561             */
562            public void setUserService(
563                    com.liferay.portal.service.UserService userService) {
564                    this.userService = userService;
565            }
566    
567            /**
568             * Returns the user persistence.
569             *
570             * @return the user persistence
571             */
572            public UserPersistence getUserPersistence() {
573                    return userPersistence;
574            }
575    
576            /**
577             * Sets the user persistence.
578             *
579             * @param userPersistence the user persistence
580             */
581            public void setUserPersistence(UserPersistence userPersistence) {
582                    this.userPersistence = userPersistence;
583            }
584    
585            /**
586             * Returns the user finder.
587             *
588             * @return the user finder
589             */
590            public UserFinder getUserFinder() {
591                    return userFinder;
592            }
593    
594            /**
595             * Sets the user finder.
596             *
597             * @param userFinder the user finder
598             */
599            public void setUserFinder(UserFinder userFinder) {
600                    this.userFinder = userFinder;
601            }
602    
603            /**
604             * Returns the m d r rule group local service.
605             *
606             * @return the m d r rule group local service
607             */
608            public com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalService getMDRRuleGroupLocalService() {
609                    return mdrRuleGroupLocalService;
610            }
611    
612            /**
613             * Sets the m d r rule group local service.
614             *
615             * @param mdrRuleGroupLocalService the m d r rule group local service
616             */
617            public void setMDRRuleGroupLocalService(
618                    com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalService mdrRuleGroupLocalService) {
619                    this.mdrRuleGroupLocalService = mdrRuleGroupLocalService;
620            }
621    
622            /**
623             * Returns the m d r rule group remote service.
624             *
625             * @return the m d r rule group remote service
626             */
627            public com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupService getMDRRuleGroupService() {
628                    return mdrRuleGroupService;
629            }
630    
631            /**
632             * Sets the m d r rule group remote service.
633             *
634             * @param mdrRuleGroupService the m d r rule group remote service
635             */
636            public void setMDRRuleGroupService(
637                    com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupService mdrRuleGroupService) {
638                    this.mdrRuleGroupService = mdrRuleGroupService;
639            }
640    
641            /**
642             * Returns the m d r rule group persistence.
643             *
644             * @return the m d r rule group persistence
645             */
646            public MDRRuleGroupPersistence getMDRRuleGroupPersistence() {
647                    return mdrRuleGroupPersistence;
648            }
649    
650            /**
651             * Sets the m d r rule group persistence.
652             *
653             * @param mdrRuleGroupPersistence the m d r rule group persistence
654             */
655            public void setMDRRuleGroupPersistence(
656                    MDRRuleGroupPersistence mdrRuleGroupPersistence) {
657                    this.mdrRuleGroupPersistence = mdrRuleGroupPersistence;
658            }
659    
660            /**
661             * Returns the m d r rule group finder.
662             *
663             * @return the m d r rule group finder
664             */
665            public MDRRuleGroupFinder getMDRRuleGroupFinder() {
666                    return mdrRuleGroupFinder;
667            }
668    
669            /**
670             * Sets the m d r rule group finder.
671             *
672             * @param mdrRuleGroupFinder the m d r rule group finder
673             */
674            public void setMDRRuleGroupFinder(MDRRuleGroupFinder mdrRuleGroupFinder) {
675                    this.mdrRuleGroupFinder = mdrRuleGroupFinder;
676            }
677    
678            public void afterPropertiesSet() {
679                    persistedModelLocalServiceRegistry.register("com.liferay.portlet.mobiledevicerules.model.MDRRule",
680                            mdrRuleLocalService);
681            }
682    
683            public void destroy() {
684                    persistedModelLocalServiceRegistry.unregister(
685                            "com.liferay.portlet.mobiledevicerules.model.MDRRule");
686            }
687    
688            /**
689             * Returns the Spring bean ID for this bean.
690             *
691             * @return the Spring bean ID for this bean
692             */
693            @Override
694            public String getBeanIdentifier() {
695                    return _beanIdentifier;
696            }
697    
698            /**
699             * Sets the Spring bean ID for this bean.
700             *
701             * @param beanIdentifier the Spring bean ID for this bean
702             */
703            @Override
704            public void setBeanIdentifier(String beanIdentifier) {
705                    _beanIdentifier = beanIdentifier;
706            }
707    
708            protected Class<?> getModelClass() {
709                    return MDRRule.class;
710            }
711    
712            protected String getModelClassName() {
713                    return MDRRule.class.getName();
714            }
715    
716            /**
717             * Performs a SQL query.
718             *
719             * @param sql the sql query
720             */
721            protected void runSQL(String sql) {
722                    try {
723                            DataSource dataSource = mdrRulePersistence.getDataSource();
724    
725                            DB db = DBFactoryUtil.getDB();
726    
727                            sql = db.buildSQL(sql);
728                            sql = PortalUtil.transformSQL(sql);
729    
730                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
731                                            sql, new int[0]);
732    
733                            sqlUpdate.update();
734                    }
735                    catch (Exception e) {
736                            throw new SystemException(e);
737                    }
738            }
739    
740            @BeanReference(type = MDRRuleLocalService.class)
741            protected MDRRuleLocalService mdrRuleLocalService;
742            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRRuleService.class)
743            protected com.liferay.portlet.mobiledevicerules.service.MDRRuleService mdrRuleService;
744            @BeanReference(type = MDRRulePersistence.class)
745            protected MDRRulePersistence mdrRulePersistence;
746            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
747            protected com.liferay.counter.service.CounterLocalService counterLocalService;
748            @BeanReference(type = com.liferay.portal.service.SystemEventLocalService.class)
749            protected com.liferay.portal.service.SystemEventLocalService systemEventLocalService;
750            @BeanReference(type = SystemEventPersistence.class)
751            protected SystemEventPersistence systemEventPersistence;
752            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
753            protected com.liferay.portal.service.UserLocalService userLocalService;
754            @BeanReference(type = com.liferay.portal.service.UserService.class)
755            protected com.liferay.portal.service.UserService userService;
756            @BeanReference(type = UserPersistence.class)
757            protected UserPersistence userPersistence;
758            @BeanReference(type = UserFinder.class)
759            protected UserFinder userFinder;
760            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalService.class)
761            protected com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalService mdrRuleGroupLocalService;
762            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupService.class)
763            protected com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupService mdrRuleGroupService;
764            @BeanReference(type = MDRRuleGroupPersistence.class)
765            protected MDRRuleGroupPersistence mdrRuleGroupPersistence;
766            @BeanReference(type = MDRRuleGroupFinder.class)
767            protected MDRRuleGroupFinder mdrRuleGroupFinder;
768            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
769            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
770            private String _beanIdentifier;
771    }