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 matching the dynamic query.
193             *
194             * @param dynamicQuery the dynamic query
195             * @return the number of rows matching 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 matching 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 matching 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            /**
348             * Returns all the m d r actions matching the UUID and company.
349             *
350             * @param uuid the UUID of the m d r actions
351             * @param companyId the primary key of the company
352             * @return the matching m d r actions, or an empty list if no matches were found
353             */
354            @Override
355            public List<MDRAction> getMDRActionsByUuidAndCompanyId(String uuid,
356                    long companyId) {
357                    return mdrActionPersistence.findByUuid_C(uuid, companyId);
358            }
359    
360            /**
361             * Returns a range of m d r actions matching the UUID and company.
362             *
363             * @param uuid the UUID of the m d r actions
364             * @param companyId the primary key of the company
365             * @param start the lower bound of the range of m d r actions
366             * @param end the upper bound of the range of m d r actions (not inclusive)
367             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
368             * @return the range of matching m d r actions, or an empty list if no matches were found
369             */
370            @Override
371            public List<MDRAction> getMDRActionsByUuidAndCompanyId(String uuid,
372                    long companyId, int start, int end,
373                    OrderByComparator<MDRAction> orderByComparator) {
374                    return mdrActionPersistence.findByUuid_C(uuid, companyId, start, end,
375                            orderByComparator);
376            }
377    
378            /**
379             * Returns the m d r action matching the UUID and group.
380             *
381             * @param uuid the m d r action's UUID
382             * @param groupId the primary key of the group
383             * @return the matching m d r action
384             * @throws PortalException if a matching m d r action could not be found
385             */
386            @Override
387            public MDRAction getMDRActionByUuidAndGroupId(String uuid, long groupId)
388                    throws PortalException {
389                    return mdrActionPersistence.findByUUID_G(uuid, groupId);
390            }
391    
392            /**
393             * Returns a range of all the m d r actions.
394             *
395             * <p>
396             * 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.
397             * </p>
398             *
399             * @param start the lower bound of the range of m d r actions
400             * @param end the upper bound of the range of m d r actions (not inclusive)
401             * @return the range of m d r actions
402             */
403            @Override
404            public List<MDRAction> getMDRActions(int start, int end) {
405                    return mdrActionPersistence.findAll(start, end);
406            }
407    
408            /**
409             * Returns the number of m d r actions.
410             *
411             * @return the number of m d r actions
412             */
413            @Override
414            public int getMDRActionsCount() {
415                    return mdrActionPersistence.countAll();
416            }
417    
418            /**
419             * Updates the m d r action in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
420             *
421             * @param mdrAction the m d r action
422             * @return the m d r action that was updated
423             */
424            @Indexable(type = IndexableType.REINDEX)
425            @Override
426            public MDRAction updateMDRAction(MDRAction mdrAction) {
427                    return mdrActionPersistence.update(mdrAction);
428            }
429    
430            /**
431             * Returns the m d r action local service.
432             *
433             * @return the m d r action local service
434             */
435            public com.liferay.portlet.mobiledevicerules.service.MDRActionLocalService getMDRActionLocalService() {
436                    return mdrActionLocalService;
437            }
438    
439            /**
440             * Sets the m d r action local service.
441             *
442             * @param mdrActionLocalService the m d r action local service
443             */
444            public void setMDRActionLocalService(
445                    com.liferay.portlet.mobiledevicerules.service.MDRActionLocalService mdrActionLocalService) {
446                    this.mdrActionLocalService = mdrActionLocalService;
447            }
448    
449            /**
450             * Returns the m d r action remote service.
451             *
452             * @return the m d r action remote service
453             */
454            public com.liferay.portlet.mobiledevicerules.service.MDRActionService getMDRActionService() {
455                    return mdrActionService;
456            }
457    
458            /**
459             * Sets the m d r action remote service.
460             *
461             * @param mdrActionService the m d r action remote service
462             */
463            public void setMDRActionService(
464                    com.liferay.portlet.mobiledevicerules.service.MDRActionService mdrActionService) {
465                    this.mdrActionService = mdrActionService;
466            }
467    
468            /**
469             * Returns the m d r action persistence.
470             *
471             * @return the m d r action persistence
472             */
473            public MDRActionPersistence getMDRActionPersistence() {
474                    return mdrActionPersistence;
475            }
476    
477            /**
478             * Sets the m d r action persistence.
479             *
480             * @param mdrActionPersistence the m d r action persistence
481             */
482            public void setMDRActionPersistence(
483                    MDRActionPersistence mdrActionPersistence) {
484                    this.mdrActionPersistence = mdrActionPersistence;
485            }
486    
487            /**
488             * Returns the counter local service.
489             *
490             * @return the counter local service
491             */
492            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
493                    return counterLocalService;
494            }
495    
496            /**
497             * Sets the counter local service.
498             *
499             * @param counterLocalService the counter local service
500             */
501            public void setCounterLocalService(
502                    com.liferay.counter.service.CounterLocalService counterLocalService) {
503                    this.counterLocalService = counterLocalService;
504            }
505    
506            /**
507             * Returns the system event local service.
508             *
509             * @return the system event local service
510             */
511            public com.liferay.portal.service.SystemEventLocalService getSystemEventLocalService() {
512                    return systemEventLocalService;
513            }
514    
515            /**
516             * Sets the system event local service.
517             *
518             * @param systemEventLocalService the system event local service
519             */
520            public void setSystemEventLocalService(
521                    com.liferay.portal.service.SystemEventLocalService systemEventLocalService) {
522                    this.systemEventLocalService = systemEventLocalService;
523            }
524    
525            /**
526             * Returns the system event persistence.
527             *
528             * @return the system event persistence
529             */
530            public SystemEventPersistence getSystemEventPersistence() {
531                    return systemEventPersistence;
532            }
533    
534            /**
535             * Sets the system event persistence.
536             *
537             * @param systemEventPersistence the system event persistence
538             */
539            public void setSystemEventPersistence(
540                    SystemEventPersistence systemEventPersistence) {
541                    this.systemEventPersistence = systemEventPersistence;
542            }
543    
544            /**
545             * Returns the user local service.
546             *
547             * @return the user local service
548             */
549            public com.liferay.portal.service.UserLocalService getUserLocalService() {
550                    return userLocalService;
551            }
552    
553            /**
554             * Sets the user local service.
555             *
556             * @param userLocalService the user local service
557             */
558            public void setUserLocalService(
559                    com.liferay.portal.service.UserLocalService userLocalService) {
560                    this.userLocalService = userLocalService;
561            }
562    
563            /**
564             * Returns the user remote service.
565             *
566             * @return the user remote service
567             */
568            public com.liferay.portal.service.UserService getUserService() {
569                    return userService;
570            }
571    
572            /**
573             * Sets the user remote service.
574             *
575             * @param userService the user remote service
576             */
577            public void setUserService(
578                    com.liferay.portal.service.UserService userService) {
579                    this.userService = userService;
580            }
581    
582            /**
583             * Returns the user persistence.
584             *
585             * @return the user persistence
586             */
587            public UserPersistence getUserPersistence() {
588                    return userPersistence;
589            }
590    
591            /**
592             * Sets the user persistence.
593             *
594             * @param userPersistence the user persistence
595             */
596            public void setUserPersistence(UserPersistence userPersistence) {
597                    this.userPersistence = userPersistence;
598            }
599    
600            /**
601             * Returns the user finder.
602             *
603             * @return the user finder
604             */
605            public UserFinder getUserFinder() {
606                    return userFinder;
607            }
608    
609            /**
610             * Sets the user finder.
611             *
612             * @param userFinder the user finder
613             */
614            public void setUserFinder(UserFinder userFinder) {
615                    this.userFinder = userFinder;
616            }
617    
618            /**
619             * Returns the m d r rule group instance local service.
620             *
621             * @return the m d r rule group instance local service
622             */
623            public com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceLocalService getMDRRuleGroupInstanceLocalService() {
624                    return mdrRuleGroupInstanceLocalService;
625            }
626    
627            /**
628             * Sets the m d r rule group instance local service.
629             *
630             * @param mdrRuleGroupInstanceLocalService the m d r rule group instance local service
631             */
632            public void setMDRRuleGroupInstanceLocalService(
633                    com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceLocalService mdrRuleGroupInstanceLocalService) {
634                    this.mdrRuleGroupInstanceLocalService = mdrRuleGroupInstanceLocalService;
635            }
636    
637            /**
638             * Returns the m d r rule group instance remote service.
639             *
640             * @return the m d r rule group instance remote service
641             */
642            public com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceService getMDRRuleGroupInstanceService() {
643                    return mdrRuleGroupInstanceService;
644            }
645    
646            /**
647             * Sets the m d r rule group instance remote service.
648             *
649             * @param mdrRuleGroupInstanceService the m d r rule group instance remote service
650             */
651            public void setMDRRuleGroupInstanceService(
652                    com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceService mdrRuleGroupInstanceService) {
653                    this.mdrRuleGroupInstanceService = mdrRuleGroupInstanceService;
654            }
655    
656            /**
657             * Returns the m d r rule group instance persistence.
658             *
659             * @return the m d r rule group instance persistence
660             */
661            public MDRRuleGroupInstancePersistence getMDRRuleGroupInstancePersistence() {
662                    return mdrRuleGroupInstancePersistence;
663            }
664    
665            /**
666             * Sets the m d r rule group instance persistence.
667             *
668             * @param mdrRuleGroupInstancePersistence the m d r rule group instance persistence
669             */
670            public void setMDRRuleGroupInstancePersistence(
671                    MDRRuleGroupInstancePersistence mdrRuleGroupInstancePersistence) {
672                    this.mdrRuleGroupInstancePersistence = mdrRuleGroupInstancePersistence;
673            }
674    
675            public void afterPropertiesSet() {
676                    persistedModelLocalServiceRegistry.register("com.liferay.portlet.mobiledevicerules.model.MDRAction",
677                            mdrActionLocalService);
678            }
679    
680            public void destroy() {
681                    persistedModelLocalServiceRegistry.unregister(
682                            "com.liferay.portlet.mobiledevicerules.model.MDRAction");
683            }
684    
685            /**
686             * Returns the Spring bean ID for this bean.
687             *
688             * @return the Spring bean ID for this bean
689             */
690            @Override
691            public String getBeanIdentifier() {
692                    return _beanIdentifier;
693            }
694    
695            /**
696             * Sets the Spring bean ID for this bean.
697             *
698             * @param beanIdentifier the Spring bean ID for this bean
699             */
700            @Override
701            public void setBeanIdentifier(String beanIdentifier) {
702                    _beanIdentifier = beanIdentifier;
703            }
704    
705            protected Class<?> getModelClass() {
706                    return MDRAction.class;
707            }
708    
709            protected String getModelClassName() {
710                    return MDRAction.class.getName();
711            }
712    
713            /**
714             * Performs a SQL query.
715             *
716             * @param sql the sql query
717             */
718            protected void runSQL(String sql) {
719                    try {
720                            DataSource dataSource = mdrActionPersistence.getDataSource();
721    
722                            DB db = DBFactoryUtil.getDB();
723    
724                            sql = db.buildSQL(sql);
725                            sql = PortalUtil.transformSQL(sql);
726    
727                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
728                                            sql, new int[0]);
729    
730                            sqlUpdate.update();
731                    }
732                    catch (Exception e) {
733                            throw new SystemException(e);
734                    }
735            }
736    
737            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRActionLocalService.class)
738            protected com.liferay.portlet.mobiledevicerules.service.MDRActionLocalService mdrActionLocalService;
739            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRActionService.class)
740            protected com.liferay.portlet.mobiledevicerules.service.MDRActionService mdrActionService;
741            @BeanReference(type = MDRActionPersistence.class)
742            protected MDRActionPersistence mdrActionPersistence;
743            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
744            protected com.liferay.counter.service.CounterLocalService counterLocalService;
745            @BeanReference(type = com.liferay.portal.service.SystemEventLocalService.class)
746            protected com.liferay.portal.service.SystemEventLocalService systemEventLocalService;
747            @BeanReference(type = SystemEventPersistence.class)
748            protected SystemEventPersistence systemEventPersistence;
749            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
750            protected com.liferay.portal.service.UserLocalService userLocalService;
751            @BeanReference(type = com.liferay.portal.service.UserService.class)
752            protected com.liferay.portal.service.UserService userService;
753            @BeanReference(type = UserPersistence.class)
754            protected UserPersistence userPersistence;
755            @BeanReference(type = UserFinder.class)
756            protected UserFinder userFinder;
757            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceLocalService.class)
758            protected com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceLocalService mdrRuleGroupInstanceLocalService;
759            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceService.class)
760            protected com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceService mdrRuleGroupInstanceService;
761            @BeanReference(type = MDRRuleGroupInstancePersistence.class)
762            protected MDRRuleGroupInstancePersistence mdrRuleGroupInstancePersistence;
763            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
764            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
765            private String _beanIdentifier;
766    }