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