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.ClassNamePersistence;
047    import com.liferay.portal.service.persistence.LayoutFinder;
048    import com.liferay.portal.service.persistence.LayoutPersistence;
049    import com.liferay.portal.service.persistence.LayoutSetPersistence;
050    import com.liferay.portal.service.persistence.SystemEventPersistence;
051    import com.liferay.portal.service.persistence.UserFinder;
052    import com.liferay.portal.service.persistence.UserPersistence;
053    import com.liferay.portal.util.PortalUtil;
054    
055    import com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupInstance;
056    import com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceLocalService;
057    import com.liferay.portlet.mobiledevicerules.service.persistence.MDRActionPersistence;
058    import com.liferay.portlet.mobiledevicerules.service.persistence.MDRRuleGroupFinder;
059    import com.liferay.portlet.mobiledevicerules.service.persistence.MDRRuleGroupInstancePersistence;
060    import com.liferay.portlet.mobiledevicerules.service.persistence.MDRRuleGroupPersistence;
061    
062    import java.io.Serializable;
063    
064    import java.util.List;
065    
066    import javax.sql.DataSource;
067    
068    /**
069     * Provides the base implementation for the m d r rule group instance local service.
070     *
071     * <p>
072     * 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.MDRRuleGroupInstanceLocalServiceImpl}.
073     * </p>
074     *
075     * @author Edward C. Han
076     * @see com.liferay.portlet.mobiledevicerules.service.impl.MDRRuleGroupInstanceLocalServiceImpl
077     * @see com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceLocalServiceUtil
078     * @generated
079     */
080    @ProviderType
081    public abstract class MDRRuleGroupInstanceLocalServiceBaseImpl
082            extends BaseLocalServiceImpl implements MDRRuleGroupInstanceLocalService,
083                    IdentifiableBean {
084            /*
085             * NOTE FOR DEVELOPERS:
086             *
087             * Never modify or reference this class directly. Always use {@link com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceLocalServiceUtil} to access the m d r rule group instance local service.
088             */
089    
090            /**
091             * Adds the m d r rule group instance to the database. Also notifies the appropriate model listeners.
092             *
093             * @param mdrRuleGroupInstance the m d r rule group instance
094             * @return the m d r rule group instance that was added
095             */
096            @Indexable(type = IndexableType.REINDEX)
097            @Override
098            public MDRRuleGroupInstance addMDRRuleGroupInstance(
099                    MDRRuleGroupInstance mdrRuleGroupInstance) {
100                    mdrRuleGroupInstance.setNew(true);
101    
102                    return mdrRuleGroupInstancePersistence.update(mdrRuleGroupInstance);
103            }
104    
105            /**
106             * Creates a new m d r rule group instance with the primary key. Does not add the m d r rule group instance to the database.
107             *
108             * @param ruleGroupInstanceId the primary key for the new m d r rule group instance
109             * @return the new m d r rule group instance
110             */
111            @Override
112            public MDRRuleGroupInstance createMDRRuleGroupInstance(
113                    long ruleGroupInstanceId) {
114                    return mdrRuleGroupInstancePersistence.create(ruleGroupInstanceId);
115            }
116    
117            /**
118             * Deletes the m d r rule group instance with the primary key from the database. Also notifies the appropriate model listeners.
119             *
120             * @param ruleGroupInstanceId the primary key of the m d r rule group instance
121             * @return the m d r rule group instance that was removed
122             * @throws PortalException if a m d r rule group instance with the primary key could not be found
123             */
124            @Indexable(type = IndexableType.DELETE)
125            @Override
126            public MDRRuleGroupInstance deleteMDRRuleGroupInstance(
127                    long ruleGroupInstanceId) throws PortalException {
128                    return mdrRuleGroupInstancePersistence.remove(ruleGroupInstanceId);
129            }
130    
131            /**
132             * Deletes the m d r rule group instance from the database. Also notifies the appropriate model listeners.
133             *
134             * @param mdrRuleGroupInstance the m d r rule group instance
135             * @return the m d r rule group instance that was removed
136             */
137            @Indexable(type = IndexableType.DELETE)
138            @Override
139            public MDRRuleGroupInstance deleteMDRRuleGroupInstance(
140                    MDRRuleGroupInstance mdrRuleGroupInstance) {
141                    return mdrRuleGroupInstancePersistence.remove(mdrRuleGroupInstance);
142            }
143    
144            @Override
145            public DynamicQuery dynamicQuery() {
146                    Class<?> clazz = getClass();
147    
148                    return DynamicQueryFactoryUtil.forClass(MDRRuleGroupInstance.class,
149                            clazz.getClassLoader());
150            }
151    
152            /**
153             * Performs a dynamic query on the database and returns the matching rows.
154             *
155             * @param dynamicQuery the dynamic query
156             * @return the matching rows
157             */
158            @Override
159            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
160                    return mdrRuleGroupInstancePersistence.findWithDynamicQuery(dynamicQuery);
161            }
162    
163            /**
164             * Performs a dynamic query on the database and returns a range of the matching rows.
165             *
166             * <p>
167             * 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.MDRRuleGroupInstanceModelImpl}. 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.
168             * </p>
169             *
170             * @param dynamicQuery the dynamic query
171             * @param start the lower bound of the range of model instances
172             * @param end the upper bound of the range of model instances (not inclusive)
173             * @return the range of matching rows
174             */
175            @Override
176            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
177                    int end) {
178                    return mdrRuleGroupInstancePersistence.findWithDynamicQuery(dynamicQuery,
179                            start, end);
180            }
181    
182            /**
183             * Performs a dynamic query on the database and returns an ordered range of the matching rows.
184             *
185             * <p>
186             * 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.MDRRuleGroupInstanceModelImpl}. 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.
187             * </p>
188             *
189             * @param dynamicQuery the dynamic query
190             * @param start the lower bound of the range of model instances
191             * @param end the upper bound of the range of model instances (not inclusive)
192             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
193             * @return the ordered range of matching rows
194             */
195            @Override
196            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
197                    int end, OrderByComparator<T> orderByComparator) {
198                    return mdrRuleGroupInstancePersistence.findWithDynamicQuery(dynamicQuery,
199                            start, end, orderByComparator);
200            }
201    
202            /**
203             * Returns the number of rows that match the dynamic query.
204             *
205             * @param dynamicQuery the dynamic query
206             * @return the number of rows that match the dynamic query
207             */
208            @Override
209            public long dynamicQueryCount(DynamicQuery dynamicQuery) {
210                    return mdrRuleGroupInstancePersistence.countWithDynamicQuery(dynamicQuery);
211            }
212    
213            /**
214             * Returns the number of rows that match the dynamic query.
215             *
216             * @param dynamicQuery the dynamic query
217             * @param projection the projection to apply to the query
218             * @return the number of rows that match the dynamic query
219             */
220            @Override
221            public long dynamicQueryCount(DynamicQuery dynamicQuery,
222                    Projection projection) {
223                    return mdrRuleGroupInstancePersistence.countWithDynamicQuery(dynamicQuery,
224                            projection);
225            }
226    
227            @Override
228            public MDRRuleGroupInstance fetchMDRRuleGroupInstance(
229                    long ruleGroupInstanceId) {
230                    return mdrRuleGroupInstancePersistence.fetchByPrimaryKey(ruleGroupInstanceId);
231            }
232    
233            /**
234             * Returns the m d r rule group instance matching the UUID and group.
235             *
236             * @param uuid the m d r rule group instance's UUID
237             * @param groupId the primary key of the group
238             * @return the matching m d r rule group instance, or <code>null</code> if a matching m d r rule group instance could not be found
239             */
240            @Override
241            public MDRRuleGroupInstance fetchMDRRuleGroupInstanceByUuidAndGroupId(
242                    String uuid, long groupId) {
243                    return mdrRuleGroupInstancePersistence.fetchByUUID_G(uuid, groupId);
244            }
245    
246            /**
247             * Returns the m d r rule group instance with the primary key.
248             *
249             * @param ruleGroupInstanceId the primary key of the m d r rule group instance
250             * @return the m d r rule group instance
251             * @throws PortalException if a m d r rule group instance with the primary key could not be found
252             */
253            @Override
254            public MDRRuleGroupInstance getMDRRuleGroupInstance(
255                    long ruleGroupInstanceId) throws PortalException {
256                    return mdrRuleGroupInstancePersistence.findByPrimaryKey(ruleGroupInstanceId);
257            }
258    
259            @Override
260            public ActionableDynamicQuery getActionableDynamicQuery() {
261                    ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
262    
263                    actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceLocalServiceUtil.getService());
264                    actionableDynamicQuery.setClass(MDRRuleGroupInstance.class);
265                    actionableDynamicQuery.setClassLoader(getClassLoader());
266    
267                    actionableDynamicQuery.setPrimaryKeyPropertyName("ruleGroupInstanceId");
268    
269                    return actionableDynamicQuery;
270            }
271    
272            protected void initActionableDynamicQuery(
273                    ActionableDynamicQuery actionableDynamicQuery) {
274                    actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceLocalServiceUtil.getService());
275                    actionableDynamicQuery.setClass(MDRRuleGroupInstance.class);
276                    actionableDynamicQuery.setClassLoader(getClassLoader());
277    
278                    actionableDynamicQuery.setPrimaryKeyPropertyName("ruleGroupInstanceId");
279            }
280    
281            @Override
282            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
283                    final PortletDataContext portletDataContext) {
284                    final ExportActionableDynamicQuery exportActionableDynamicQuery = new ExportActionableDynamicQuery() {
285                                    @Override
286                                    public long performCount() throws PortalException {
287                                            ManifestSummary manifestSummary = portletDataContext.getManifestSummary();
288    
289                                            StagedModelType stagedModelType = getStagedModelType();
290    
291                                            long modelAdditionCount = super.performCount();
292    
293                                            manifestSummary.addModelAdditionCount(stagedModelType.toString(),
294                                                    modelAdditionCount);
295    
296                                            long modelDeletionCount = ExportImportHelperUtil.getModelDeletionCount(portletDataContext,
297                                                            stagedModelType);
298    
299                                            manifestSummary.addModelDeletionCount(stagedModelType.toString(),
300                                                    modelDeletionCount);
301    
302                                            return modelAdditionCount;
303                                    }
304                            };
305    
306                    initActionableDynamicQuery(exportActionableDynamicQuery);
307    
308                    exportActionableDynamicQuery.setAddCriteriaMethod(new ActionableDynamicQuery.AddCriteriaMethod() {
309                                    @Override
310                                    public void addCriteria(DynamicQuery dynamicQuery) {
311                                            portletDataContext.addDateRangeCriteria(dynamicQuery,
312                                                    "modifiedDate");
313    
314                                            StagedModelType stagedModelType = exportActionableDynamicQuery.getStagedModelType();
315    
316                                            if (stagedModelType.getReferrerClassNameId() >= 0) {
317                                                    Property classNameIdProperty = PropertyFactoryUtil.forName(
318                                                                    "classNameId");
319    
320                                                    dynamicQuery.add(classNameIdProperty.eq(
321                                                                    stagedModelType.getReferrerClassNameId()));
322                                            }
323                                    }
324                            });
325    
326                    exportActionableDynamicQuery.setCompanyId(portletDataContext.getCompanyId());
327    
328                    exportActionableDynamicQuery.setGroupId(portletDataContext.getScopeGroupId());
329    
330                    exportActionableDynamicQuery.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod() {
331                                    @Override
332                                    public void performAction(Object object)
333                                            throws PortalException {
334                                            MDRRuleGroupInstance stagedModel = (MDRRuleGroupInstance)object;
335    
336                                            StagedModelDataHandlerUtil.exportStagedModel(portletDataContext,
337                                                    stagedModel);
338                                    }
339                            });
340                    exportActionableDynamicQuery.setStagedModelType(new StagedModelType(
341                                    PortalUtil.getClassNameId(MDRRuleGroupInstance.class.getName())));
342    
343                    return exportActionableDynamicQuery;
344            }
345    
346            /**
347             * @throws PortalException
348             */
349            @Override
350            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
351                    throws PortalException {
352                    return mdrRuleGroupInstanceLocalService.deleteMDRRuleGroupInstance((MDRRuleGroupInstance)persistedModel);
353            }
354    
355            @Override
356            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
357                    throws PortalException {
358                    return mdrRuleGroupInstancePersistence.findByPrimaryKey(primaryKeyObj);
359            }
360    
361            @Override
362            public List<MDRRuleGroupInstance> getMDRRuleGroupInstancesByUuidAndCompanyId(
363                    String uuid, long companyId) {
364                    return mdrRuleGroupInstancePersistence.findByUuid_C(uuid, companyId);
365            }
366    
367            @Override
368            public List<MDRRuleGroupInstance> getMDRRuleGroupInstancesByUuidAndCompanyId(
369                    String uuid, long companyId, int start, int end,
370                    OrderByComparator<MDRRuleGroupInstance> orderByComparator) {
371                    return mdrRuleGroupInstancePersistence.findByUuid_C(uuid, companyId,
372                            start, end, orderByComparator);
373            }
374    
375            /**
376             * Returns the m d r rule group instance matching the UUID and group.
377             *
378             * @param uuid the m d r rule group instance's UUID
379             * @param groupId the primary key of the group
380             * @return the matching m d r rule group instance
381             * @throws PortalException if a matching m d r rule group instance could not be found
382             */
383            @Override
384            public MDRRuleGroupInstance getMDRRuleGroupInstanceByUuidAndGroupId(
385                    String uuid, long groupId) throws PortalException {
386                    return mdrRuleGroupInstancePersistence.findByUUID_G(uuid, groupId);
387            }
388    
389            /**
390             * Returns a range of all the m d r rule group instances.
391             *
392             * <p>
393             * 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.MDRRuleGroupInstanceModelImpl}. 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.
394             * </p>
395             *
396             * @param start the lower bound of the range of m d r rule group instances
397             * @param end the upper bound of the range of m d r rule group instances (not inclusive)
398             * @return the range of m d r rule group instances
399             */
400            @Override
401            public List<MDRRuleGroupInstance> getMDRRuleGroupInstances(int start,
402                    int end) {
403                    return mdrRuleGroupInstancePersistence.findAll(start, end);
404            }
405    
406            /**
407             * Returns the number of m d r rule group instances.
408             *
409             * @return the number of m d r rule group instances
410             */
411            @Override
412            public int getMDRRuleGroupInstancesCount() {
413                    return mdrRuleGroupInstancePersistence.countAll();
414            }
415    
416            /**
417             * Updates the m d r rule group instance in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
418             *
419             * @param mdrRuleGroupInstance the m d r rule group instance
420             * @return the m d r rule group instance that was updated
421             */
422            @Indexable(type = IndexableType.REINDEX)
423            @Override
424            public MDRRuleGroupInstance updateMDRRuleGroupInstance(
425                    MDRRuleGroupInstance mdrRuleGroupInstance) {
426                    return mdrRuleGroupInstancePersistence.update(mdrRuleGroupInstance);
427            }
428    
429            /**
430             * Returns the m d r rule group instance local service.
431             *
432             * @return the m d r rule group instance local service
433             */
434            public com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceLocalService getMDRRuleGroupInstanceLocalService() {
435                    return mdrRuleGroupInstanceLocalService;
436            }
437    
438            /**
439             * Sets the m d r rule group instance local service.
440             *
441             * @param mdrRuleGroupInstanceLocalService the m d r rule group instance local service
442             */
443            public void setMDRRuleGroupInstanceLocalService(
444                    com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceLocalService mdrRuleGroupInstanceLocalService) {
445                    this.mdrRuleGroupInstanceLocalService = mdrRuleGroupInstanceLocalService;
446            }
447    
448            /**
449             * Returns the m d r rule group instance remote service.
450             *
451             * @return the m d r rule group instance remote service
452             */
453            public com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceService getMDRRuleGroupInstanceService() {
454                    return mdrRuleGroupInstanceService;
455            }
456    
457            /**
458             * Sets the m d r rule group instance remote service.
459             *
460             * @param mdrRuleGroupInstanceService the m d r rule group instance remote service
461             */
462            public void setMDRRuleGroupInstanceService(
463                    com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceService mdrRuleGroupInstanceService) {
464                    this.mdrRuleGroupInstanceService = mdrRuleGroupInstanceService;
465            }
466    
467            /**
468             * Returns the m d r rule group instance persistence.
469             *
470             * @return the m d r rule group instance persistence
471             */
472            public MDRRuleGroupInstancePersistence getMDRRuleGroupInstancePersistence() {
473                    return mdrRuleGroupInstancePersistence;
474            }
475    
476            /**
477             * Sets the m d r rule group instance persistence.
478             *
479             * @param mdrRuleGroupInstancePersistence the m d r rule group instance persistence
480             */
481            public void setMDRRuleGroupInstancePersistence(
482                    MDRRuleGroupInstancePersistence mdrRuleGroupInstancePersistence) {
483                    this.mdrRuleGroupInstancePersistence = mdrRuleGroupInstancePersistence;
484            }
485    
486            /**
487             * Returns the counter local service.
488             *
489             * @return the counter local service
490             */
491            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
492                    return counterLocalService;
493            }
494    
495            /**
496             * Sets the counter local service.
497             *
498             * @param counterLocalService the counter local service
499             */
500            public void setCounterLocalService(
501                    com.liferay.counter.service.CounterLocalService counterLocalService) {
502                    this.counterLocalService = counterLocalService;
503            }
504    
505            /**
506             * Returns the class name local service.
507             *
508             * @return the class name local service
509             */
510            public com.liferay.portal.service.ClassNameLocalService getClassNameLocalService() {
511                    return classNameLocalService;
512            }
513    
514            /**
515             * Sets the class name local service.
516             *
517             * @param classNameLocalService the class name local service
518             */
519            public void setClassNameLocalService(
520                    com.liferay.portal.service.ClassNameLocalService classNameLocalService) {
521                    this.classNameLocalService = classNameLocalService;
522            }
523    
524            /**
525             * Returns the class name remote service.
526             *
527             * @return the class name remote service
528             */
529            public com.liferay.portal.service.ClassNameService getClassNameService() {
530                    return classNameService;
531            }
532    
533            /**
534             * Sets the class name remote service.
535             *
536             * @param classNameService the class name remote service
537             */
538            public void setClassNameService(
539                    com.liferay.portal.service.ClassNameService classNameService) {
540                    this.classNameService = classNameService;
541            }
542    
543            /**
544             * Returns the class name persistence.
545             *
546             * @return the class name persistence
547             */
548            public ClassNamePersistence getClassNamePersistence() {
549                    return classNamePersistence;
550            }
551    
552            /**
553             * Sets the class name persistence.
554             *
555             * @param classNamePersistence the class name persistence
556             */
557            public void setClassNamePersistence(
558                    ClassNamePersistence classNamePersistence) {
559                    this.classNamePersistence = classNamePersistence;
560            }
561    
562            /**
563             * Returns the layout local service.
564             *
565             * @return the layout local service
566             */
567            public com.liferay.portal.service.LayoutLocalService getLayoutLocalService() {
568                    return layoutLocalService;
569            }
570    
571            /**
572             * Sets the layout local service.
573             *
574             * @param layoutLocalService the layout local service
575             */
576            public void setLayoutLocalService(
577                    com.liferay.portal.service.LayoutLocalService layoutLocalService) {
578                    this.layoutLocalService = layoutLocalService;
579            }
580    
581            /**
582             * Returns the layout remote service.
583             *
584             * @return the layout remote service
585             */
586            public com.liferay.portal.service.LayoutService getLayoutService() {
587                    return layoutService;
588            }
589    
590            /**
591             * Sets the layout remote service.
592             *
593             * @param layoutService the layout remote service
594             */
595            public void setLayoutService(
596                    com.liferay.portal.service.LayoutService layoutService) {
597                    this.layoutService = layoutService;
598            }
599    
600            /**
601             * Returns the layout persistence.
602             *
603             * @return the layout persistence
604             */
605            public LayoutPersistence getLayoutPersistence() {
606                    return layoutPersistence;
607            }
608    
609            /**
610             * Sets the layout persistence.
611             *
612             * @param layoutPersistence the layout persistence
613             */
614            public void setLayoutPersistence(LayoutPersistence layoutPersistence) {
615                    this.layoutPersistence = layoutPersistence;
616            }
617    
618            /**
619             * Returns the layout finder.
620             *
621             * @return the layout finder
622             */
623            public LayoutFinder getLayoutFinder() {
624                    return layoutFinder;
625            }
626    
627            /**
628             * Sets the layout finder.
629             *
630             * @param layoutFinder the layout finder
631             */
632            public void setLayoutFinder(LayoutFinder layoutFinder) {
633                    this.layoutFinder = layoutFinder;
634            }
635    
636            /**
637             * Returns the layout set local service.
638             *
639             * @return the layout set local service
640             */
641            public com.liferay.portal.service.LayoutSetLocalService getLayoutSetLocalService() {
642                    return layoutSetLocalService;
643            }
644    
645            /**
646             * Sets the layout set local service.
647             *
648             * @param layoutSetLocalService the layout set local service
649             */
650            public void setLayoutSetLocalService(
651                    com.liferay.portal.service.LayoutSetLocalService layoutSetLocalService) {
652                    this.layoutSetLocalService = layoutSetLocalService;
653            }
654    
655            /**
656             * Returns the layout set remote service.
657             *
658             * @return the layout set remote service
659             */
660            public com.liferay.portal.service.LayoutSetService getLayoutSetService() {
661                    return layoutSetService;
662            }
663    
664            /**
665             * Sets the layout set remote service.
666             *
667             * @param layoutSetService the layout set remote service
668             */
669            public void setLayoutSetService(
670                    com.liferay.portal.service.LayoutSetService layoutSetService) {
671                    this.layoutSetService = layoutSetService;
672            }
673    
674            /**
675             * Returns the layout set persistence.
676             *
677             * @return the layout set persistence
678             */
679            public LayoutSetPersistence getLayoutSetPersistence() {
680                    return layoutSetPersistence;
681            }
682    
683            /**
684             * Sets the layout set persistence.
685             *
686             * @param layoutSetPersistence the layout set persistence
687             */
688            public void setLayoutSetPersistence(
689                    LayoutSetPersistence layoutSetPersistence) {
690                    this.layoutSetPersistence = layoutSetPersistence;
691            }
692    
693            /**
694             * Returns the system event local service.
695             *
696             * @return the system event local service
697             */
698            public com.liferay.portal.service.SystemEventLocalService getSystemEventLocalService() {
699                    return systemEventLocalService;
700            }
701    
702            /**
703             * Sets the system event local service.
704             *
705             * @param systemEventLocalService the system event local service
706             */
707            public void setSystemEventLocalService(
708                    com.liferay.portal.service.SystemEventLocalService systemEventLocalService) {
709                    this.systemEventLocalService = systemEventLocalService;
710            }
711    
712            /**
713             * Returns the system event persistence.
714             *
715             * @return the system event persistence
716             */
717            public SystemEventPersistence getSystemEventPersistence() {
718                    return systemEventPersistence;
719            }
720    
721            /**
722             * Sets the system event persistence.
723             *
724             * @param systemEventPersistence the system event persistence
725             */
726            public void setSystemEventPersistence(
727                    SystemEventPersistence systemEventPersistence) {
728                    this.systemEventPersistence = systemEventPersistence;
729            }
730    
731            /**
732             * Returns the user local service.
733             *
734             * @return the user local service
735             */
736            public com.liferay.portal.service.UserLocalService getUserLocalService() {
737                    return userLocalService;
738            }
739    
740            /**
741             * Sets the user local service.
742             *
743             * @param userLocalService the user local service
744             */
745            public void setUserLocalService(
746                    com.liferay.portal.service.UserLocalService userLocalService) {
747                    this.userLocalService = userLocalService;
748            }
749    
750            /**
751             * Returns the user remote service.
752             *
753             * @return the user remote service
754             */
755            public com.liferay.portal.service.UserService getUserService() {
756                    return userService;
757            }
758    
759            /**
760             * Sets the user remote service.
761             *
762             * @param userService the user remote service
763             */
764            public void setUserService(
765                    com.liferay.portal.service.UserService userService) {
766                    this.userService = userService;
767            }
768    
769            /**
770             * Returns the user persistence.
771             *
772             * @return the user persistence
773             */
774            public UserPersistence getUserPersistence() {
775                    return userPersistence;
776            }
777    
778            /**
779             * Sets the user persistence.
780             *
781             * @param userPersistence the user persistence
782             */
783            public void setUserPersistence(UserPersistence userPersistence) {
784                    this.userPersistence = userPersistence;
785            }
786    
787            /**
788             * Returns the user finder.
789             *
790             * @return the user finder
791             */
792            public UserFinder getUserFinder() {
793                    return userFinder;
794            }
795    
796            /**
797             * Sets the user finder.
798             *
799             * @param userFinder the user finder
800             */
801            public void setUserFinder(UserFinder userFinder) {
802                    this.userFinder = userFinder;
803            }
804    
805            /**
806             * Returns the m d r action local service.
807             *
808             * @return the m d r action local service
809             */
810            public com.liferay.portlet.mobiledevicerules.service.MDRActionLocalService getMDRActionLocalService() {
811                    return mdrActionLocalService;
812            }
813    
814            /**
815             * Sets the m d r action local service.
816             *
817             * @param mdrActionLocalService the m d r action local service
818             */
819            public void setMDRActionLocalService(
820                    com.liferay.portlet.mobiledevicerules.service.MDRActionLocalService mdrActionLocalService) {
821                    this.mdrActionLocalService = mdrActionLocalService;
822            }
823    
824            /**
825             * Returns the m d r action remote service.
826             *
827             * @return the m d r action remote service
828             */
829            public com.liferay.portlet.mobiledevicerules.service.MDRActionService getMDRActionService() {
830                    return mdrActionService;
831            }
832    
833            /**
834             * Sets the m d r action remote service.
835             *
836             * @param mdrActionService the m d r action remote service
837             */
838            public void setMDRActionService(
839                    com.liferay.portlet.mobiledevicerules.service.MDRActionService mdrActionService) {
840                    this.mdrActionService = mdrActionService;
841            }
842    
843            /**
844             * Returns the m d r action persistence.
845             *
846             * @return the m d r action persistence
847             */
848            public MDRActionPersistence getMDRActionPersistence() {
849                    return mdrActionPersistence;
850            }
851    
852            /**
853             * Sets the m d r action persistence.
854             *
855             * @param mdrActionPersistence the m d r action persistence
856             */
857            public void setMDRActionPersistence(
858                    MDRActionPersistence mdrActionPersistence) {
859                    this.mdrActionPersistence = mdrActionPersistence;
860            }
861    
862            /**
863             * Returns the m d r rule group local service.
864             *
865             * @return the m d r rule group local service
866             */
867            public com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalService getMDRRuleGroupLocalService() {
868                    return mdrRuleGroupLocalService;
869            }
870    
871            /**
872             * Sets the m d r rule group local service.
873             *
874             * @param mdrRuleGroupLocalService the m d r rule group local service
875             */
876            public void setMDRRuleGroupLocalService(
877                    com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalService mdrRuleGroupLocalService) {
878                    this.mdrRuleGroupLocalService = mdrRuleGroupLocalService;
879            }
880    
881            /**
882             * Returns the m d r rule group remote service.
883             *
884             * @return the m d r rule group remote service
885             */
886            public com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupService getMDRRuleGroupService() {
887                    return mdrRuleGroupService;
888            }
889    
890            /**
891             * Sets the m d r rule group remote service.
892             *
893             * @param mdrRuleGroupService the m d r rule group remote service
894             */
895            public void setMDRRuleGroupService(
896                    com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupService mdrRuleGroupService) {
897                    this.mdrRuleGroupService = mdrRuleGroupService;
898            }
899    
900            /**
901             * Returns the m d r rule group persistence.
902             *
903             * @return the m d r rule group persistence
904             */
905            public MDRRuleGroupPersistence getMDRRuleGroupPersistence() {
906                    return mdrRuleGroupPersistence;
907            }
908    
909            /**
910             * Sets the m d r rule group persistence.
911             *
912             * @param mdrRuleGroupPersistence the m d r rule group persistence
913             */
914            public void setMDRRuleGroupPersistence(
915                    MDRRuleGroupPersistence mdrRuleGroupPersistence) {
916                    this.mdrRuleGroupPersistence = mdrRuleGroupPersistence;
917            }
918    
919            /**
920             * Returns the m d r rule group finder.
921             *
922             * @return the m d r rule group finder
923             */
924            public MDRRuleGroupFinder getMDRRuleGroupFinder() {
925                    return mdrRuleGroupFinder;
926            }
927    
928            /**
929             * Sets the m d r rule group finder.
930             *
931             * @param mdrRuleGroupFinder the m d r rule group finder
932             */
933            public void setMDRRuleGroupFinder(MDRRuleGroupFinder mdrRuleGroupFinder) {
934                    this.mdrRuleGroupFinder = mdrRuleGroupFinder;
935            }
936    
937            public void afterPropertiesSet() {
938                    persistedModelLocalServiceRegistry.register("com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupInstance",
939                            mdrRuleGroupInstanceLocalService);
940            }
941    
942            public void destroy() {
943                    persistedModelLocalServiceRegistry.unregister(
944                            "com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupInstance");
945            }
946    
947            /**
948             * Returns the Spring bean ID for this bean.
949             *
950             * @return the Spring bean ID for this bean
951             */
952            @Override
953            public String getBeanIdentifier() {
954                    return _beanIdentifier;
955            }
956    
957            /**
958             * Sets the Spring bean ID for this bean.
959             *
960             * @param beanIdentifier the Spring bean ID for this bean
961             */
962            @Override
963            public void setBeanIdentifier(String beanIdentifier) {
964                    _beanIdentifier = beanIdentifier;
965            }
966    
967            protected Class<?> getModelClass() {
968                    return MDRRuleGroupInstance.class;
969            }
970    
971            protected String getModelClassName() {
972                    return MDRRuleGroupInstance.class.getName();
973            }
974    
975            /**
976             * Performs a SQL query.
977             *
978             * @param sql the sql query
979             */
980            protected void runSQL(String sql) {
981                    try {
982                            DataSource dataSource = mdrRuleGroupInstancePersistence.getDataSource();
983    
984                            DB db = DBFactoryUtil.getDB();
985    
986                            sql = db.buildSQL(sql);
987                            sql = PortalUtil.transformSQL(sql);
988    
989                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
990                                            sql, new int[0]);
991    
992                            sqlUpdate.update();
993                    }
994                    catch (Exception e) {
995                            throw new SystemException(e);
996                    }
997            }
998    
999            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceLocalService.class)
1000            protected com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceLocalService mdrRuleGroupInstanceLocalService;
1001            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceService.class)
1002            protected com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceService mdrRuleGroupInstanceService;
1003            @BeanReference(type = MDRRuleGroupInstancePersistence.class)
1004            protected MDRRuleGroupInstancePersistence mdrRuleGroupInstancePersistence;
1005            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
1006            protected com.liferay.counter.service.CounterLocalService counterLocalService;
1007            @BeanReference(type = com.liferay.portal.service.ClassNameLocalService.class)
1008            protected com.liferay.portal.service.ClassNameLocalService classNameLocalService;
1009            @BeanReference(type = com.liferay.portal.service.ClassNameService.class)
1010            protected com.liferay.portal.service.ClassNameService classNameService;
1011            @BeanReference(type = ClassNamePersistence.class)
1012            protected ClassNamePersistence classNamePersistence;
1013            @BeanReference(type = com.liferay.portal.service.LayoutLocalService.class)
1014            protected com.liferay.portal.service.LayoutLocalService layoutLocalService;
1015            @BeanReference(type = com.liferay.portal.service.LayoutService.class)
1016            protected com.liferay.portal.service.LayoutService layoutService;
1017            @BeanReference(type = LayoutPersistence.class)
1018            protected LayoutPersistence layoutPersistence;
1019            @BeanReference(type = LayoutFinder.class)
1020            protected LayoutFinder layoutFinder;
1021            @BeanReference(type = com.liferay.portal.service.LayoutSetLocalService.class)
1022            protected com.liferay.portal.service.LayoutSetLocalService layoutSetLocalService;
1023            @BeanReference(type = com.liferay.portal.service.LayoutSetService.class)
1024            protected com.liferay.portal.service.LayoutSetService layoutSetService;
1025            @BeanReference(type = LayoutSetPersistence.class)
1026            protected LayoutSetPersistence layoutSetPersistence;
1027            @BeanReference(type = com.liferay.portal.service.SystemEventLocalService.class)
1028            protected com.liferay.portal.service.SystemEventLocalService systemEventLocalService;
1029            @BeanReference(type = SystemEventPersistence.class)
1030            protected SystemEventPersistence systemEventPersistence;
1031            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
1032            protected com.liferay.portal.service.UserLocalService userLocalService;
1033            @BeanReference(type = com.liferay.portal.service.UserService.class)
1034            protected com.liferay.portal.service.UserService userService;
1035            @BeanReference(type = UserPersistence.class)
1036            protected UserPersistence userPersistence;
1037            @BeanReference(type = UserFinder.class)
1038            protected UserFinder userFinder;
1039            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRActionLocalService.class)
1040            protected com.liferay.portlet.mobiledevicerules.service.MDRActionLocalService mdrActionLocalService;
1041            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRActionService.class)
1042            protected com.liferay.portlet.mobiledevicerules.service.MDRActionService mdrActionService;
1043            @BeanReference(type = MDRActionPersistence.class)
1044            protected MDRActionPersistence mdrActionPersistence;
1045            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalService.class)
1046            protected com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalService mdrRuleGroupLocalService;
1047            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupService.class)
1048            protected com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupService mdrRuleGroupService;
1049            @BeanReference(type = MDRRuleGroupPersistence.class)
1050            protected MDRRuleGroupPersistence mdrRuleGroupPersistence;
1051            @BeanReference(type = MDRRuleGroupFinder.class)
1052            protected MDRRuleGroupFinder mdrRuleGroupFinder;
1053            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
1054            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
1055            private String _beanIdentifier;
1056    }