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.calendar.service.base;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.BeanReference;
020    import com.liferay.portal.kernel.dao.db.DB;
021    import com.liferay.portal.kernel.dao.db.DBManagerUtil;
022    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
023    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
024    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
025    import com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery;
026    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
027    import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
028    import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery;
029    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
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.module.framework.service.IdentifiableOSGiService;
034    import com.liferay.portal.kernel.search.Indexable;
035    import com.liferay.portal.kernel.search.IndexableType;
036    import com.liferay.portal.kernel.util.OrderByComparator;
037    import com.liferay.portal.model.PersistedModel;
038    import com.liferay.portal.service.BaseLocalServiceImpl;
039    import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
040    import com.liferay.portal.service.persistence.ClassNamePersistence;
041    import com.liferay.portal.service.persistence.CompanyPersistence;
042    import com.liferay.portal.service.persistence.GroupFinder;
043    import com.liferay.portal.service.persistence.GroupPersistence;
044    import com.liferay.portal.service.persistence.PortletPreferencesFinder;
045    import com.liferay.portal.service.persistence.PortletPreferencesPersistence;
046    import com.liferay.portal.service.persistence.SubscriptionPersistence;
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.asset.service.persistence.AssetEntryFinder;
052    import com.liferay.portlet.asset.service.persistence.AssetEntryPersistence;
053    import com.liferay.portlet.asset.service.persistence.AssetLinkPersistence;
054    import com.liferay.portlet.asset.service.persistence.AssetTagFinder;
055    import com.liferay.portlet.asset.service.persistence.AssetTagPersistence;
056    import com.liferay.portlet.calendar.model.CalEvent;
057    import com.liferay.portlet.calendar.service.CalEventLocalService;
058    import com.liferay.portlet.calendar.service.persistence.CalEventFinder;
059    import com.liferay.portlet.calendar.service.persistence.CalEventPersistence;
060    import com.liferay.portlet.expando.service.persistence.ExpandoValuePersistence;
061    import com.liferay.portlet.exportimport.lar.ExportImportHelperUtil;
062    import com.liferay.portlet.exportimport.lar.ManifestSummary;
063    import com.liferay.portlet.exportimport.lar.PortletDataContext;
064    import com.liferay.portlet.exportimport.lar.StagedModelDataHandlerUtil;
065    import com.liferay.portlet.exportimport.lar.StagedModelType;
066    import com.liferay.portlet.messageboards.service.persistence.MBMessageFinder;
067    import com.liferay.portlet.messageboards.service.persistence.MBMessagePersistence;
068    import com.liferay.portlet.social.service.persistence.SocialActivityFinder;
069    import com.liferay.portlet.social.service.persistence.SocialActivityPersistence;
070    
071    import java.io.Serializable;
072    
073    import java.util.List;
074    
075    import javax.sql.DataSource;
076    
077    /**
078     * Provides the base implementation for the cal event local service.
079     *
080     * <p>
081     * 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.calendar.service.impl.CalEventLocalServiceImpl}.
082     * </p>
083     *
084     * @author Brian Wing Shun Chan
085     * @see com.liferay.portlet.calendar.service.impl.CalEventLocalServiceImpl
086     * @see com.liferay.portlet.calendar.service.CalEventLocalServiceUtil
087     * @deprecated As of 7.0.0, with no direct replacement
088     * @generated
089     */
090    @Deprecated
091    @ProviderType
092    public abstract class CalEventLocalServiceBaseImpl extends BaseLocalServiceImpl
093            implements CalEventLocalService, IdentifiableOSGiService {
094            /*
095             * NOTE FOR DEVELOPERS:
096             *
097             * Never modify or reference this class directly. Always use {@link com.liferay.portlet.calendar.service.CalEventLocalServiceUtil} to access the cal event local service.
098             */
099    
100            /**
101             * Adds the cal event to the database. Also notifies the appropriate model listeners.
102             *
103             * @param calEvent the cal event
104             * @return the cal event that was added
105             */
106            @Indexable(type = IndexableType.REINDEX)
107            @Override
108            public CalEvent addCalEvent(CalEvent calEvent) {
109                    calEvent.setNew(true);
110    
111                    return calEventPersistence.update(calEvent);
112            }
113    
114            /**
115             * Creates a new cal event with the primary key. Does not add the cal event to the database.
116             *
117             * @param eventId the primary key for the new cal event
118             * @return the new cal event
119             */
120            @Override
121            public CalEvent createCalEvent(long eventId) {
122                    return calEventPersistence.create(eventId);
123            }
124    
125            /**
126             * Deletes the cal event with the primary key from the database. Also notifies the appropriate model listeners.
127             *
128             * @param eventId the primary key of the cal event
129             * @return the cal event that was removed
130             * @throws PortalException if a cal event with the primary key could not be found
131             */
132            @Indexable(type = IndexableType.DELETE)
133            @Override
134            public CalEvent deleteCalEvent(long eventId) throws PortalException {
135                    return calEventPersistence.remove(eventId);
136            }
137    
138            /**
139             * Deletes the cal event from the database. Also notifies the appropriate model listeners.
140             *
141             * @param calEvent the cal event
142             * @return the cal event that was removed
143             */
144            @Indexable(type = IndexableType.DELETE)
145            @Override
146            public CalEvent deleteCalEvent(CalEvent calEvent) {
147                    return calEventPersistence.remove(calEvent);
148            }
149    
150            @Override
151            public DynamicQuery dynamicQuery() {
152                    Class<?> clazz = getClass();
153    
154                    return DynamicQueryFactoryUtil.forClass(CalEvent.class,
155                            clazz.getClassLoader());
156            }
157    
158            /**
159             * Performs a dynamic query on the database and returns the matching rows.
160             *
161             * @param dynamicQuery the dynamic query
162             * @return the matching rows
163             */
164            @Override
165            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
166                    return calEventPersistence.findWithDynamicQuery(dynamicQuery);
167            }
168    
169            /**
170             * Performs a dynamic query on the database and returns a range of the matching rows.
171             *
172             * <p>
173             * 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.calendar.model.impl.CalEventModelImpl}. 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.
174             * </p>
175             *
176             * @param dynamicQuery the dynamic query
177             * @param start the lower bound of the range of model instances
178             * @param end the upper bound of the range of model instances (not inclusive)
179             * @return the range of matching rows
180             */
181            @Override
182            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
183                    int end) {
184                    return calEventPersistence.findWithDynamicQuery(dynamicQuery, start, end);
185            }
186    
187            /**
188             * Performs a dynamic query on the database and returns an ordered range of the matching rows.
189             *
190             * <p>
191             * 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.calendar.model.impl.CalEventModelImpl}. 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.
192             * </p>
193             *
194             * @param dynamicQuery the dynamic query
195             * @param start the lower bound of the range of model instances
196             * @param end the upper bound of the range of model instances (not inclusive)
197             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
198             * @return the ordered range of matching rows
199             */
200            @Override
201            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
202                    int end, OrderByComparator<T> orderByComparator) {
203                    return calEventPersistence.findWithDynamicQuery(dynamicQuery, start,
204                            end, orderByComparator);
205            }
206    
207            /**
208             * Returns the number of rows matching the dynamic query.
209             *
210             * @param dynamicQuery the dynamic query
211             * @return the number of rows matching the dynamic query
212             */
213            @Override
214            public long dynamicQueryCount(DynamicQuery dynamicQuery) {
215                    return calEventPersistence.countWithDynamicQuery(dynamicQuery);
216            }
217    
218            /**
219             * Returns the number of rows matching the dynamic query.
220             *
221             * @param dynamicQuery the dynamic query
222             * @param projection the projection to apply to the query
223             * @return the number of rows matching the dynamic query
224             */
225            @Override
226            public long dynamicQueryCount(DynamicQuery dynamicQuery,
227                    Projection projection) {
228                    return calEventPersistence.countWithDynamicQuery(dynamicQuery,
229                            projection);
230            }
231    
232            @Override
233            public CalEvent fetchCalEvent(long eventId) {
234                    return calEventPersistence.fetchByPrimaryKey(eventId);
235            }
236    
237            /**
238             * Returns the cal event matching the UUID and group.
239             *
240             * @param uuid the cal event's UUID
241             * @param groupId the primary key of the group
242             * @return the matching cal event, or <code>null</code> if a matching cal event could not be found
243             */
244            @Override
245            public CalEvent fetchCalEventByUuidAndGroupId(String uuid, long groupId) {
246                    return calEventPersistence.fetchByUUID_G(uuid, groupId);
247            }
248    
249            /**
250             * Returns the cal event with the primary key.
251             *
252             * @param eventId the primary key of the cal event
253             * @return the cal event
254             * @throws PortalException if a cal event with the primary key could not be found
255             */
256            @Override
257            public CalEvent getCalEvent(long eventId) throws PortalException {
258                    return calEventPersistence.findByPrimaryKey(eventId);
259            }
260    
261            @Override
262            public ActionableDynamicQuery getActionableDynamicQuery() {
263                    ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
264    
265                    actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.calendar.service.CalEventLocalServiceUtil.getService());
266                    actionableDynamicQuery.setClassLoader(getClassLoader());
267                    actionableDynamicQuery.setModelClass(CalEvent.class);
268    
269                    actionableDynamicQuery.setPrimaryKeyPropertyName("eventId");
270    
271                    return actionableDynamicQuery;
272            }
273    
274            @Override
275            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
276                    IndexableActionableDynamicQuery indexableActionableDynamicQuery = new IndexableActionableDynamicQuery();
277    
278                    indexableActionableDynamicQuery.setBaseLocalService(com.liferay.portlet.calendar.service.CalEventLocalServiceUtil.getService());
279                    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
280                    indexableActionableDynamicQuery.setModelClass(CalEvent.class);
281    
282                    indexableActionableDynamicQuery.setPrimaryKeyPropertyName("eventId");
283    
284                    return indexableActionableDynamicQuery;
285            }
286    
287            protected void initActionableDynamicQuery(
288                    ActionableDynamicQuery actionableDynamicQuery) {
289                    actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.calendar.service.CalEventLocalServiceUtil.getService());
290                    actionableDynamicQuery.setClassLoader(getClassLoader());
291                    actionableDynamicQuery.setModelClass(CalEvent.class);
292    
293                    actionableDynamicQuery.setPrimaryKeyPropertyName("eventId");
294            }
295    
296            @Override
297            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
298                    final PortletDataContext portletDataContext) {
299                    final ExportActionableDynamicQuery exportActionableDynamicQuery = new ExportActionableDynamicQuery() {
300                                    @Override
301                                    public long performCount() throws PortalException {
302                                            ManifestSummary manifestSummary = portletDataContext.getManifestSummary();
303    
304                                            StagedModelType stagedModelType = getStagedModelType();
305    
306                                            long modelAdditionCount = super.performCount();
307    
308                                            manifestSummary.addModelAdditionCount(stagedModelType,
309                                                    modelAdditionCount);
310    
311                                            long modelDeletionCount = ExportImportHelperUtil.getModelDeletionCount(portletDataContext,
312                                                            stagedModelType);
313    
314                                            manifestSummary.addModelDeletionCount(stagedModelType,
315                                                    modelDeletionCount);
316    
317                                            return modelAdditionCount;
318                                    }
319                            };
320    
321                    initActionableDynamicQuery(exportActionableDynamicQuery);
322    
323                    exportActionableDynamicQuery.setAddCriteriaMethod(new ActionableDynamicQuery.AddCriteriaMethod() {
324                                    @Override
325                                    public void addCriteria(DynamicQuery dynamicQuery) {
326                                            portletDataContext.addDateRangeCriteria(dynamicQuery,
327                                                    "modifiedDate");
328                                    }
329                            });
330    
331                    exportActionableDynamicQuery.setCompanyId(portletDataContext.getCompanyId());
332    
333                    exportActionableDynamicQuery.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod<CalEvent>() {
334                                    @Override
335                                    public void performAction(CalEvent calEvent)
336                                            throws PortalException {
337                                            StagedModelDataHandlerUtil.exportStagedModel(portletDataContext,
338                                                    calEvent);
339                                    }
340                            });
341                    exportActionableDynamicQuery.setStagedModelType(new StagedModelType(
342                                    PortalUtil.getClassNameId(CalEvent.class.getName())));
343    
344                    return exportActionableDynamicQuery;
345            }
346    
347            /**
348             * @throws PortalException
349             */
350            @Override
351            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
352                    throws PortalException {
353                    return calEventLocalService.deleteCalEvent((CalEvent)persistedModel);
354            }
355    
356            @Override
357            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
358                    throws PortalException {
359                    return calEventPersistence.findByPrimaryKey(primaryKeyObj);
360            }
361    
362            /**
363             * Returns all the cal events matching the UUID and company.
364             *
365             * @param uuid the UUID of the cal events
366             * @param companyId the primary key of the company
367             * @return the matching cal events, or an empty list if no matches were found
368             */
369            @Override
370            public List<CalEvent> getCalEventsByUuidAndCompanyId(String uuid,
371                    long companyId) {
372                    return calEventPersistence.findByUuid_C(uuid, companyId);
373            }
374    
375            /**
376             * Returns a range of cal events matching the UUID and company.
377             *
378             * @param uuid the UUID of the cal events
379             * @param companyId the primary key of the company
380             * @param start the lower bound of the range of cal events
381             * @param end the upper bound of the range of cal events (not inclusive)
382             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
383             * @return the range of matching cal events, or an empty list if no matches were found
384             */
385            @Override
386            public List<CalEvent> getCalEventsByUuidAndCompanyId(String uuid,
387                    long companyId, int start, int end,
388                    OrderByComparator<CalEvent> orderByComparator) {
389                    return calEventPersistence.findByUuid_C(uuid, companyId, start, end,
390                            orderByComparator);
391            }
392    
393            /**
394             * Returns the cal event matching the UUID and group.
395             *
396             * @param uuid the cal event's UUID
397             * @param groupId the primary key of the group
398             * @return the matching cal event
399             * @throws PortalException if a matching cal event could not be found
400             */
401            @Override
402            public CalEvent getCalEventByUuidAndGroupId(String uuid, long groupId)
403                    throws PortalException {
404                    return calEventPersistence.findByUUID_G(uuid, groupId);
405            }
406    
407            /**
408             * Returns a range of all the cal events.
409             *
410             * <p>
411             * 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.calendar.model.impl.CalEventModelImpl}. 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.
412             * </p>
413             *
414             * @param start the lower bound of the range of cal events
415             * @param end the upper bound of the range of cal events (not inclusive)
416             * @return the range of cal events
417             */
418            @Override
419            public List<CalEvent> getCalEvents(int start, int end) {
420                    return calEventPersistence.findAll(start, end);
421            }
422    
423            /**
424             * Returns the number of cal events.
425             *
426             * @return the number of cal events
427             */
428            @Override
429            public int getCalEventsCount() {
430                    return calEventPersistence.countAll();
431            }
432    
433            /**
434             * Updates the cal event in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
435             *
436             * @param calEvent the cal event
437             * @return the cal event that was updated
438             */
439            @Indexable(type = IndexableType.REINDEX)
440            @Override
441            public CalEvent updateCalEvent(CalEvent calEvent) {
442                    return calEventPersistence.update(calEvent);
443            }
444    
445            /**
446             * Returns the cal event local service.
447             *
448             * @return the cal event local service
449             */
450            public CalEventLocalService getCalEventLocalService() {
451                    return calEventLocalService;
452            }
453    
454            /**
455             * Sets the cal event local service.
456             *
457             * @param calEventLocalService the cal event local service
458             */
459            public void setCalEventLocalService(
460                    CalEventLocalService calEventLocalService) {
461                    this.calEventLocalService = calEventLocalService;
462            }
463    
464            /**
465             * Returns the cal event persistence.
466             *
467             * @return the cal event persistence
468             */
469            public CalEventPersistence getCalEventPersistence() {
470                    return calEventPersistence;
471            }
472    
473            /**
474             * Sets the cal event persistence.
475             *
476             * @param calEventPersistence the cal event persistence
477             */
478            public void setCalEventPersistence(CalEventPersistence calEventPersistence) {
479                    this.calEventPersistence = calEventPersistence;
480            }
481    
482            /**
483             * Returns the cal event finder.
484             *
485             * @return the cal event finder
486             */
487            public CalEventFinder getCalEventFinder() {
488                    return calEventFinder;
489            }
490    
491            /**
492             * Sets the cal event finder.
493             *
494             * @param calEventFinder the cal event finder
495             */
496            public void setCalEventFinder(CalEventFinder calEventFinder) {
497                    this.calEventFinder = calEventFinder;
498            }
499    
500            /**
501             * Returns the counter local service.
502             *
503             * @return the counter local service
504             */
505            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
506                    return counterLocalService;
507            }
508    
509            /**
510             * Sets the counter local service.
511             *
512             * @param counterLocalService the counter local service
513             */
514            public void setCounterLocalService(
515                    com.liferay.counter.service.CounterLocalService counterLocalService) {
516                    this.counterLocalService = counterLocalService;
517            }
518    
519            /**
520             * Returns the class name local service.
521             *
522             * @return the class name local service
523             */
524            public com.liferay.portal.service.ClassNameLocalService getClassNameLocalService() {
525                    return classNameLocalService;
526            }
527    
528            /**
529             * Sets the class name local service.
530             *
531             * @param classNameLocalService the class name local service
532             */
533            public void setClassNameLocalService(
534                    com.liferay.portal.service.ClassNameLocalService classNameLocalService) {
535                    this.classNameLocalService = classNameLocalService;
536            }
537    
538            /**
539             * Returns the class name persistence.
540             *
541             * @return the class name persistence
542             */
543            public ClassNamePersistence getClassNamePersistence() {
544                    return classNamePersistence;
545            }
546    
547            /**
548             * Sets the class name persistence.
549             *
550             * @param classNamePersistence the class name persistence
551             */
552            public void setClassNamePersistence(
553                    ClassNamePersistence classNamePersistence) {
554                    this.classNamePersistence = classNamePersistence;
555            }
556    
557            /**
558             * Returns the company local service.
559             *
560             * @return the company local service
561             */
562            public com.liferay.portal.service.CompanyLocalService getCompanyLocalService() {
563                    return companyLocalService;
564            }
565    
566            /**
567             * Sets the company local service.
568             *
569             * @param companyLocalService the company local service
570             */
571            public void setCompanyLocalService(
572                    com.liferay.portal.service.CompanyLocalService companyLocalService) {
573                    this.companyLocalService = companyLocalService;
574            }
575    
576            /**
577             * Returns the company persistence.
578             *
579             * @return the company persistence
580             */
581            public CompanyPersistence getCompanyPersistence() {
582                    return companyPersistence;
583            }
584    
585            /**
586             * Sets the company persistence.
587             *
588             * @param companyPersistence the company persistence
589             */
590            public void setCompanyPersistence(CompanyPersistence companyPersistence) {
591                    this.companyPersistence = companyPersistence;
592            }
593    
594            /**
595             * Returns the group local service.
596             *
597             * @return the group local service
598             */
599            public com.liferay.portal.service.GroupLocalService getGroupLocalService() {
600                    return groupLocalService;
601            }
602    
603            /**
604             * Sets the group local service.
605             *
606             * @param groupLocalService the group local service
607             */
608            public void setGroupLocalService(
609                    com.liferay.portal.service.GroupLocalService groupLocalService) {
610                    this.groupLocalService = groupLocalService;
611            }
612    
613            /**
614             * Returns the group persistence.
615             *
616             * @return the group persistence
617             */
618            public GroupPersistence getGroupPersistence() {
619                    return groupPersistence;
620            }
621    
622            /**
623             * Sets the group persistence.
624             *
625             * @param groupPersistence the group persistence
626             */
627            public void setGroupPersistence(GroupPersistence groupPersistence) {
628                    this.groupPersistence = groupPersistence;
629            }
630    
631            /**
632             * Returns the group finder.
633             *
634             * @return the group finder
635             */
636            public GroupFinder getGroupFinder() {
637                    return groupFinder;
638            }
639    
640            /**
641             * Sets the group finder.
642             *
643             * @param groupFinder the group finder
644             */
645            public void setGroupFinder(GroupFinder groupFinder) {
646                    this.groupFinder = groupFinder;
647            }
648    
649            /**
650             * Returns the portlet preferences local service.
651             *
652             * @return the portlet preferences local service
653             */
654            public com.liferay.portal.service.PortletPreferencesLocalService getPortletPreferencesLocalService() {
655                    return portletPreferencesLocalService;
656            }
657    
658            /**
659             * Sets the portlet preferences local service.
660             *
661             * @param portletPreferencesLocalService the portlet preferences local service
662             */
663            public void setPortletPreferencesLocalService(
664                    com.liferay.portal.service.PortletPreferencesLocalService portletPreferencesLocalService) {
665                    this.portletPreferencesLocalService = portletPreferencesLocalService;
666            }
667    
668            /**
669             * Returns the portlet preferences persistence.
670             *
671             * @return the portlet preferences persistence
672             */
673            public PortletPreferencesPersistence getPortletPreferencesPersistence() {
674                    return portletPreferencesPersistence;
675            }
676    
677            /**
678             * Sets the portlet preferences persistence.
679             *
680             * @param portletPreferencesPersistence the portlet preferences persistence
681             */
682            public void setPortletPreferencesPersistence(
683                    PortletPreferencesPersistence portletPreferencesPersistence) {
684                    this.portletPreferencesPersistence = portletPreferencesPersistence;
685            }
686    
687            /**
688             * Returns the portlet preferences finder.
689             *
690             * @return the portlet preferences finder
691             */
692            public PortletPreferencesFinder getPortletPreferencesFinder() {
693                    return portletPreferencesFinder;
694            }
695    
696            /**
697             * Sets the portlet preferences finder.
698             *
699             * @param portletPreferencesFinder the portlet preferences finder
700             */
701            public void setPortletPreferencesFinder(
702                    PortletPreferencesFinder portletPreferencesFinder) {
703                    this.portletPreferencesFinder = portletPreferencesFinder;
704            }
705    
706            /**
707             * Returns the resource local service.
708             *
709             * @return the resource local service
710             */
711            public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
712                    return resourceLocalService;
713            }
714    
715            /**
716             * Sets the resource local service.
717             *
718             * @param resourceLocalService the resource local service
719             */
720            public void setResourceLocalService(
721                    com.liferay.portal.service.ResourceLocalService resourceLocalService) {
722                    this.resourceLocalService = resourceLocalService;
723            }
724    
725            /**
726             * Returns the subscription local service.
727             *
728             * @return the subscription local service
729             */
730            public com.liferay.portal.service.SubscriptionLocalService getSubscriptionLocalService() {
731                    return subscriptionLocalService;
732            }
733    
734            /**
735             * Sets the subscription local service.
736             *
737             * @param subscriptionLocalService the subscription local service
738             */
739            public void setSubscriptionLocalService(
740                    com.liferay.portal.service.SubscriptionLocalService subscriptionLocalService) {
741                    this.subscriptionLocalService = subscriptionLocalService;
742            }
743    
744            /**
745             * Returns the subscription persistence.
746             *
747             * @return the subscription persistence
748             */
749            public SubscriptionPersistence getSubscriptionPersistence() {
750                    return subscriptionPersistence;
751            }
752    
753            /**
754             * Sets the subscription persistence.
755             *
756             * @param subscriptionPersistence the subscription persistence
757             */
758            public void setSubscriptionPersistence(
759                    SubscriptionPersistence subscriptionPersistence) {
760                    this.subscriptionPersistence = subscriptionPersistence;
761            }
762    
763            /**
764             * Returns the user local service.
765             *
766             * @return the user local service
767             */
768            public com.liferay.portal.service.UserLocalService getUserLocalService() {
769                    return userLocalService;
770            }
771    
772            /**
773             * Sets the user local service.
774             *
775             * @param userLocalService the user local service
776             */
777            public void setUserLocalService(
778                    com.liferay.portal.service.UserLocalService userLocalService) {
779                    this.userLocalService = userLocalService;
780            }
781    
782            /**
783             * Returns the user persistence.
784             *
785             * @return the user persistence
786             */
787            public UserPersistence getUserPersistence() {
788                    return userPersistence;
789            }
790    
791            /**
792             * Sets the user persistence.
793             *
794             * @param userPersistence the user persistence
795             */
796            public void setUserPersistence(UserPersistence userPersistence) {
797                    this.userPersistence = userPersistence;
798            }
799    
800            /**
801             * Returns the user finder.
802             *
803             * @return the user finder
804             */
805            public UserFinder getUserFinder() {
806                    return userFinder;
807            }
808    
809            /**
810             * Sets the user finder.
811             *
812             * @param userFinder the user finder
813             */
814            public void setUserFinder(UserFinder userFinder) {
815                    this.userFinder = userFinder;
816            }
817    
818            /**
819             * Returns the asset entry local service.
820             *
821             * @return the asset entry local service
822             */
823            public com.liferay.portlet.asset.service.AssetEntryLocalService getAssetEntryLocalService() {
824                    return assetEntryLocalService;
825            }
826    
827            /**
828             * Sets the asset entry local service.
829             *
830             * @param assetEntryLocalService the asset entry local service
831             */
832            public void setAssetEntryLocalService(
833                    com.liferay.portlet.asset.service.AssetEntryLocalService assetEntryLocalService) {
834                    this.assetEntryLocalService = assetEntryLocalService;
835            }
836    
837            /**
838             * Returns the asset entry persistence.
839             *
840             * @return the asset entry persistence
841             */
842            public AssetEntryPersistence getAssetEntryPersistence() {
843                    return assetEntryPersistence;
844            }
845    
846            /**
847             * Sets the asset entry persistence.
848             *
849             * @param assetEntryPersistence the asset entry persistence
850             */
851            public void setAssetEntryPersistence(
852                    AssetEntryPersistence assetEntryPersistence) {
853                    this.assetEntryPersistence = assetEntryPersistence;
854            }
855    
856            /**
857             * Returns the asset entry finder.
858             *
859             * @return the asset entry finder
860             */
861            public AssetEntryFinder getAssetEntryFinder() {
862                    return assetEntryFinder;
863            }
864    
865            /**
866             * Sets the asset entry finder.
867             *
868             * @param assetEntryFinder the asset entry finder
869             */
870            public void setAssetEntryFinder(AssetEntryFinder assetEntryFinder) {
871                    this.assetEntryFinder = assetEntryFinder;
872            }
873    
874            /**
875             * Returns the asset link local service.
876             *
877             * @return the asset link local service
878             */
879            public com.liferay.portlet.asset.service.AssetLinkLocalService getAssetLinkLocalService() {
880                    return assetLinkLocalService;
881            }
882    
883            /**
884             * Sets the asset link local service.
885             *
886             * @param assetLinkLocalService the asset link local service
887             */
888            public void setAssetLinkLocalService(
889                    com.liferay.portlet.asset.service.AssetLinkLocalService assetLinkLocalService) {
890                    this.assetLinkLocalService = assetLinkLocalService;
891            }
892    
893            /**
894             * Returns the asset link persistence.
895             *
896             * @return the asset link persistence
897             */
898            public AssetLinkPersistence getAssetLinkPersistence() {
899                    return assetLinkPersistence;
900            }
901    
902            /**
903             * Sets the asset link persistence.
904             *
905             * @param assetLinkPersistence the asset link persistence
906             */
907            public void setAssetLinkPersistence(
908                    AssetLinkPersistence assetLinkPersistence) {
909                    this.assetLinkPersistence = assetLinkPersistence;
910            }
911    
912            /**
913             * Returns the asset tag local service.
914             *
915             * @return the asset tag local service
916             */
917            public com.liferay.portlet.asset.service.AssetTagLocalService getAssetTagLocalService() {
918                    return assetTagLocalService;
919            }
920    
921            /**
922             * Sets the asset tag local service.
923             *
924             * @param assetTagLocalService the asset tag local service
925             */
926            public void setAssetTagLocalService(
927                    com.liferay.portlet.asset.service.AssetTagLocalService assetTagLocalService) {
928                    this.assetTagLocalService = assetTagLocalService;
929            }
930    
931            /**
932             * Returns the asset tag persistence.
933             *
934             * @return the asset tag persistence
935             */
936            public AssetTagPersistence getAssetTagPersistence() {
937                    return assetTagPersistence;
938            }
939    
940            /**
941             * Sets the asset tag persistence.
942             *
943             * @param assetTagPersistence the asset tag persistence
944             */
945            public void setAssetTagPersistence(AssetTagPersistence assetTagPersistence) {
946                    this.assetTagPersistence = assetTagPersistence;
947            }
948    
949            /**
950             * Returns the asset tag finder.
951             *
952             * @return the asset tag finder
953             */
954            public AssetTagFinder getAssetTagFinder() {
955                    return assetTagFinder;
956            }
957    
958            /**
959             * Sets the asset tag finder.
960             *
961             * @param assetTagFinder the asset tag finder
962             */
963            public void setAssetTagFinder(AssetTagFinder assetTagFinder) {
964                    this.assetTagFinder = assetTagFinder;
965            }
966    
967            /**
968             * Returns the expando value local service.
969             *
970             * @return the expando value local service
971             */
972            public com.liferay.portlet.expando.service.ExpandoValueLocalService getExpandoValueLocalService() {
973                    return expandoValueLocalService;
974            }
975    
976            /**
977             * Sets the expando value local service.
978             *
979             * @param expandoValueLocalService the expando value local service
980             */
981            public void setExpandoValueLocalService(
982                    com.liferay.portlet.expando.service.ExpandoValueLocalService expandoValueLocalService) {
983                    this.expandoValueLocalService = expandoValueLocalService;
984            }
985    
986            /**
987             * Returns the expando value persistence.
988             *
989             * @return the expando value persistence
990             */
991            public ExpandoValuePersistence getExpandoValuePersistence() {
992                    return expandoValuePersistence;
993            }
994    
995            /**
996             * Sets the expando value persistence.
997             *
998             * @param expandoValuePersistence the expando value persistence
999             */
1000            public void setExpandoValuePersistence(
1001                    ExpandoValuePersistence expandoValuePersistence) {
1002                    this.expandoValuePersistence = expandoValuePersistence;
1003            }
1004    
1005            /**
1006             * Returns the message-boards message local service.
1007             *
1008             * @return the message-boards message local service
1009             */
1010            public com.liferay.portlet.messageboards.service.MBMessageLocalService getMBMessageLocalService() {
1011                    return mbMessageLocalService;
1012            }
1013    
1014            /**
1015             * Sets the message-boards message local service.
1016             *
1017             * @param mbMessageLocalService the message-boards message local service
1018             */
1019            public void setMBMessageLocalService(
1020                    com.liferay.portlet.messageboards.service.MBMessageLocalService mbMessageLocalService) {
1021                    this.mbMessageLocalService = mbMessageLocalService;
1022            }
1023    
1024            /**
1025             * Returns the message-boards message persistence.
1026             *
1027             * @return the message-boards message persistence
1028             */
1029            public MBMessagePersistence getMBMessagePersistence() {
1030                    return mbMessagePersistence;
1031            }
1032    
1033            /**
1034             * Sets the message-boards message persistence.
1035             *
1036             * @param mbMessagePersistence the message-boards message persistence
1037             */
1038            public void setMBMessagePersistence(
1039                    MBMessagePersistence mbMessagePersistence) {
1040                    this.mbMessagePersistence = mbMessagePersistence;
1041            }
1042    
1043            /**
1044             * Returns the message-boards message finder.
1045             *
1046             * @return the message-boards message finder
1047             */
1048            public MBMessageFinder getMBMessageFinder() {
1049                    return mbMessageFinder;
1050            }
1051    
1052            /**
1053             * Sets the message-boards message finder.
1054             *
1055             * @param mbMessageFinder the message-boards message finder
1056             */
1057            public void setMBMessageFinder(MBMessageFinder mbMessageFinder) {
1058                    this.mbMessageFinder = mbMessageFinder;
1059            }
1060    
1061            /**
1062             * Returns the social activity local service.
1063             *
1064             * @return the social activity local service
1065             */
1066            public com.liferay.portlet.social.service.SocialActivityLocalService getSocialActivityLocalService() {
1067                    return socialActivityLocalService;
1068            }
1069    
1070            /**
1071             * Sets the social activity local service.
1072             *
1073             * @param socialActivityLocalService the social activity local service
1074             */
1075            public void setSocialActivityLocalService(
1076                    com.liferay.portlet.social.service.SocialActivityLocalService socialActivityLocalService) {
1077                    this.socialActivityLocalService = socialActivityLocalService;
1078            }
1079    
1080            /**
1081             * Returns the social activity persistence.
1082             *
1083             * @return the social activity persistence
1084             */
1085            public SocialActivityPersistence getSocialActivityPersistence() {
1086                    return socialActivityPersistence;
1087            }
1088    
1089            /**
1090             * Sets the social activity persistence.
1091             *
1092             * @param socialActivityPersistence the social activity persistence
1093             */
1094            public void setSocialActivityPersistence(
1095                    SocialActivityPersistence socialActivityPersistence) {
1096                    this.socialActivityPersistence = socialActivityPersistence;
1097            }
1098    
1099            /**
1100             * Returns the social activity finder.
1101             *
1102             * @return the social activity finder
1103             */
1104            public SocialActivityFinder getSocialActivityFinder() {
1105                    return socialActivityFinder;
1106            }
1107    
1108            /**
1109             * Sets the social activity finder.
1110             *
1111             * @param socialActivityFinder the social activity finder
1112             */
1113            public void setSocialActivityFinder(
1114                    SocialActivityFinder socialActivityFinder) {
1115                    this.socialActivityFinder = socialActivityFinder;
1116            }
1117    
1118            public void afterPropertiesSet() {
1119                    persistedModelLocalServiceRegistry.register("com.liferay.portlet.calendar.model.CalEvent",
1120                            calEventLocalService);
1121            }
1122    
1123            public void destroy() {
1124                    persistedModelLocalServiceRegistry.unregister(
1125                            "com.liferay.portlet.calendar.model.CalEvent");
1126            }
1127    
1128            /**
1129             * Returns the OSGi service identifier.
1130             *
1131             * @return the OSGi service identifier
1132             */
1133            @Override
1134            public String getOSGiServiceIdentifier() {
1135                    return CalEventLocalService.class.getName();
1136            }
1137    
1138            protected Class<?> getModelClass() {
1139                    return CalEvent.class;
1140            }
1141    
1142            protected String getModelClassName() {
1143                    return CalEvent.class.getName();
1144            }
1145    
1146            /**
1147             * Performs a SQL query.
1148             *
1149             * @param sql the sql query
1150             */
1151            protected void runSQL(String sql) {
1152                    try {
1153                            DataSource dataSource = calEventPersistence.getDataSource();
1154    
1155                            DB db = DBManagerUtil.getDB();
1156    
1157                            sql = db.buildSQL(sql);
1158                            sql = PortalUtil.transformSQL(sql);
1159    
1160                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
1161                                            sql, new int[0]);
1162    
1163                            sqlUpdate.update();
1164                    }
1165                    catch (Exception e) {
1166                            throw new SystemException(e);
1167                    }
1168            }
1169    
1170            @BeanReference(type = com.liferay.portlet.calendar.service.CalEventLocalService.class)
1171            protected CalEventLocalService calEventLocalService;
1172            @BeanReference(type = CalEventPersistence.class)
1173            protected CalEventPersistence calEventPersistence;
1174            @BeanReference(type = CalEventFinder.class)
1175            protected CalEventFinder calEventFinder;
1176            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
1177            protected com.liferay.counter.service.CounterLocalService counterLocalService;
1178            @BeanReference(type = com.liferay.portal.service.ClassNameLocalService.class)
1179            protected com.liferay.portal.service.ClassNameLocalService classNameLocalService;
1180            @BeanReference(type = ClassNamePersistence.class)
1181            protected ClassNamePersistence classNamePersistence;
1182            @BeanReference(type = com.liferay.portal.service.CompanyLocalService.class)
1183            protected com.liferay.portal.service.CompanyLocalService companyLocalService;
1184            @BeanReference(type = CompanyPersistence.class)
1185            protected CompanyPersistence companyPersistence;
1186            @BeanReference(type = com.liferay.portal.service.GroupLocalService.class)
1187            protected com.liferay.portal.service.GroupLocalService groupLocalService;
1188            @BeanReference(type = GroupPersistence.class)
1189            protected GroupPersistence groupPersistence;
1190            @BeanReference(type = GroupFinder.class)
1191            protected GroupFinder groupFinder;
1192            @BeanReference(type = com.liferay.portal.service.PortletPreferencesLocalService.class)
1193            protected com.liferay.portal.service.PortletPreferencesLocalService portletPreferencesLocalService;
1194            @BeanReference(type = PortletPreferencesPersistence.class)
1195            protected PortletPreferencesPersistence portletPreferencesPersistence;
1196            @BeanReference(type = PortletPreferencesFinder.class)
1197            protected PortletPreferencesFinder portletPreferencesFinder;
1198            @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
1199            protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
1200            @BeanReference(type = com.liferay.portal.service.SubscriptionLocalService.class)
1201            protected com.liferay.portal.service.SubscriptionLocalService subscriptionLocalService;
1202            @BeanReference(type = SubscriptionPersistence.class)
1203            protected SubscriptionPersistence subscriptionPersistence;
1204            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
1205            protected com.liferay.portal.service.UserLocalService userLocalService;
1206            @BeanReference(type = UserPersistence.class)
1207            protected UserPersistence userPersistence;
1208            @BeanReference(type = UserFinder.class)
1209            protected UserFinder userFinder;
1210            @BeanReference(type = com.liferay.portlet.asset.service.AssetEntryLocalService.class)
1211            protected com.liferay.portlet.asset.service.AssetEntryLocalService assetEntryLocalService;
1212            @BeanReference(type = AssetEntryPersistence.class)
1213            protected AssetEntryPersistence assetEntryPersistence;
1214            @BeanReference(type = AssetEntryFinder.class)
1215            protected AssetEntryFinder assetEntryFinder;
1216            @BeanReference(type = com.liferay.portlet.asset.service.AssetLinkLocalService.class)
1217            protected com.liferay.portlet.asset.service.AssetLinkLocalService assetLinkLocalService;
1218            @BeanReference(type = AssetLinkPersistence.class)
1219            protected AssetLinkPersistence assetLinkPersistence;
1220            @BeanReference(type = com.liferay.portlet.asset.service.AssetTagLocalService.class)
1221            protected com.liferay.portlet.asset.service.AssetTagLocalService assetTagLocalService;
1222            @BeanReference(type = AssetTagPersistence.class)
1223            protected AssetTagPersistence assetTagPersistence;
1224            @BeanReference(type = AssetTagFinder.class)
1225            protected AssetTagFinder assetTagFinder;
1226            @BeanReference(type = com.liferay.portlet.expando.service.ExpandoValueLocalService.class)
1227            protected com.liferay.portlet.expando.service.ExpandoValueLocalService expandoValueLocalService;
1228            @BeanReference(type = ExpandoValuePersistence.class)
1229            protected ExpandoValuePersistence expandoValuePersistence;
1230            @BeanReference(type = com.liferay.portlet.messageboards.service.MBMessageLocalService.class)
1231            protected com.liferay.portlet.messageboards.service.MBMessageLocalService mbMessageLocalService;
1232            @BeanReference(type = MBMessagePersistence.class)
1233            protected MBMessagePersistence mbMessagePersistence;
1234            @BeanReference(type = MBMessageFinder.class)
1235            protected MBMessageFinder mbMessageFinder;
1236            @BeanReference(type = com.liferay.portlet.social.service.SocialActivityLocalService.class)
1237            protected com.liferay.portlet.social.service.SocialActivityLocalService socialActivityLocalService;
1238            @BeanReference(type = SocialActivityPersistence.class)
1239            protected SocialActivityPersistence socialActivityPersistence;
1240            @BeanReference(type = SocialActivityFinder.class)
1241            protected SocialActivityFinder socialActivityFinder;
1242            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
1243            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
1244    }