001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.mobiledevicerules.service.base;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.BeanReference;
020    import com.liferay.portal.kernel.bean.IdentifiableBean;
021    import com.liferay.portal.kernel.dao.db.DB;
022    import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
023    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
024    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
025    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
026    import com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery;
027    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
028    import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
029    import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery;
030    import com.liferay.portal.kernel.dao.orm.Projection;
031    import com.liferay.portal.kernel.exception.PortalException;
032    import com.liferay.portal.kernel.exception.SystemException;
033    import com.liferay.portal.kernel.lar.ExportImportHelperUtil;
034    import com.liferay.portal.kernel.lar.ManifestSummary;
035    import com.liferay.portal.kernel.lar.PortletDataContext;
036    import com.liferay.portal.kernel.lar.StagedModelDataHandlerUtil;
037    import com.liferay.portal.kernel.lar.StagedModelType;
038    import com.liferay.portal.kernel.search.Indexable;
039    import com.liferay.portal.kernel.search.IndexableType;
040    import com.liferay.portal.kernel.util.OrderByComparator;
041    import com.liferay.portal.model.PersistedModel;
042    import com.liferay.portal.service.BaseLocalServiceImpl;
043    import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
044    import com.liferay.portal.service.persistence.GroupFinder;
045    import com.liferay.portal.service.persistence.GroupPersistence;
046    import com.liferay.portal.service.persistence.SystemEventPersistence;
047    import com.liferay.portal.service.persistence.UserFinder;
048    import com.liferay.portal.service.persistence.UserPersistence;
049    import com.liferay.portal.util.PortalUtil;
050    
051    import com.liferay.portlet.mobiledevicerules.model.MDRRuleGroup;
052    import com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalService;
053    import com.liferay.portlet.mobiledevicerules.service.persistence.MDRRuleGroupFinder;
054    import com.liferay.portlet.mobiledevicerules.service.persistence.MDRRuleGroupInstancePersistence;
055    import com.liferay.portlet.mobiledevicerules.service.persistence.MDRRuleGroupPersistence;
056    import com.liferay.portlet.mobiledevicerules.service.persistence.MDRRulePersistence;
057    
058    import java.io.Serializable;
059    
060    import java.util.List;
061    
062    import javax.sql.DataSource;
063    
064    /**
065     * Provides the base implementation for the m d r rule group local service.
066     *
067     * <p>
068     * 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.MDRRuleGroupLocalServiceImpl}.
069     * </p>
070     *
071     * @author Edward C. Han
072     * @see com.liferay.portlet.mobiledevicerules.service.impl.MDRRuleGroupLocalServiceImpl
073     * @see com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalServiceUtil
074     * @generated
075     */
076    @ProviderType
077    public abstract class MDRRuleGroupLocalServiceBaseImpl
078            extends BaseLocalServiceImpl implements MDRRuleGroupLocalService,
079                    IdentifiableBean {
080            /*
081             * NOTE FOR DEVELOPERS:
082             *
083             * Never modify or reference this class directly. Always use {@link com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalServiceUtil} to access the m d r rule group local service.
084             */
085    
086            /**
087             * Adds the m d r rule group to the database. Also notifies the appropriate model listeners.
088             *
089             * @param mdrRuleGroup the m d r rule group
090             * @return the m d r rule group that was added
091             */
092            @Indexable(type = IndexableType.REINDEX)
093            @Override
094            public MDRRuleGroup addMDRRuleGroup(MDRRuleGroup mdrRuleGroup) {
095                    mdrRuleGroup.setNew(true);
096    
097                    return mdrRuleGroupPersistence.update(mdrRuleGroup);
098            }
099    
100            /**
101             * Creates a new m d r rule group with the primary key. Does not add the m d r rule group to the database.
102             *
103             * @param ruleGroupId the primary key for the new m d r rule group
104             * @return the new m d r rule group
105             */
106            @Override
107            public MDRRuleGroup createMDRRuleGroup(long ruleGroupId) {
108                    return mdrRuleGroupPersistence.create(ruleGroupId);
109            }
110    
111            /**
112             * Deletes the m d r rule group with the primary key from the database. Also notifies the appropriate model listeners.
113             *
114             * @param ruleGroupId the primary key of the m d r rule group
115             * @return the m d r rule group that was removed
116             * @throws PortalException if a m d r rule group with the primary key could not be found
117             */
118            @Indexable(type = IndexableType.DELETE)
119            @Override
120            public MDRRuleGroup deleteMDRRuleGroup(long ruleGroupId)
121                    throws PortalException {
122                    return mdrRuleGroupPersistence.remove(ruleGroupId);
123            }
124    
125            /**
126             * Deletes the m d r rule group from the database. Also notifies the appropriate model listeners.
127             *
128             * @param mdrRuleGroup the m d r rule group
129             * @return the m d r rule group that was removed
130             */
131            @Indexable(type = IndexableType.DELETE)
132            @Override
133            public MDRRuleGroup deleteMDRRuleGroup(MDRRuleGroup mdrRuleGroup) {
134                    return mdrRuleGroupPersistence.remove(mdrRuleGroup);
135            }
136    
137            @Override
138            public DynamicQuery dynamicQuery() {
139                    Class<?> clazz = getClass();
140    
141                    return DynamicQueryFactoryUtil.forClass(MDRRuleGroup.class,
142                            clazz.getClassLoader());
143            }
144    
145            /**
146             * Performs a dynamic query on the database and returns the matching rows.
147             *
148             * @param dynamicQuery the dynamic query
149             * @return the matching rows
150             */
151            @Override
152            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
153                    return mdrRuleGroupPersistence.findWithDynamicQuery(dynamicQuery);
154            }
155    
156            /**
157             * Performs a dynamic query on the database and returns a range of the matching rows.
158             *
159             * <p>
160             * 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.MDRRuleGroupModelImpl}. 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.
161             * </p>
162             *
163             * @param dynamicQuery the dynamic query
164             * @param start the lower bound of the range of model instances
165             * @param end the upper bound of the range of model instances (not inclusive)
166             * @return the range of matching rows
167             */
168            @Override
169            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
170                    int end) {
171                    return mdrRuleGroupPersistence.findWithDynamicQuery(dynamicQuery,
172                            start, end);
173            }
174    
175            /**
176             * Performs a dynamic query on the database and returns an ordered range of the matching rows.
177             *
178             * <p>
179             * 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.MDRRuleGroupModelImpl}. 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.
180             * </p>
181             *
182             * @param dynamicQuery the dynamic query
183             * @param start the lower bound of the range of model instances
184             * @param end the upper bound of the range of model instances (not inclusive)
185             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
186             * @return the ordered range of matching rows
187             */
188            @Override
189            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
190                    int end, OrderByComparator<T> orderByComparator) {
191                    return mdrRuleGroupPersistence.findWithDynamicQuery(dynamicQuery,
192                            start, end, orderByComparator);
193            }
194    
195            /**
196             * Returns the number of rows matching the dynamic query.
197             *
198             * @param dynamicQuery the dynamic query
199             * @return the number of rows matching the dynamic query
200             */
201            @Override
202            public long dynamicQueryCount(DynamicQuery dynamicQuery) {
203                    return mdrRuleGroupPersistence.countWithDynamicQuery(dynamicQuery);
204            }
205    
206            /**
207             * Returns the number of rows matching the dynamic query.
208             *
209             * @param dynamicQuery the dynamic query
210             * @param projection the projection to apply to the query
211             * @return the number of rows matching the dynamic query
212             */
213            @Override
214            public long dynamicQueryCount(DynamicQuery dynamicQuery,
215                    Projection projection) {
216                    return mdrRuleGroupPersistence.countWithDynamicQuery(dynamicQuery,
217                            projection);
218            }
219    
220            @Override
221            public MDRRuleGroup fetchMDRRuleGroup(long ruleGroupId) {
222                    return mdrRuleGroupPersistence.fetchByPrimaryKey(ruleGroupId);
223            }
224    
225            /**
226             * Returns the m d r rule group matching the UUID and group.
227             *
228             * @param uuid the m d r rule group's UUID
229             * @param groupId the primary key of the group
230             * @return the matching m d r rule group, or <code>null</code> if a matching m d r rule group could not be found
231             */
232            @Override
233            public MDRRuleGroup fetchMDRRuleGroupByUuidAndGroupId(String uuid,
234                    long groupId) {
235                    return mdrRuleGroupPersistence.fetchByUUID_G(uuid, groupId);
236            }
237    
238            /**
239             * Returns the m d r rule group with the primary key.
240             *
241             * @param ruleGroupId the primary key of the m d r rule group
242             * @return the m d r rule group
243             * @throws PortalException if a m d r rule group with the primary key could not be found
244             */
245            @Override
246            public MDRRuleGroup getMDRRuleGroup(long ruleGroupId)
247                    throws PortalException {
248                    return mdrRuleGroupPersistence.findByPrimaryKey(ruleGroupId);
249            }
250    
251            @Override
252            public ActionableDynamicQuery getActionableDynamicQuery() {
253                    ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
254    
255                    actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalServiceUtil.getService());
256                    actionableDynamicQuery.setClass(MDRRuleGroup.class);
257                    actionableDynamicQuery.setClassLoader(getClassLoader());
258    
259                    actionableDynamicQuery.setPrimaryKeyPropertyName("ruleGroupId");
260    
261                    return actionableDynamicQuery;
262            }
263    
264            protected void initActionableDynamicQuery(
265                    ActionableDynamicQuery actionableDynamicQuery) {
266                    actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalServiceUtil.getService());
267                    actionableDynamicQuery.setClass(MDRRuleGroup.class);
268                    actionableDynamicQuery.setClassLoader(getClassLoader());
269    
270                    actionableDynamicQuery.setPrimaryKeyPropertyName("ruleGroupId");
271            }
272    
273            @Override
274            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
275                    final PortletDataContext portletDataContext) {
276                    final ExportActionableDynamicQuery exportActionableDynamicQuery = new ExportActionableDynamicQuery() {
277                                    @Override
278                                    public long performCount() throws PortalException {
279                                            ManifestSummary manifestSummary = portletDataContext.getManifestSummary();
280    
281                                            StagedModelType stagedModelType = getStagedModelType();
282    
283                                            long modelAdditionCount = super.performCount();
284    
285                                            manifestSummary.addModelAdditionCount(stagedModelType.toString(),
286                                                    modelAdditionCount);
287    
288                                            long modelDeletionCount = ExportImportHelperUtil.getModelDeletionCount(portletDataContext,
289                                                            stagedModelType);
290    
291                                            manifestSummary.addModelDeletionCount(stagedModelType.toString(),
292                                                    modelDeletionCount);
293    
294                                            return modelAdditionCount;
295                                    }
296                            };
297    
298                    initActionableDynamicQuery(exportActionableDynamicQuery);
299    
300                    exportActionableDynamicQuery.setAddCriteriaMethod(new ActionableDynamicQuery.AddCriteriaMethod() {
301                                    @Override
302                                    public void addCriteria(DynamicQuery dynamicQuery) {
303                                            portletDataContext.addDateRangeCriteria(dynamicQuery,
304                                                    "modifiedDate");
305                                    }
306                            });
307    
308                    exportActionableDynamicQuery.setCompanyId(portletDataContext.getCompanyId());
309    
310                    exportActionableDynamicQuery.setGroupId(portletDataContext.getScopeGroupId());
311    
312                    exportActionableDynamicQuery.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod() {
313                                    @Override
314                                    public void performAction(Object object)
315                                            throws PortalException {
316                                            MDRRuleGroup stagedModel = (MDRRuleGroup)object;
317    
318                                            StagedModelDataHandlerUtil.exportStagedModel(portletDataContext,
319                                                    stagedModel);
320                                    }
321                            });
322                    exportActionableDynamicQuery.setStagedModelType(new StagedModelType(
323                                    PortalUtil.getClassNameId(MDRRuleGroup.class.getName())));
324    
325                    return exportActionableDynamicQuery;
326            }
327    
328            /**
329             * @throws PortalException
330             */
331            @Override
332            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
333                    throws PortalException {
334                    return mdrRuleGroupLocalService.deleteMDRRuleGroup((MDRRuleGroup)persistedModel);
335            }
336    
337            @Override
338            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
339                    throws PortalException {
340                    return mdrRuleGroupPersistence.findByPrimaryKey(primaryKeyObj);
341            }
342    
343            /**
344             * Returns all the m d r rule groups matching the UUID and company.
345             *
346             * @param uuid the UUID of the m d r rule groups
347             * @param companyId the primary key of the company
348             * @return the matching m d r rule groups, or an empty list if no matches were found
349             */
350            @Override
351            public List<MDRRuleGroup> getMDRRuleGroupsByUuidAndCompanyId(String uuid,
352                    long companyId) {
353                    return mdrRuleGroupPersistence.findByUuid_C(uuid, companyId);
354            }
355    
356            /**
357             * Returns a range of m d r rule groups matching the UUID and company.
358             *
359             * @param uuid the UUID of the m d r rule groups
360             * @param companyId the primary key of the company
361             * @param start the lower bound of the range of m d r rule groups
362             * @param end the upper bound of the range of m d r rule groups (not inclusive)
363             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
364             * @return the range of matching m d r rule groups, or an empty list if no matches were found
365             */
366            @Override
367            public List<MDRRuleGroup> getMDRRuleGroupsByUuidAndCompanyId(String uuid,
368                    long companyId, int start, int end,
369                    OrderByComparator<MDRRuleGroup> orderByComparator) {
370                    return mdrRuleGroupPersistence.findByUuid_C(uuid, companyId, start,
371                            end, orderByComparator);
372            }
373    
374            /**
375             * Returns the m d r rule group matching the UUID and group.
376             *
377             * @param uuid the m d r rule group's UUID
378             * @param groupId the primary key of the group
379             * @return the matching m d r rule group
380             * @throws PortalException if a matching m d r rule group could not be found
381             */
382            @Override
383            public MDRRuleGroup getMDRRuleGroupByUuidAndGroupId(String uuid,
384                    long groupId) throws PortalException {
385                    return mdrRuleGroupPersistence.findByUUID_G(uuid, groupId);
386            }
387    
388            /**
389             * Returns a range of all the m d r rule groups.
390             *
391             * <p>
392             * 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.MDRRuleGroupModelImpl}. 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.
393             * </p>
394             *
395             * @param start the lower bound of the range of m d r rule groups
396             * @param end the upper bound of the range of m d r rule groups (not inclusive)
397             * @return the range of m d r rule groups
398             */
399            @Override
400            public List<MDRRuleGroup> getMDRRuleGroups(int start, int end) {
401                    return mdrRuleGroupPersistence.findAll(start, end);
402            }
403    
404            /**
405             * Returns the number of m d r rule groups.
406             *
407             * @return the number of m d r rule groups
408             */
409            @Override
410            public int getMDRRuleGroupsCount() {
411                    return mdrRuleGroupPersistence.countAll();
412            }
413    
414            /**
415             * Updates the m d r rule group in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
416             *
417             * @param mdrRuleGroup the m d r rule group
418             * @return the m d r rule group that was updated
419             */
420            @Indexable(type = IndexableType.REINDEX)
421            @Override
422            public MDRRuleGroup updateMDRRuleGroup(MDRRuleGroup mdrRuleGroup) {
423                    return mdrRuleGroupPersistence.update(mdrRuleGroup);
424            }
425    
426            /**
427             * Returns the m d r rule group local service.
428             *
429             * @return the m d r rule group local service
430             */
431            public com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalService getMDRRuleGroupLocalService() {
432                    return mdrRuleGroupLocalService;
433            }
434    
435            /**
436             * Sets the m d r rule group local service.
437             *
438             * @param mdrRuleGroupLocalService the m d r rule group local service
439             */
440            public void setMDRRuleGroupLocalService(
441                    com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalService mdrRuleGroupLocalService) {
442                    this.mdrRuleGroupLocalService = mdrRuleGroupLocalService;
443            }
444    
445            /**
446             * Returns the m d r rule group remote service.
447             *
448             * @return the m d r rule group remote service
449             */
450            public com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupService getMDRRuleGroupService() {
451                    return mdrRuleGroupService;
452            }
453    
454            /**
455             * Sets the m d r rule group remote service.
456             *
457             * @param mdrRuleGroupService the m d r rule group remote service
458             */
459            public void setMDRRuleGroupService(
460                    com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupService mdrRuleGroupService) {
461                    this.mdrRuleGroupService = mdrRuleGroupService;
462            }
463    
464            /**
465             * Returns the m d r rule group persistence.
466             *
467             * @return the m d r rule group persistence
468             */
469            public MDRRuleGroupPersistence getMDRRuleGroupPersistence() {
470                    return mdrRuleGroupPersistence;
471            }
472    
473            /**
474             * Sets the m d r rule group persistence.
475             *
476             * @param mdrRuleGroupPersistence the m d r rule group persistence
477             */
478            public void setMDRRuleGroupPersistence(
479                    MDRRuleGroupPersistence mdrRuleGroupPersistence) {
480                    this.mdrRuleGroupPersistence = mdrRuleGroupPersistence;
481            }
482    
483            /**
484             * Returns the m d r rule group finder.
485             *
486             * @return the m d r rule group finder
487             */
488            public MDRRuleGroupFinder getMDRRuleGroupFinder() {
489                    return mdrRuleGroupFinder;
490            }
491    
492            /**
493             * Sets the m d r rule group finder.
494             *
495             * @param mdrRuleGroupFinder the m d r rule group finder
496             */
497            public void setMDRRuleGroupFinder(MDRRuleGroupFinder mdrRuleGroupFinder) {
498                    this.mdrRuleGroupFinder = mdrRuleGroupFinder;
499            }
500    
501            /**
502             * Returns the counter local service.
503             *
504             * @return the counter local service
505             */
506            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
507                    return counterLocalService;
508            }
509    
510            /**
511             * Sets the counter local service.
512             *
513             * @param counterLocalService the counter local service
514             */
515            public void setCounterLocalService(
516                    com.liferay.counter.service.CounterLocalService counterLocalService) {
517                    this.counterLocalService = counterLocalService;
518            }
519    
520            /**
521             * Returns the group local service.
522             *
523             * @return the group local service
524             */
525            public com.liferay.portal.service.GroupLocalService getGroupLocalService() {
526                    return groupLocalService;
527            }
528    
529            /**
530             * Sets the group local service.
531             *
532             * @param groupLocalService the group local service
533             */
534            public void setGroupLocalService(
535                    com.liferay.portal.service.GroupLocalService groupLocalService) {
536                    this.groupLocalService = groupLocalService;
537            }
538    
539            /**
540             * Returns the group remote service.
541             *
542             * @return the group remote service
543             */
544            public com.liferay.portal.service.GroupService getGroupService() {
545                    return groupService;
546            }
547    
548            /**
549             * Sets the group remote service.
550             *
551             * @param groupService the group remote service
552             */
553            public void setGroupService(
554                    com.liferay.portal.service.GroupService groupService) {
555                    this.groupService = groupService;
556            }
557    
558            /**
559             * Returns the group persistence.
560             *
561             * @return the group persistence
562             */
563            public GroupPersistence getGroupPersistence() {
564                    return groupPersistence;
565            }
566    
567            /**
568             * Sets the group persistence.
569             *
570             * @param groupPersistence the group persistence
571             */
572            public void setGroupPersistence(GroupPersistence groupPersistence) {
573                    this.groupPersistence = groupPersistence;
574            }
575    
576            /**
577             * Returns the group finder.
578             *
579             * @return the group finder
580             */
581            public GroupFinder getGroupFinder() {
582                    return groupFinder;
583            }
584    
585            /**
586             * Sets the group finder.
587             *
588             * @param groupFinder the group finder
589             */
590            public void setGroupFinder(GroupFinder groupFinder) {
591                    this.groupFinder = groupFinder;
592            }
593    
594            /**
595             * Returns the system event local service.
596             *
597             * @return the system event local service
598             */
599            public com.liferay.portal.service.SystemEventLocalService getSystemEventLocalService() {
600                    return systemEventLocalService;
601            }
602    
603            /**
604             * Sets the system event local service.
605             *
606             * @param systemEventLocalService the system event local service
607             */
608            public void setSystemEventLocalService(
609                    com.liferay.portal.service.SystemEventLocalService systemEventLocalService) {
610                    this.systemEventLocalService = systemEventLocalService;
611            }
612    
613            /**
614             * Returns the system event persistence.
615             *
616             * @return the system event persistence
617             */
618            public SystemEventPersistence getSystemEventPersistence() {
619                    return systemEventPersistence;
620            }
621    
622            /**
623             * Sets the system event persistence.
624             *
625             * @param systemEventPersistence the system event persistence
626             */
627            public void setSystemEventPersistence(
628                    SystemEventPersistence systemEventPersistence) {
629                    this.systemEventPersistence = systemEventPersistence;
630            }
631    
632            /**
633             * Returns the user local service.
634             *
635             * @return the user local service
636             */
637            public com.liferay.portal.service.UserLocalService getUserLocalService() {
638                    return userLocalService;
639            }
640    
641            /**
642             * Sets the user local service.
643             *
644             * @param userLocalService the user local service
645             */
646            public void setUserLocalService(
647                    com.liferay.portal.service.UserLocalService userLocalService) {
648                    this.userLocalService = userLocalService;
649            }
650    
651            /**
652             * Returns the user remote service.
653             *
654             * @return the user remote service
655             */
656            public com.liferay.portal.service.UserService getUserService() {
657                    return userService;
658            }
659    
660            /**
661             * Sets the user remote service.
662             *
663             * @param userService the user remote service
664             */
665            public void setUserService(
666                    com.liferay.portal.service.UserService userService) {
667                    this.userService = userService;
668            }
669    
670            /**
671             * Returns the user persistence.
672             *
673             * @return the user persistence
674             */
675            public UserPersistence getUserPersistence() {
676                    return userPersistence;
677            }
678    
679            /**
680             * Sets the user persistence.
681             *
682             * @param userPersistence the user persistence
683             */
684            public void setUserPersistence(UserPersistence userPersistence) {
685                    this.userPersistence = userPersistence;
686            }
687    
688            /**
689             * Returns the user finder.
690             *
691             * @return the user finder
692             */
693            public UserFinder getUserFinder() {
694                    return userFinder;
695            }
696    
697            /**
698             * Sets the user finder.
699             *
700             * @param userFinder the user finder
701             */
702            public void setUserFinder(UserFinder userFinder) {
703                    this.userFinder = userFinder;
704            }
705    
706            /**
707             * Returns the m d r rule local service.
708             *
709             * @return the m d r rule local service
710             */
711            public com.liferay.portlet.mobiledevicerules.service.MDRRuleLocalService getMDRRuleLocalService() {
712                    return mdrRuleLocalService;
713            }
714    
715            /**
716             * Sets the m d r rule local service.
717             *
718             * @param mdrRuleLocalService the m d r rule local service
719             */
720            public void setMDRRuleLocalService(
721                    com.liferay.portlet.mobiledevicerules.service.MDRRuleLocalService mdrRuleLocalService) {
722                    this.mdrRuleLocalService = mdrRuleLocalService;
723            }
724    
725            /**
726             * Returns the m d r rule remote service.
727             *
728             * @return the m d r rule remote service
729             */
730            public com.liferay.portlet.mobiledevicerules.service.MDRRuleService getMDRRuleService() {
731                    return mdrRuleService;
732            }
733    
734            /**
735             * Sets the m d r rule remote service.
736             *
737             * @param mdrRuleService the m d r rule remote service
738             */
739            public void setMDRRuleService(
740                    com.liferay.portlet.mobiledevicerules.service.MDRRuleService mdrRuleService) {
741                    this.mdrRuleService = mdrRuleService;
742            }
743    
744            /**
745             * Returns the m d r rule persistence.
746             *
747             * @return the m d r rule persistence
748             */
749            public MDRRulePersistence getMDRRulePersistence() {
750                    return mdrRulePersistence;
751            }
752    
753            /**
754             * Sets the m d r rule persistence.
755             *
756             * @param mdrRulePersistence the m d r rule persistence
757             */
758            public void setMDRRulePersistence(MDRRulePersistence mdrRulePersistence) {
759                    this.mdrRulePersistence = mdrRulePersistence;
760            }
761    
762            /**
763             * Returns the m d r rule group instance local service.
764             *
765             * @return the m d r rule group instance local service
766             */
767            public com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceLocalService getMDRRuleGroupInstanceLocalService() {
768                    return mdrRuleGroupInstanceLocalService;
769            }
770    
771            /**
772             * Sets the m d r rule group instance local service.
773             *
774             * @param mdrRuleGroupInstanceLocalService the m d r rule group instance local service
775             */
776            public void setMDRRuleGroupInstanceLocalService(
777                    com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceLocalService mdrRuleGroupInstanceLocalService) {
778                    this.mdrRuleGroupInstanceLocalService = mdrRuleGroupInstanceLocalService;
779            }
780    
781            /**
782             * Returns the m d r rule group instance remote service.
783             *
784             * @return the m d r rule group instance remote service
785             */
786            public com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceService getMDRRuleGroupInstanceService() {
787                    return mdrRuleGroupInstanceService;
788            }
789    
790            /**
791             * Sets the m d r rule group instance remote service.
792             *
793             * @param mdrRuleGroupInstanceService the m d r rule group instance remote service
794             */
795            public void setMDRRuleGroupInstanceService(
796                    com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceService mdrRuleGroupInstanceService) {
797                    this.mdrRuleGroupInstanceService = mdrRuleGroupInstanceService;
798            }
799    
800            /**
801             * Returns the m d r rule group instance persistence.
802             *
803             * @return the m d r rule group instance persistence
804             */
805            public MDRRuleGroupInstancePersistence getMDRRuleGroupInstancePersistence() {
806                    return mdrRuleGroupInstancePersistence;
807            }
808    
809            /**
810             * Sets the m d r rule group instance persistence.
811             *
812             * @param mdrRuleGroupInstancePersistence the m d r rule group instance persistence
813             */
814            public void setMDRRuleGroupInstancePersistence(
815                    MDRRuleGroupInstancePersistence mdrRuleGroupInstancePersistence) {
816                    this.mdrRuleGroupInstancePersistence = mdrRuleGroupInstancePersistence;
817            }
818    
819            public void afterPropertiesSet() {
820                    persistedModelLocalServiceRegistry.register("com.liferay.portlet.mobiledevicerules.model.MDRRuleGroup",
821                            mdrRuleGroupLocalService);
822            }
823    
824            public void destroy() {
825                    persistedModelLocalServiceRegistry.unregister(
826                            "com.liferay.portlet.mobiledevicerules.model.MDRRuleGroup");
827            }
828    
829            /**
830             * Returns the Spring bean ID for this bean.
831             *
832             * @return the Spring bean ID for this bean
833             */
834            @Override
835            public String getBeanIdentifier() {
836                    return _beanIdentifier;
837            }
838    
839            /**
840             * Sets the Spring bean ID for this bean.
841             *
842             * @param beanIdentifier the Spring bean ID for this bean
843             */
844            @Override
845            public void setBeanIdentifier(String beanIdentifier) {
846                    _beanIdentifier = beanIdentifier;
847            }
848    
849            protected Class<?> getModelClass() {
850                    return MDRRuleGroup.class;
851            }
852    
853            protected String getModelClassName() {
854                    return MDRRuleGroup.class.getName();
855            }
856    
857            /**
858             * Performs a SQL query.
859             *
860             * @param sql the sql query
861             */
862            protected void runSQL(String sql) {
863                    try {
864                            DataSource dataSource = mdrRuleGroupPersistence.getDataSource();
865    
866                            DB db = DBFactoryUtil.getDB();
867    
868                            sql = db.buildSQL(sql);
869                            sql = PortalUtil.transformSQL(sql);
870    
871                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
872                                            sql, new int[0]);
873    
874                            sqlUpdate.update();
875                    }
876                    catch (Exception e) {
877                            throw new SystemException(e);
878                    }
879            }
880    
881            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalService.class)
882            protected com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupLocalService mdrRuleGroupLocalService;
883            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupService.class)
884            protected com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupService mdrRuleGroupService;
885            @BeanReference(type = MDRRuleGroupPersistence.class)
886            protected MDRRuleGroupPersistence mdrRuleGroupPersistence;
887            @BeanReference(type = MDRRuleGroupFinder.class)
888            protected MDRRuleGroupFinder mdrRuleGroupFinder;
889            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
890            protected com.liferay.counter.service.CounterLocalService counterLocalService;
891            @BeanReference(type = com.liferay.portal.service.GroupLocalService.class)
892            protected com.liferay.portal.service.GroupLocalService groupLocalService;
893            @BeanReference(type = com.liferay.portal.service.GroupService.class)
894            protected com.liferay.portal.service.GroupService groupService;
895            @BeanReference(type = GroupPersistence.class)
896            protected GroupPersistence groupPersistence;
897            @BeanReference(type = GroupFinder.class)
898            protected GroupFinder groupFinder;
899            @BeanReference(type = com.liferay.portal.service.SystemEventLocalService.class)
900            protected com.liferay.portal.service.SystemEventLocalService systemEventLocalService;
901            @BeanReference(type = SystemEventPersistence.class)
902            protected SystemEventPersistence systemEventPersistence;
903            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
904            protected com.liferay.portal.service.UserLocalService userLocalService;
905            @BeanReference(type = com.liferay.portal.service.UserService.class)
906            protected com.liferay.portal.service.UserService userService;
907            @BeanReference(type = UserPersistence.class)
908            protected UserPersistence userPersistence;
909            @BeanReference(type = UserFinder.class)
910            protected UserFinder userFinder;
911            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRRuleLocalService.class)
912            protected com.liferay.portlet.mobiledevicerules.service.MDRRuleLocalService mdrRuleLocalService;
913            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRRuleService.class)
914            protected com.liferay.portlet.mobiledevicerules.service.MDRRuleService mdrRuleService;
915            @BeanReference(type = MDRRulePersistence.class)
916            protected MDRRulePersistence mdrRulePersistence;
917            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceLocalService.class)
918            protected com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceLocalService mdrRuleGroupInstanceLocalService;
919            @BeanReference(type = com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceService.class)
920            protected com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceService mdrRuleGroupInstanceService;
921            @BeanReference(type = MDRRuleGroupInstancePersistence.class)
922            protected MDRRuleGroupInstancePersistence mdrRuleGroupInstancePersistence;
923            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
924            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
925            private String _beanIdentifier;
926    }