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 matching the dynamic query.
204             *
205             * @param dynamicQuery the dynamic query
206             * @return the number of rows matching 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 matching 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 matching 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            /**
362             * Returns all the m d r rule group instances matching the UUID and company.
363             *
364             * @param uuid the UUID of the m d r rule group instances
365             * @param companyId the primary key of the company
366             * @return the matching m d r rule group instances, or an empty list if no matches were found
367             */
368            @Override
369            public List<MDRRuleGroupInstance> getMDRRuleGroupInstancesByUuidAndCompanyId(
370                    String uuid, long companyId) {
371                    return mdrRuleGroupInstancePersistence.findByUuid_C(uuid, companyId);
372            }
373    
374            /**
375             * Returns a range of m d r rule group instances matching the UUID and company.
376             *
377             * @param uuid the UUID of the m d r rule group instances
378             * @param companyId the primary key of the company
379             * @param start the lower bound of the range of m d r rule group instances
380             * @param end the upper bound of the range of m d r rule group instances (not inclusive)
381             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
382             * @return the range of matching m d r rule group instances, or an empty list if no matches were found
383             */
384            @Override
385            public List<MDRRuleGroupInstance> getMDRRuleGroupInstancesByUuidAndCompanyId(
386                    String uuid, long companyId, int start, int end,
387                    OrderByComparator<MDRRuleGroupInstance> orderByComparator) {
388                    return mdrRuleGroupInstancePersistence.findByUuid_C(uuid, companyId,
389                            start, end, orderByComparator);
390            }
391    
392            /**
393             * Returns the m d r rule group instance matching the UUID and group.
394             *
395             * @param uuid the m d r rule group instance's UUID
396             * @param groupId the primary key of the group
397             * @return the matching m d r rule group instance
398             * @throws PortalException if a matching m d r rule group instance could not be found
399             */
400            @Override
401            public MDRRuleGroupInstance getMDRRuleGroupInstanceByUuidAndGroupId(
402                    String uuid, long groupId) throws PortalException {
403                    return mdrRuleGroupInstancePersistence.findByUUID_G(uuid, groupId);
404            }
405    
406            /**
407             * Returns a range of all the m d r rule group instances.
408             *
409             * <p>
410             * 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.
411             * </p>
412             *
413             * @param start the lower bound of the range of m d r rule group instances
414             * @param end the upper bound of the range of m d r rule group instances (not inclusive)
415             * @return the range of m d r rule group instances
416             */
417            @Override
418            public List<MDRRuleGroupInstance> getMDRRuleGroupInstances(int start,
419                    int end) {
420                    return mdrRuleGroupInstancePersistence.findAll(start, end);
421            }
422    
423            /**
424             * Returns the number of m d r rule group instances.
425             *
426             * @return the number of m d r rule group instances
427             */
428            @Override
429            public int getMDRRuleGroupInstancesCount() {
430                    return mdrRuleGroupInstancePersistence.countAll();
431            }
432    
433            /**
434             * 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.
435             *
436             * @param mdrRuleGroupInstance the m d r rule group instance
437             * @return the m d r rule group instance that was updated
438             */
439            @Indexable(type = IndexableType.REINDEX)
440            @Override
441            public MDRRuleGroupInstance updateMDRRuleGroupInstance(
442                    MDRRuleGroupInstance mdrRuleGroupInstance) {
443                    return mdrRuleGroupInstancePersistence.update(mdrRuleGroupInstance);
444            }
445    
446            /**
447             * Returns the m d r rule group instance local service.
448             *
449             * @return the m d r rule group instance local service
450             */
451            public com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceLocalService getMDRRuleGroupInstanceLocalService() {
452                    return mdrRuleGroupInstanceLocalService;
453            }
454    
455            /**
456             * Sets the m d r rule group instance local service.
457             *
458             * @param mdrRuleGroupInstanceLocalService the m d r rule group instance local service
459             */
460            public void setMDRRuleGroupInstanceLocalService(
461                    com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceLocalService mdrRuleGroupInstanceLocalService) {
462                    this.mdrRuleGroupInstanceLocalService = mdrRuleGroupInstanceLocalService;
463            }
464    
465            /**
466             * Returns the m d r rule group instance remote service.
467             *
468             * @return the m d r rule group instance remote service
469             */
470            public com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceService getMDRRuleGroupInstanceService() {
471                    return mdrRuleGroupInstanceService;
472            }
473    
474            /**
475             * Sets the m d r rule group instance remote service.
476             *
477             * @param mdrRuleGroupInstanceService the m d r rule group instance remote service
478             */
479            public void setMDRRuleGroupInstanceService(
480                    com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceService mdrRuleGroupInstanceService) {
481                    this.mdrRuleGroupInstanceService = mdrRuleGroupInstanceService;
482            }
483    
484            /**
485             * Returns the m d r rule group instance persistence.
486             *
487             * @return the m d r rule group instance persistence
488             */
489            public MDRRuleGroupInstancePersistence getMDRRuleGroupInstancePersistence() {
490                    return mdrRuleGroupInstancePersistence;
491            }
492    
493            /**
494             * Sets the m d r rule group instance persistence.
495             *
496             * @param mdrRuleGroupInstancePersistence the m d r rule group instance persistence
497             */
498            public void setMDRRuleGroupInstancePersistence(
499                    MDRRuleGroupInstancePersistence mdrRuleGroupInstancePersistence) {
500                    this.mdrRuleGroupInstancePersistence = mdrRuleGroupInstancePersistence;
501            }
502    
503            /**
504             * Returns the counter local service.
505             *
506             * @return the counter local service
507             */
508            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
509                    return counterLocalService;
510            }
511    
512            /**
513             * Sets the counter local service.
514             *
515             * @param counterLocalService the counter local service
516             */
517            public void setCounterLocalService(
518                    com.liferay.counter.service.CounterLocalService counterLocalService) {
519                    this.counterLocalService = counterLocalService;
520            }
521    
522            /**
523             * Returns the class name local service.
524             *
525             * @return the class name local service
526             */
527            public com.liferay.portal.service.ClassNameLocalService getClassNameLocalService() {
528                    return classNameLocalService;
529            }
530    
531            /**
532             * Sets the class name local service.
533             *
534             * @param classNameLocalService the class name local service
535             */
536            public void setClassNameLocalService(
537                    com.liferay.portal.service.ClassNameLocalService classNameLocalService) {
538                    this.classNameLocalService = classNameLocalService;
539            }
540    
541            /**
542             * Returns the class name remote service.
543             *
544             * @return the class name remote service
545             */
546            public com.liferay.portal.service.ClassNameService getClassNameService() {
547                    return classNameService;
548            }
549    
550            /**
551             * Sets the class name remote service.
552             *
553             * @param classNameService the class name remote service
554             */
555            public void setClassNameService(
556                    com.liferay.portal.service.ClassNameService classNameService) {
557                    this.classNameService = classNameService;
558            }
559    
560            /**
561             * Returns the class name persistence.
562             *
563             * @return the class name persistence
564             */
565            public ClassNamePersistence getClassNamePersistence() {
566                    return classNamePersistence;
567            }
568    
569            /**
570             * Sets the class name persistence.
571             *
572             * @param classNamePersistence the class name persistence
573             */
574            public void setClassNamePersistence(
575                    ClassNamePersistence classNamePersistence) {
576                    this.classNamePersistence = classNamePersistence;
577            }
578    
579            /**
580             * Returns the layout local service.
581             *
582             * @return the layout local service
583             */
584            public com.liferay.portal.service.LayoutLocalService getLayoutLocalService() {
585                    return layoutLocalService;
586            }
587    
588            /**
589             * Sets the layout local service.
590             *
591             * @param layoutLocalService the layout local service
592             */
593            public void setLayoutLocalService(
594                    com.liferay.portal.service.LayoutLocalService layoutLocalService) {
595                    this.layoutLocalService = layoutLocalService;
596            }
597    
598            /**
599             * Returns the layout remote service.
600             *
601             * @return the layout remote service
602             */
603            public com.liferay.portal.service.LayoutService getLayoutService() {
604                    return layoutService;
605            }
606    
607            /**
608             * Sets the layout remote service.
609             *
610             * @param layoutService the layout remote service
611             */
612            public void setLayoutService(
613                    com.liferay.portal.service.LayoutService layoutService) {
614                    this.layoutService = layoutService;
615            }
616    
617            /**
618             * Returns the layout persistence.
619             *
620             * @return the layout persistence
621             */
622            public LayoutPersistence getLayoutPersistence() {
623                    return layoutPersistence;
624            }
625    
626            /**
627             * Sets the layout persistence.
628             *
629             * @param layoutPersistence the layout persistence
630             */
631            public void setLayoutPersistence(LayoutPersistence layoutPersistence) {
632                    this.layoutPersistence = layoutPersistence;
633            }
634    
635            /**
636             * Returns the layout finder.
637             *
638             * @return the layout finder
639             */
640            public LayoutFinder getLayoutFinder() {
641                    return layoutFinder;
642            }
643    
644            /**
645             * Sets the layout finder.
646             *
647             * @param layoutFinder the layout finder
648             */
649            public void setLayoutFinder(LayoutFinder layoutFinder) {
650                    this.layoutFinder = layoutFinder;
651            }
652    
653            /**
654             * Returns the layout set local service.
655             *
656             * @return the layout set local service
657             */
658            public com.liferay.portal.service.LayoutSetLocalService getLayoutSetLocalService() {
659                    return layoutSetLocalService;
660            }
661    
662            /**
663             * Sets the layout set local service.
664             *
665             * @param layoutSetLocalService the layout set local service
666             */
667            public void setLayoutSetLocalService(
668                    com.liferay.portal.service.LayoutSetLocalService layoutSetLocalService) {
669                    this.layoutSetLocalService = layoutSetLocalService;
670            }
671    
672            /**
673             * Returns the layout set remote service.
674             *
675             * @return the layout set remote service
676             */
677            public com.liferay.portal.service.LayoutSetService getLayoutSetService() {
678                    return layoutSetService;
679            }
680    
681            /**
682             * Sets the layout set remote service.
683             *
684             * @param layoutSetService the layout set remote service
685             */
686            public void setLayoutSetService(
687                    com.liferay.portal.service.LayoutSetService layoutSetService) {
688                    this.layoutSetService = layoutSetService;
689            }
690    
691            /**
692             * Returns the layout set persistence.
693             *
694             * @return the layout set persistence
695             */
696            public LayoutSetPersistence getLayoutSetPersistence() {
697                    return layoutSetPersistence;
698            }
699    
700            /**
701             * Sets the layout set persistence.
702             *
703             * @param layoutSetPersistence the layout set persistence
704             */
705            public void setLayoutSetPersistence(
706                    LayoutSetPersistence layoutSetPersistence) {
707                    this.layoutSetPersistence = layoutSetPersistence;
708            }
709    
710            /**
711             * Returns the system event local service.
712             *
713             * @return the system event local service
714             */
715            public com.liferay.portal.service.SystemEventLocalService getSystemEventLocalService() {
716                    return systemEventLocalService;
717            }
718    
719            /**
720             * Sets the system event local service.
721             *
722             * @param systemEventLocalService the system event local service
723             */
724            public void setSystemEventLocalService(
725                    com.liferay.portal.service.SystemEventLocalService systemEventLocalService) {
726                    this.systemEventLocalService = systemEventLocalService;
727            }
728    
729            /**
730             * Returns the system event persistence.
731             *
732             * @return the system event persistence
733             */
734            public SystemEventPersistence getSystemEventPersistence() {
735                    return systemEventPersistence;
736            }
737    
738            /**
739             * Sets the system event persistence.
740             *
741             * @param systemEventPersistence the system event persistence
742             */
743            public void setSystemEventPersistence(
744                    SystemEventPersistence systemEventPersistence) {
745                    this.systemEventPersistence = systemEventPersistence;
746            }
747    
748            /**
749             * Returns the user local service.
750             *
751             * @return the user local service
752             */
753            public com.liferay.portal.service.UserLocalService getUserLocalService() {
754                    return userLocalService;
755            }
756    
757            /**
758             * Sets the user local service.
759             *
760             * @param userLocalService the user local service
761             */
762            public void setUserLocalService(
763                    com.liferay.portal.service.UserLocalService userLocalService) {
764                    this.userLocalService = userLocalService;
765            }
766    
767            /**
768             * Returns the user remote service.
769             *
770             * @return the user remote service
771             */
772            public com.liferay.portal.service.UserService getUserService() {
773                    return userService;
774            }
775    
776            /**
777             * Sets the user remote service.
778             *
779             * @param userService the user remote service
780             */
781            public void setUserService(
782                    com.liferay.portal.service.UserService userService) {
783                    this.userService = userService;
784            }
785    
786            /**
787             * Returns the user persistence.
788             *
789             * @return the user persistence
790             */
791            public UserPersistence getUserPersistence() {
792                    return userPersistence;
793            }
794    
795            /**
796             * Sets the user persistence.
797             *
798             * @param userPersistence the user persistence
799             */
800            public void setUserPersistence(UserPersistence userPersistence) {
801                    this.userPersistence = userPersistence;
802            }
803    
804            /**
805             * Returns the user finder.
806             *
807             * @return the user finder
808             */
809            public UserFinder getUserFinder() {
810                    return userFinder;
811            }
812    
813            /**
814             * Sets the user finder.
815             *
816             * @param userFinder the user finder
817             */
818            public void setUserFinder(UserFinder userFinder) {
819                    this.userFinder = userFinder;
820            }
821    
822            /**
823             * Returns the m d r action local service.
824             *
825             * @return the m d r action local service
826             */
827            public com.liferay.portlet.mobiledevicerules.service.MDRActionLocalService getMDRActionLocalService() {
828                    return mdrActionLocalService;
829            }
830    
831            /**
832             * Sets the m d r action local service.
833             *
834             * @param mdrActionLocalService the m d r action local service
835             */
836            public void setMDRActionLocalService(
837                    com.liferay.portlet.mobiledevicerules.service.MDRActionLocalService mdrActionLocalService) {
838                    this.mdrActionLocalService = mdrActionLocalService;
839            }
840    
841            /**
842             * Returns the m d r action remote service.
843             *
844             * @return the m d r action remote service
845             */
846            public com.liferay.portlet.mobiledevicerules.service.MDRActionService getMDRActionService() {
847                    return mdrActionService;
848            }
849    
850            /**
851             * Sets the m d r action remote service.
852             *
853             * @param mdrActionService the m d r action remote service
854             */
855            public void setMDRActionService(
856                    com.liferay.portlet.mobiledevicerules.service.MDRActionService mdrActionService) {
857                    this.mdrActionService = mdrActionService;
858            }
859    
860            /**
861             * Returns the m d r action persistence.
862             *
863             * @return the m d r action persistence
864             */
865            public MDRActionPersistence getMDRActionPersistence() {
866                    return mdrActionPersistence;
867            }
868    
869            /**
870             * Sets the m d r action persistence.
871             *
872             * @param mdrActionPersistence the m d r action persistence
873             */
874            public void setMDRActionPersistence(
875                    MDRActionPersistence mdrActionPersistence) {
876                    this.mdrActionPersistence = mdrActionPersistence;
877            }
878    
879            /**
880             * Returns the m d r rule group local service.
881             *
882             * @return the m d r rule group local service
883             */
884            public com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalService getMDRRuleGroupLocalService() {
885                    return mdrRuleGroupLocalService;
886            }
887    
888            /**
889             * Sets the m d r rule group local service.
890             *
891             * @param mdrRuleGroupLocalService the m d r rule group local service
892             */
893            public void setMDRRuleGroupLocalService(
894                    com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalService mdrRuleGroupLocalService) {
895                    this.mdrRuleGroupLocalService = mdrRuleGroupLocalService;
896            }
897    
898            /**
899             * Returns the m d r rule group remote service.
900             *
901             * @return the m d r rule group remote service
902             */
903            public com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupService getMDRRuleGroupService() {
904                    return mdrRuleGroupService;
905            }
906    
907            /**
908             * Sets the m d r rule group remote service.
909             *
910             * @param mdrRuleGroupService the m d r rule group remote service
911             */
912            public void setMDRRuleGroupService(
913                    com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupService mdrRuleGroupService) {
914                    this.mdrRuleGroupService = mdrRuleGroupService;
915            }
916    
917            /**
918             * Returns the m d r rule group persistence.
919             *
920             * @return the m d r rule group persistence
921             */
922            public MDRRuleGroupPersistence getMDRRuleGroupPersistence() {
923                    return mdrRuleGroupPersistence;
924            }
925    
926            /**
927             * Sets the m d r rule group persistence.
928             *
929             * @param mdrRuleGroupPersistence the m d r rule group persistence
930             */
931            public void setMDRRuleGroupPersistence(
932                    MDRRuleGroupPersistence mdrRuleGroupPersistence) {
933                    this.mdrRuleGroupPersistence = mdrRuleGroupPersistence;
934            }
935    
936            /**
937             * Returns the m d r rule group finder.
938             *
939             * @return the m d r rule group finder
940             */
941            public MDRRuleGroupFinder getMDRRuleGroupFinder() {
942                    return mdrRuleGroupFinder;
943            }
944    
945            /**
946             * Sets the m d r rule group finder.
947             *
948             * @param mdrRuleGroupFinder the m d r rule group finder
949             */
950            public void setMDRRuleGroupFinder(MDRRuleGroupFinder mdrRuleGroupFinder) {
951                    this.mdrRuleGroupFinder = mdrRuleGroupFinder;
952            }
953    
954            public void afterPropertiesSet() {
955                    persistedModelLocalServiceRegistry.register("com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupInstance",
956                            mdrRuleGroupInstanceLocalService);
957            }
958    
959            public void destroy() {
960                    persistedModelLocalServiceRegistry.unregister(
961                            "com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupInstance");
962            }
963    
964            /**
965             * Returns the Spring bean ID for this bean.
966             *
967             * @return the Spring bean ID for this bean
968             */
969            @Override
970            public String getBeanIdentifier() {
971                    return _beanIdentifier;
972            }
973    
974            /**
975             * Sets the Spring bean ID for this bean.
976             *
977             * @param beanIdentifier the Spring bean ID for this bean
978             */
979            @Override
980            public void setBeanIdentifier(String beanIdentifier) {
981                    _beanIdentifier = beanIdentifier;
982            }
983    
984            protected Class<?> getModelClass() {
985                    return MDRRuleGroupInstance.class;
986            }
987    
988            protected String getModelClassName() {
989                    return MDRRuleGroupInstance.class.getName();
990            }
991    
992            /**
993             * Performs a SQL query.
994             *
995             * @param sql the sql query
996             */
997            protected void runSQL(String sql) {
998                    try {
999                            DataSource dataSource = mdrRuleGroupInstancePersistence.getDataSource();
1000    
1001                            DB db = DBFactoryUtil.getDB();
1002    
1003                            sql = db.buildSQL(sql);
1004                            sql = PortalUtil.transformSQL(sql);
1005    
1006                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
1007                                            sql, new int[0]);
1008    
1009                            sqlUpdate.update();
1010                    }
1011                    catch (Exception e) {
1012                            throw new SystemException(e);
1013                    }
1014            }
1015    
1016            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceLocalService.class)
1017            protected com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceLocalService mdrRuleGroupInstanceLocalService;
1018            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceService.class)
1019            protected com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceService mdrRuleGroupInstanceService;
1020            @BeanReference(type = MDRRuleGroupInstancePersistence.class)
1021            protected MDRRuleGroupInstancePersistence mdrRuleGroupInstancePersistence;
1022            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
1023            protected com.liferay.counter.service.CounterLocalService counterLocalService;
1024            @BeanReference(type = com.liferay.portal.service.ClassNameLocalService.class)
1025            protected com.liferay.portal.service.ClassNameLocalService classNameLocalService;
1026            @BeanReference(type = com.liferay.portal.service.ClassNameService.class)
1027            protected com.liferay.portal.service.ClassNameService classNameService;
1028            @BeanReference(type = ClassNamePersistence.class)
1029            protected ClassNamePersistence classNamePersistence;
1030            @BeanReference(type = com.liferay.portal.service.LayoutLocalService.class)
1031            protected com.liferay.portal.service.LayoutLocalService layoutLocalService;
1032            @BeanReference(type = com.liferay.portal.service.LayoutService.class)
1033            protected com.liferay.portal.service.LayoutService layoutService;
1034            @BeanReference(type = LayoutPersistence.class)
1035            protected LayoutPersistence layoutPersistence;
1036            @BeanReference(type = LayoutFinder.class)
1037            protected LayoutFinder layoutFinder;
1038            @BeanReference(type = com.liferay.portal.service.LayoutSetLocalService.class)
1039            protected com.liferay.portal.service.LayoutSetLocalService layoutSetLocalService;
1040            @BeanReference(type = com.liferay.portal.service.LayoutSetService.class)
1041            protected com.liferay.portal.service.LayoutSetService layoutSetService;
1042            @BeanReference(type = LayoutSetPersistence.class)
1043            protected LayoutSetPersistence layoutSetPersistence;
1044            @BeanReference(type = com.liferay.portal.service.SystemEventLocalService.class)
1045            protected com.liferay.portal.service.SystemEventLocalService systemEventLocalService;
1046            @BeanReference(type = SystemEventPersistence.class)
1047            protected SystemEventPersistence systemEventPersistence;
1048            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
1049            protected com.liferay.portal.service.UserLocalService userLocalService;
1050            @BeanReference(type = com.liferay.portal.service.UserService.class)
1051            protected com.liferay.portal.service.UserService userService;
1052            @BeanReference(type = UserPersistence.class)
1053            protected UserPersistence userPersistence;
1054            @BeanReference(type = UserFinder.class)
1055            protected UserFinder userFinder;
1056            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRActionLocalService.class)
1057            protected com.liferay.portlet.mobiledevicerules.service.MDRActionLocalService mdrActionLocalService;
1058            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRActionService.class)
1059            protected com.liferay.portlet.mobiledevicerules.service.MDRActionService mdrActionService;
1060            @BeanReference(type = MDRActionPersistence.class)
1061            protected MDRActionPersistence mdrActionPersistence;
1062            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalService.class)
1063            protected com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalService mdrRuleGroupLocalService;
1064            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupService.class)
1065            protected com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupService mdrRuleGroupService;
1066            @BeanReference(type = MDRRuleGroupPersistence.class)
1067            protected MDRRuleGroupPersistence mdrRuleGroupPersistence;
1068            @BeanReference(type = MDRRuleGroupFinder.class)
1069            protected MDRRuleGroupFinder mdrRuleGroupFinder;
1070            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
1071            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
1072            private String _beanIdentifier;
1073    }