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.announcements.service.base;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.announcements.kernel.model.AnnouncementsEntry;
020    import com.liferay.announcements.kernel.service.AnnouncementsEntryLocalService;
021    import com.liferay.announcements.kernel.service.persistence.AnnouncementsDeliveryPersistence;
022    import com.liferay.announcements.kernel.service.persistence.AnnouncementsEntryFinder;
023    import com.liferay.announcements.kernel.service.persistence.AnnouncementsEntryPersistence;
024    import com.liferay.announcements.kernel.service.persistence.AnnouncementsFlagPersistence;
025    
026    import com.liferay.exportimport.kernel.lar.ExportImportHelperUtil;
027    import com.liferay.exportimport.kernel.lar.ManifestSummary;
028    import com.liferay.exportimport.kernel.lar.PortletDataContext;
029    import com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil;
030    import com.liferay.exportimport.kernel.lar.StagedModelType;
031    
032    import com.liferay.portal.kernel.bean.BeanReference;
033    import com.liferay.portal.kernel.dao.db.DB;
034    import com.liferay.portal.kernel.dao.db.DBManagerUtil;
035    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
036    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
037    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
038    import com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery;
039    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
040    import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
041    import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery;
042    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
043    import com.liferay.portal.kernel.dao.orm.Projection;
044    import com.liferay.portal.kernel.dao.orm.Property;
045    import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil;
046    import com.liferay.portal.kernel.exception.PortalException;
047    import com.liferay.portal.kernel.exception.SystemException;
048    import com.liferay.portal.kernel.model.PersistedModel;
049    import com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService;
050    import com.liferay.portal.kernel.search.Indexable;
051    import com.liferay.portal.kernel.search.IndexableType;
052    import com.liferay.portal.kernel.service.BaseLocalServiceImpl;
053    import com.liferay.portal.kernel.service.PersistedModelLocalServiceRegistry;
054    import com.liferay.portal.kernel.service.persistence.CompanyPersistence;
055    import com.liferay.portal.kernel.service.persistence.GroupFinder;
056    import com.liferay.portal.kernel.service.persistence.GroupPersistence;
057    import com.liferay.portal.kernel.service.persistence.OrganizationFinder;
058    import com.liferay.portal.kernel.service.persistence.OrganizationPersistence;
059    import com.liferay.portal.kernel.service.persistence.RoleFinder;
060    import com.liferay.portal.kernel.service.persistence.RolePersistence;
061    import com.liferay.portal.kernel.service.persistence.TeamFinder;
062    import com.liferay.portal.kernel.service.persistence.TeamPersistence;
063    import com.liferay.portal.kernel.service.persistence.UserFinder;
064    import com.liferay.portal.kernel.service.persistence.UserGroupFinder;
065    import com.liferay.portal.kernel.service.persistence.UserGroupPersistence;
066    import com.liferay.portal.kernel.service.persistence.UserPersistence;
067    import com.liferay.portal.kernel.util.OrderByComparator;
068    import com.liferay.portal.kernel.util.PortalUtil;
069    
070    import java.io.Serializable;
071    
072    import java.util.List;
073    
074    import javax.sql.DataSource;
075    
076    /**
077     * Provides the base implementation for the announcements entry local service.
078     *
079     * <p>
080     * 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.announcements.service.impl.AnnouncementsEntryLocalServiceImpl}.
081     * </p>
082     *
083     * @author Brian Wing Shun Chan
084     * @see com.liferay.portlet.announcements.service.impl.AnnouncementsEntryLocalServiceImpl
085     * @see com.liferay.announcements.kernel.service.AnnouncementsEntryLocalServiceUtil
086     * @generated
087     */
088    @ProviderType
089    public abstract class AnnouncementsEntryLocalServiceBaseImpl
090            extends BaseLocalServiceImpl implements AnnouncementsEntryLocalService,
091                    IdentifiableOSGiService {
092            /*
093             * NOTE FOR DEVELOPERS:
094             *
095             * Never modify or reference this class directly. Always use {@link com.liferay.announcements.kernel.service.AnnouncementsEntryLocalServiceUtil} to access the announcements entry local service.
096             */
097    
098            /**
099             * Adds the announcements entry to the database. Also notifies the appropriate model listeners.
100             *
101             * @param announcementsEntry the announcements entry
102             * @return the announcements entry that was added
103             */
104            @Indexable(type = IndexableType.REINDEX)
105            @Override
106            public AnnouncementsEntry addAnnouncementsEntry(
107                    AnnouncementsEntry announcementsEntry) {
108                    announcementsEntry.setNew(true);
109    
110                    return announcementsEntryPersistence.update(announcementsEntry);
111            }
112    
113            /**
114             * Creates a new announcements entry with the primary key. Does not add the announcements entry to the database.
115             *
116             * @param entryId the primary key for the new announcements entry
117             * @return the new announcements entry
118             */
119            @Override
120            public AnnouncementsEntry createAnnouncementsEntry(long entryId) {
121                    return announcementsEntryPersistence.create(entryId);
122            }
123    
124            /**
125             * Deletes the announcements entry with the primary key from the database. Also notifies the appropriate model listeners.
126             *
127             * @param entryId the primary key of the announcements entry
128             * @return the announcements entry that was removed
129             * @throws PortalException if a announcements entry with the primary key could not be found
130             */
131            @Indexable(type = IndexableType.DELETE)
132            @Override
133            public AnnouncementsEntry deleteAnnouncementsEntry(long entryId)
134                    throws PortalException {
135                    return announcementsEntryPersistence.remove(entryId);
136            }
137    
138            /**
139             * Deletes the announcements entry from the database. Also notifies the appropriate model listeners.
140             *
141             * @param announcementsEntry the announcements entry
142             * @return the announcements entry that was removed
143             */
144            @Indexable(type = IndexableType.DELETE)
145            @Override
146            public AnnouncementsEntry deleteAnnouncementsEntry(
147                    AnnouncementsEntry announcementsEntry) {
148                    return announcementsEntryPersistence.remove(announcementsEntry);
149            }
150    
151            @Override
152            public DynamicQuery dynamicQuery() {
153                    Class<?> clazz = getClass();
154    
155                    return DynamicQueryFactoryUtil.forClass(AnnouncementsEntry.class,
156                            clazz.getClassLoader());
157            }
158    
159            /**
160             * Performs a dynamic query on the database and returns the matching rows.
161             *
162             * @param dynamicQuery the dynamic query
163             * @return the matching rows
164             */
165            @Override
166            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
167                    return announcementsEntryPersistence.findWithDynamicQuery(dynamicQuery);
168            }
169    
170            /**
171             * Performs a dynamic query on the database and returns a range of the matching rows.
172             *
173             * <p>
174             * 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.announcements.model.impl.AnnouncementsEntryModelImpl}. 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.
175             * </p>
176             *
177             * @param dynamicQuery the dynamic query
178             * @param start the lower bound of the range of model instances
179             * @param end the upper bound of the range of model instances (not inclusive)
180             * @return the range of matching rows
181             */
182            @Override
183            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
184                    int end) {
185                    return announcementsEntryPersistence.findWithDynamicQuery(dynamicQuery,
186                            start, end);
187            }
188    
189            /**
190             * Performs a dynamic query on the database and returns an ordered range of the matching rows.
191             *
192             * <p>
193             * 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.announcements.model.impl.AnnouncementsEntryModelImpl}. 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.
194             * </p>
195             *
196             * @param dynamicQuery the dynamic query
197             * @param start the lower bound of the range of model instances
198             * @param end the upper bound of the range of model instances (not inclusive)
199             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
200             * @return the ordered range of matching rows
201             */
202            @Override
203            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
204                    int end, OrderByComparator<T> orderByComparator) {
205                    return announcementsEntryPersistence.findWithDynamicQuery(dynamicQuery,
206                            start, end, orderByComparator);
207            }
208    
209            /**
210             * Returns the number of rows matching the dynamic query.
211             *
212             * @param dynamicQuery the dynamic query
213             * @return the number of rows matching the dynamic query
214             */
215            @Override
216            public long dynamicQueryCount(DynamicQuery dynamicQuery) {
217                    return announcementsEntryPersistence.countWithDynamicQuery(dynamicQuery);
218            }
219    
220            /**
221             * Returns the number of rows matching the dynamic query.
222             *
223             * @param dynamicQuery the dynamic query
224             * @param projection the projection to apply to the query
225             * @return the number of rows matching the dynamic query
226             */
227            @Override
228            public long dynamicQueryCount(DynamicQuery dynamicQuery,
229                    Projection projection) {
230                    return announcementsEntryPersistence.countWithDynamicQuery(dynamicQuery,
231                            projection);
232            }
233    
234            @Override
235            public AnnouncementsEntry fetchAnnouncementsEntry(long entryId) {
236                    return announcementsEntryPersistence.fetchByPrimaryKey(entryId);
237            }
238    
239            /**
240             * Returns the announcements entry with the matching UUID and company.
241             *
242             * @param uuid the announcements entry's UUID
243             * @param companyId the primary key of the company
244             * @return the matching announcements entry, or <code>null</code> if a matching announcements entry could not be found
245             */
246            @Override
247            public AnnouncementsEntry fetchAnnouncementsEntryByUuidAndCompanyId(
248                    String uuid, long companyId) {
249                    return announcementsEntryPersistence.fetchByUuid_C_First(uuid,
250                            companyId, null);
251            }
252    
253            /**
254             * Returns the announcements entry with the primary key.
255             *
256             * @param entryId the primary key of the announcements entry
257             * @return the announcements entry
258             * @throws PortalException if a announcements entry with the primary key could not be found
259             */
260            @Override
261            public AnnouncementsEntry getAnnouncementsEntry(long entryId)
262                    throws PortalException {
263                    return announcementsEntryPersistence.findByPrimaryKey(entryId);
264            }
265    
266            @Override
267            public ActionableDynamicQuery getActionableDynamicQuery() {
268                    ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
269    
270                    actionableDynamicQuery.setBaseLocalService(com.liferay.announcements.kernel.service.AnnouncementsEntryLocalServiceUtil.getService());
271                    actionableDynamicQuery.setClassLoader(getClassLoader());
272                    actionableDynamicQuery.setModelClass(AnnouncementsEntry.class);
273    
274                    actionableDynamicQuery.setPrimaryKeyPropertyName("entryId");
275    
276                    return actionableDynamicQuery;
277            }
278    
279            @Override
280            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
281                    IndexableActionableDynamicQuery indexableActionableDynamicQuery = new IndexableActionableDynamicQuery();
282    
283                    indexableActionableDynamicQuery.setBaseLocalService(com.liferay.announcements.kernel.service.AnnouncementsEntryLocalServiceUtil.getService());
284                    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
285                    indexableActionableDynamicQuery.setModelClass(AnnouncementsEntry.class);
286    
287                    indexableActionableDynamicQuery.setPrimaryKeyPropertyName("entryId");
288    
289                    return indexableActionableDynamicQuery;
290            }
291    
292            protected void initActionableDynamicQuery(
293                    ActionableDynamicQuery actionableDynamicQuery) {
294                    actionableDynamicQuery.setBaseLocalService(com.liferay.announcements.kernel.service.AnnouncementsEntryLocalServiceUtil.getService());
295                    actionableDynamicQuery.setClassLoader(getClassLoader());
296                    actionableDynamicQuery.setModelClass(AnnouncementsEntry.class);
297    
298                    actionableDynamicQuery.setPrimaryKeyPropertyName("entryId");
299            }
300    
301            @Override
302            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
303                    final PortletDataContext portletDataContext) {
304                    final ExportActionableDynamicQuery exportActionableDynamicQuery = new ExportActionableDynamicQuery() {
305                                    @Override
306                                    public long performCount() throws PortalException {
307                                            ManifestSummary manifestSummary = portletDataContext.getManifestSummary();
308    
309                                            StagedModelType stagedModelType = getStagedModelType();
310    
311                                            long modelAdditionCount = super.performCount();
312    
313                                            manifestSummary.addModelAdditionCount(stagedModelType,
314                                                    modelAdditionCount);
315    
316                                            long modelDeletionCount = ExportImportHelperUtil.getModelDeletionCount(portletDataContext,
317                                                            stagedModelType);
318    
319                                            manifestSummary.addModelDeletionCount(stagedModelType,
320                                                    modelDeletionCount);
321    
322                                            return modelAdditionCount;
323                                    }
324                            };
325    
326                    initActionableDynamicQuery(exportActionableDynamicQuery);
327    
328                    exportActionableDynamicQuery.setAddCriteriaMethod(new ActionableDynamicQuery.AddCriteriaMethod() {
329                                    @Override
330                                    public void addCriteria(DynamicQuery dynamicQuery) {
331                                            portletDataContext.addDateRangeCriteria(dynamicQuery,
332                                                    "modifiedDate");
333    
334                                            StagedModelType stagedModelType = exportActionableDynamicQuery.getStagedModelType();
335    
336                                            long referrerClassNameId = stagedModelType.getReferrerClassNameId();
337    
338                                            Property classNameIdProperty = PropertyFactoryUtil.forName(
339                                                            "classNameId");
340    
341                                            if ((referrerClassNameId != StagedModelType.REFERRER_CLASS_NAME_ID_ALL) &&
342                                                            (referrerClassNameId != StagedModelType.REFERRER_CLASS_NAME_ID_ANY)) {
343                                                    dynamicQuery.add(classNameIdProperty.eq(
344                                                                    stagedModelType.getReferrerClassNameId()));
345                                            }
346                                            else if (referrerClassNameId == StagedModelType.REFERRER_CLASS_NAME_ID_ANY) {
347                                                    dynamicQuery.add(classNameIdProperty.isNotNull());
348                                            }
349                                    }
350                            });
351    
352                    exportActionableDynamicQuery.setCompanyId(portletDataContext.getCompanyId());
353    
354                    exportActionableDynamicQuery.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod<AnnouncementsEntry>() {
355                                    @Override
356                                    public void performAction(AnnouncementsEntry announcementsEntry)
357                                            throws PortalException {
358                                            StagedModelDataHandlerUtil.exportStagedModel(portletDataContext,
359                                                    announcementsEntry);
360                                    }
361                            });
362                    exportActionableDynamicQuery.setStagedModelType(new StagedModelType(
363                                    PortalUtil.getClassNameId(AnnouncementsEntry.class.getName()),
364                                    StagedModelType.REFERRER_CLASS_NAME_ID_ALL));
365    
366                    return exportActionableDynamicQuery;
367            }
368    
369            /**
370             * @throws PortalException
371             */
372            @Override
373            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
374                    throws PortalException {
375                    return announcementsEntryLocalService.deleteAnnouncementsEntry((AnnouncementsEntry)persistedModel);
376            }
377    
378            @Override
379            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
380                    throws PortalException {
381                    return announcementsEntryPersistence.findByPrimaryKey(primaryKeyObj);
382            }
383    
384            /**
385             * Returns the announcements entry with the matching UUID and company.
386             *
387             * @param uuid the announcements entry's UUID
388             * @param companyId the primary key of the company
389             * @return the matching announcements entry
390             * @throws PortalException if a matching announcements entry could not be found
391             */
392            @Override
393            public AnnouncementsEntry getAnnouncementsEntryByUuidAndCompanyId(
394                    String uuid, long companyId) throws PortalException {
395                    return announcementsEntryPersistence.findByUuid_C_First(uuid,
396                            companyId, null);
397            }
398    
399            /**
400             * Returns a range of all the announcements entries.
401             *
402             * <p>
403             * 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.announcements.model.impl.AnnouncementsEntryModelImpl}. 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.
404             * </p>
405             *
406             * @param start the lower bound of the range of announcements entries
407             * @param end the upper bound of the range of announcements entries (not inclusive)
408             * @return the range of announcements entries
409             */
410            @Override
411            public List<AnnouncementsEntry> getAnnouncementsEntries(int start, int end) {
412                    return announcementsEntryPersistence.findAll(start, end);
413            }
414    
415            /**
416             * Returns the number of announcements entries.
417             *
418             * @return the number of announcements entries
419             */
420            @Override
421            public int getAnnouncementsEntriesCount() {
422                    return announcementsEntryPersistence.countAll();
423            }
424    
425            /**
426             * Updates the announcements entry in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
427             *
428             * @param announcementsEntry the announcements entry
429             * @return the announcements entry that was updated
430             */
431            @Indexable(type = IndexableType.REINDEX)
432            @Override
433            public AnnouncementsEntry updateAnnouncementsEntry(
434                    AnnouncementsEntry announcementsEntry) {
435                    return announcementsEntryPersistence.update(announcementsEntry);
436            }
437    
438            /**
439             * Returns the announcements entry local service.
440             *
441             * @return the announcements entry local service
442             */
443            public AnnouncementsEntryLocalService getAnnouncementsEntryLocalService() {
444                    return announcementsEntryLocalService;
445            }
446    
447            /**
448             * Sets the announcements entry local service.
449             *
450             * @param announcementsEntryLocalService the announcements entry local service
451             */
452            public void setAnnouncementsEntryLocalService(
453                    AnnouncementsEntryLocalService announcementsEntryLocalService) {
454                    this.announcementsEntryLocalService = announcementsEntryLocalService;
455            }
456    
457            /**
458             * Returns the announcements entry persistence.
459             *
460             * @return the announcements entry persistence
461             */
462            public AnnouncementsEntryPersistence getAnnouncementsEntryPersistence() {
463                    return announcementsEntryPersistence;
464            }
465    
466            /**
467             * Sets the announcements entry persistence.
468             *
469             * @param announcementsEntryPersistence the announcements entry persistence
470             */
471            public void setAnnouncementsEntryPersistence(
472                    AnnouncementsEntryPersistence announcementsEntryPersistence) {
473                    this.announcementsEntryPersistence = announcementsEntryPersistence;
474            }
475    
476            /**
477             * Returns the announcements entry finder.
478             *
479             * @return the announcements entry finder
480             */
481            public AnnouncementsEntryFinder getAnnouncementsEntryFinder() {
482                    return announcementsEntryFinder;
483            }
484    
485            /**
486             * Sets the announcements entry finder.
487             *
488             * @param announcementsEntryFinder the announcements entry finder
489             */
490            public void setAnnouncementsEntryFinder(
491                    AnnouncementsEntryFinder announcementsEntryFinder) {
492                    this.announcementsEntryFinder = announcementsEntryFinder;
493            }
494    
495            /**
496             * Returns the counter local service.
497             *
498             * @return the counter local service
499             */
500            public com.liferay.counter.kernel.service.CounterLocalService getCounterLocalService() {
501                    return counterLocalService;
502            }
503    
504            /**
505             * Sets the counter local service.
506             *
507             * @param counterLocalService the counter local service
508             */
509            public void setCounterLocalService(
510                    com.liferay.counter.kernel.service.CounterLocalService counterLocalService) {
511                    this.counterLocalService = counterLocalService;
512            }
513    
514            /**
515             * Returns the company local service.
516             *
517             * @return the company local service
518             */
519            public com.liferay.portal.kernel.service.CompanyLocalService getCompanyLocalService() {
520                    return companyLocalService;
521            }
522    
523            /**
524             * Sets the company local service.
525             *
526             * @param companyLocalService the company local service
527             */
528            public void setCompanyLocalService(
529                    com.liferay.portal.kernel.service.CompanyLocalService companyLocalService) {
530                    this.companyLocalService = companyLocalService;
531            }
532    
533            /**
534             * Returns the company persistence.
535             *
536             * @return the company persistence
537             */
538            public CompanyPersistence getCompanyPersistence() {
539                    return companyPersistence;
540            }
541    
542            /**
543             * Sets the company persistence.
544             *
545             * @param companyPersistence the company persistence
546             */
547            public void setCompanyPersistence(CompanyPersistence companyPersistence) {
548                    this.companyPersistence = companyPersistence;
549            }
550    
551            /**
552             * Returns the group local service.
553             *
554             * @return the group local service
555             */
556            public com.liferay.portal.kernel.service.GroupLocalService getGroupLocalService() {
557                    return groupLocalService;
558            }
559    
560            /**
561             * Sets the group local service.
562             *
563             * @param groupLocalService the group local service
564             */
565            public void setGroupLocalService(
566                    com.liferay.portal.kernel.service.GroupLocalService groupLocalService) {
567                    this.groupLocalService = groupLocalService;
568            }
569    
570            /**
571             * Returns the group persistence.
572             *
573             * @return the group persistence
574             */
575            public GroupPersistence getGroupPersistence() {
576                    return groupPersistence;
577            }
578    
579            /**
580             * Sets the group persistence.
581             *
582             * @param groupPersistence the group persistence
583             */
584            public void setGroupPersistence(GroupPersistence groupPersistence) {
585                    this.groupPersistence = groupPersistence;
586            }
587    
588            /**
589             * Returns the group finder.
590             *
591             * @return the group finder
592             */
593            public GroupFinder getGroupFinder() {
594                    return groupFinder;
595            }
596    
597            /**
598             * Sets the group finder.
599             *
600             * @param groupFinder the group finder
601             */
602            public void setGroupFinder(GroupFinder groupFinder) {
603                    this.groupFinder = groupFinder;
604            }
605    
606            /**
607             * Returns the organization local service.
608             *
609             * @return the organization local service
610             */
611            public com.liferay.portal.kernel.service.OrganizationLocalService getOrganizationLocalService() {
612                    return organizationLocalService;
613            }
614    
615            /**
616             * Sets the organization local service.
617             *
618             * @param organizationLocalService the organization local service
619             */
620            public void setOrganizationLocalService(
621                    com.liferay.portal.kernel.service.OrganizationLocalService organizationLocalService) {
622                    this.organizationLocalService = organizationLocalService;
623            }
624    
625            /**
626             * Returns the organization persistence.
627             *
628             * @return the organization persistence
629             */
630            public OrganizationPersistence getOrganizationPersistence() {
631                    return organizationPersistence;
632            }
633    
634            /**
635             * Sets the organization persistence.
636             *
637             * @param organizationPersistence the organization persistence
638             */
639            public void setOrganizationPersistence(
640                    OrganizationPersistence organizationPersistence) {
641                    this.organizationPersistence = organizationPersistence;
642            }
643    
644            /**
645             * Returns the organization finder.
646             *
647             * @return the organization finder
648             */
649            public OrganizationFinder getOrganizationFinder() {
650                    return organizationFinder;
651            }
652    
653            /**
654             * Sets the organization finder.
655             *
656             * @param organizationFinder the organization finder
657             */
658            public void setOrganizationFinder(OrganizationFinder organizationFinder) {
659                    this.organizationFinder = organizationFinder;
660            }
661    
662            /**
663             * Returns the resource local service.
664             *
665             * @return the resource local service
666             */
667            public com.liferay.portal.kernel.service.ResourceLocalService getResourceLocalService() {
668                    return resourceLocalService;
669            }
670    
671            /**
672             * Sets the resource local service.
673             *
674             * @param resourceLocalService the resource local service
675             */
676            public void setResourceLocalService(
677                    com.liferay.portal.kernel.service.ResourceLocalService resourceLocalService) {
678                    this.resourceLocalService = resourceLocalService;
679            }
680    
681            /**
682             * Returns the role local service.
683             *
684             * @return the role local service
685             */
686            public com.liferay.portal.kernel.service.RoleLocalService getRoleLocalService() {
687                    return roleLocalService;
688            }
689    
690            /**
691             * Sets the role local service.
692             *
693             * @param roleLocalService the role local service
694             */
695            public void setRoleLocalService(
696                    com.liferay.portal.kernel.service.RoleLocalService roleLocalService) {
697                    this.roleLocalService = roleLocalService;
698            }
699    
700            /**
701             * Returns the role persistence.
702             *
703             * @return the role persistence
704             */
705            public RolePersistence getRolePersistence() {
706                    return rolePersistence;
707            }
708    
709            /**
710             * Sets the role persistence.
711             *
712             * @param rolePersistence the role persistence
713             */
714            public void setRolePersistence(RolePersistence rolePersistence) {
715                    this.rolePersistence = rolePersistence;
716            }
717    
718            /**
719             * Returns the role finder.
720             *
721             * @return the role finder
722             */
723            public RoleFinder getRoleFinder() {
724                    return roleFinder;
725            }
726    
727            /**
728             * Sets the role finder.
729             *
730             * @param roleFinder the role finder
731             */
732            public void setRoleFinder(RoleFinder roleFinder) {
733                    this.roleFinder = roleFinder;
734            }
735    
736            /**
737             * Returns the team local service.
738             *
739             * @return the team local service
740             */
741            public com.liferay.portal.kernel.service.TeamLocalService getTeamLocalService() {
742                    return teamLocalService;
743            }
744    
745            /**
746             * Sets the team local service.
747             *
748             * @param teamLocalService the team local service
749             */
750            public void setTeamLocalService(
751                    com.liferay.portal.kernel.service.TeamLocalService teamLocalService) {
752                    this.teamLocalService = teamLocalService;
753            }
754    
755            /**
756             * Returns the team persistence.
757             *
758             * @return the team persistence
759             */
760            public TeamPersistence getTeamPersistence() {
761                    return teamPersistence;
762            }
763    
764            /**
765             * Sets the team persistence.
766             *
767             * @param teamPersistence the team persistence
768             */
769            public void setTeamPersistence(TeamPersistence teamPersistence) {
770                    this.teamPersistence = teamPersistence;
771            }
772    
773            /**
774             * Returns the team finder.
775             *
776             * @return the team finder
777             */
778            public TeamFinder getTeamFinder() {
779                    return teamFinder;
780            }
781    
782            /**
783             * Sets the team finder.
784             *
785             * @param teamFinder the team finder
786             */
787            public void setTeamFinder(TeamFinder teamFinder) {
788                    this.teamFinder = teamFinder;
789            }
790    
791            /**
792             * Returns the user local service.
793             *
794             * @return the user local service
795             */
796            public com.liferay.portal.kernel.service.UserLocalService getUserLocalService() {
797                    return userLocalService;
798            }
799    
800            /**
801             * Sets the user local service.
802             *
803             * @param userLocalService the user local service
804             */
805            public void setUserLocalService(
806                    com.liferay.portal.kernel.service.UserLocalService userLocalService) {
807                    this.userLocalService = userLocalService;
808            }
809    
810            /**
811             * Returns the user persistence.
812             *
813             * @return the user persistence
814             */
815            public UserPersistence getUserPersistence() {
816                    return userPersistence;
817            }
818    
819            /**
820             * Sets the user persistence.
821             *
822             * @param userPersistence the user persistence
823             */
824            public void setUserPersistence(UserPersistence userPersistence) {
825                    this.userPersistence = userPersistence;
826            }
827    
828            /**
829             * Returns the user finder.
830             *
831             * @return the user finder
832             */
833            public UserFinder getUserFinder() {
834                    return userFinder;
835            }
836    
837            /**
838             * Sets the user finder.
839             *
840             * @param userFinder the user finder
841             */
842            public void setUserFinder(UserFinder userFinder) {
843                    this.userFinder = userFinder;
844            }
845    
846            /**
847             * Returns the user group local service.
848             *
849             * @return the user group local service
850             */
851            public com.liferay.portal.kernel.service.UserGroupLocalService getUserGroupLocalService() {
852                    return userGroupLocalService;
853            }
854    
855            /**
856             * Sets the user group local service.
857             *
858             * @param userGroupLocalService the user group local service
859             */
860            public void setUserGroupLocalService(
861                    com.liferay.portal.kernel.service.UserGroupLocalService userGroupLocalService) {
862                    this.userGroupLocalService = userGroupLocalService;
863            }
864    
865            /**
866             * Returns the user group persistence.
867             *
868             * @return the user group persistence
869             */
870            public UserGroupPersistence getUserGroupPersistence() {
871                    return userGroupPersistence;
872            }
873    
874            /**
875             * Sets the user group persistence.
876             *
877             * @param userGroupPersistence the user group persistence
878             */
879            public void setUserGroupPersistence(
880                    UserGroupPersistence userGroupPersistence) {
881                    this.userGroupPersistence = userGroupPersistence;
882            }
883    
884            /**
885             * Returns the user group finder.
886             *
887             * @return the user group finder
888             */
889            public UserGroupFinder getUserGroupFinder() {
890                    return userGroupFinder;
891            }
892    
893            /**
894             * Sets the user group finder.
895             *
896             * @param userGroupFinder the user group finder
897             */
898            public void setUserGroupFinder(UserGroupFinder userGroupFinder) {
899                    this.userGroupFinder = userGroupFinder;
900            }
901    
902            /**
903             * Returns the announcements delivery local service.
904             *
905             * @return the announcements delivery local service
906             */
907            public com.liferay.announcements.kernel.service.AnnouncementsDeliveryLocalService getAnnouncementsDeliveryLocalService() {
908                    return announcementsDeliveryLocalService;
909            }
910    
911            /**
912             * Sets the announcements delivery local service.
913             *
914             * @param announcementsDeliveryLocalService the announcements delivery local service
915             */
916            public void setAnnouncementsDeliveryLocalService(
917                    com.liferay.announcements.kernel.service.AnnouncementsDeliveryLocalService announcementsDeliveryLocalService) {
918                    this.announcementsDeliveryLocalService = announcementsDeliveryLocalService;
919            }
920    
921            /**
922             * Returns the announcements delivery persistence.
923             *
924             * @return the announcements delivery persistence
925             */
926            public AnnouncementsDeliveryPersistence getAnnouncementsDeliveryPersistence() {
927                    return announcementsDeliveryPersistence;
928            }
929    
930            /**
931             * Sets the announcements delivery persistence.
932             *
933             * @param announcementsDeliveryPersistence the announcements delivery persistence
934             */
935            public void setAnnouncementsDeliveryPersistence(
936                    AnnouncementsDeliveryPersistence announcementsDeliveryPersistence) {
937                    this.announcementsDeliveryPersistence = announcementsDeliveryPersistence;
938            }
939    
940            /**
941             * Returns the announcements flag local service.
942             *
943             * @return the announcements flag local service
944             */
945            public com.liferay.announcements.kernel.service.AnnouncementsFlagLocalService getAnnouncementsFlagLocalService() {
946                    return announcementsFlagLocalService;
947            }
948    
949            /**
950             * Sets the announcements flag local service.
951             *
952             * @param announcementsFlagLocalService the announcements flag local service
953             */
954            public void setAnnouncementsFlagLocalService(
955                    com.liferay.announcements.kernel.service.AnnouncementsFlagLocalService announcementsFlagLocalService) {
956                    this.announcementsFlagLocalService = announcementsFlagLocalService;
957            }
958    
959            /**
960             * Returns the announcements flag persistence.
961             *
962             * @return the announcements flag persistence
963             */
964            public AnnouncementsFlagPersistence getAnnouncementsFlagPersistence() {
965                    return announcementsFlagPersistence;
966            }
967    
968            /**
969             * Sets the announcements flag persistence.
970             *
971             * @param announcementsFlagPersistence the announcements flag persistence
972             */
973            public void setAnnouncementsFlagPersistence(
974                    AnnouncementsFlagPersistence announcementsFlagPersistence) {
975                    this.announcementsFlagPersistence = announcementsFlagPersistence;
976            }
977    
978            public void afterPropertiesSet() {
979                    persistedModelLocalServiceRegistry.register("com.liferay.announcements.kernel.model.AnnouncementsEntry",
980                            announcementsEntryLocalService);
981            }
982    
983            public void destroy() {
984                    persistedModelLocalServiceRegistry.unregister(
985                            "com.liferay.announcements.kernel.model.AnnouncementsEntry");
986            }
987    
988            /**
989             * Returns the OSGi service identifier.
990             *
991             * @return the OSGi service identifier
992             */
993            @Override
994            public String getOSGiServiceIdentifier() {
995                    return AnnouncementsEntryLocalService.class.getName();
996            }
997    
998            protected Class<?> getModelClass() {
999                    return AnnouncementsEntry.class;
1000            }
1001    
1002            protected String getModelClassName() {
1003                    return AnnouncementsEntry.class.getName();
1004            }
1005    
1006            /**
1007             * Performs a SQL query.
1008             *
1009             * @param sql the sql query
1010             */
1011            protected void runSQL(String sql) {
1012                    try {
1013                            DataSource dataSource = announcementsEntryPersistence.getDataSource();
1014    
1015                            DB db = DBManagerUtil.getDB();
1016    
1017                            sql = db.buildSQL(sql);
1018                            sql = PortalUtil.transformSQL(sql);
1019    
1020                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
1021                                            sql, new int[0]);
1022    
1023                            sqlUpdate.update();
1024                    }
1025                    catch (Exception e) {
1026                            throw new SystemException(e);
1027                    }
1028            }
1029    
1030            @BeanReference(type = com.liferay.announcements.kernel.service.AnnouncementsEntryLocalService.class)
1031            protected AnnouncementsEntryLocalService announcementsEntryLocalService;
1032            @BeanReference(type = AnnouncementsEntryPersistence.class)
1033            protected AnnouncementsEntryPersistence announcementsEntryPersistence;
1034            @BeanReference(type = AnnouncementsEntryFinder.class)
1035            protected AnnouncementsEntryFinder announcementsEntryFinder;
1036            @BeanReference(type = com.liferay.counter.kernel.service.CounterLocalService.class)
1037            protected com.liferay.counter.kernel.service.CounterLocalService counterLocalService;
1038            @BeanReference(type = com.liferay.portal.kernel.service.CompanyLocalService.class)
1039            protected com.liferay.portal.kernel.service.CompanyLocalService companyLocalService;
1040            @BeanReference(type = CompanyPersistence.class)
1041            protected CompanyPersistence companyPersistence;
1042            @BeanReference(type = com.liferay.portal.kernel.service.GroupLocalService.class)
1043            protected com.liferay.portal.kernel.service.GroupLocalService groupLocalService;
1044            @BeanReference(type = GroupPersistence.class)
1045            protected GroupPersistence groupPersistence;
1046            @BeanReference(type = GroupFinder.class)
1047            protected GroupFinder groupFinder;
1048            @BeanReference(type = com.liferay.portal.kernel.service.OrganizationLocalService.class)
1049            protected com.liferay.portal.kernel.service.OrganizationLocalService organizationLocalService;
1050            @BeanReference(type = OrganizationPersistence.class)
1051            protected OrganizationPersistence organizationPersistence;
1052            @BeanReference(type = OrganizationFinder.class)
1053            protected OrganizationFinder organizationFinder;
1054            @BeanReference(type = com.liferay.portal.kernel.service.ResourceLocalService.class)
1055            protected com.liferay.portal.kernel.service.ResourceLocalService resourceLocalService;
1056            @BeanReference(type = com.liferay.portal.kernel.service.RoleLocalService.class)
1057            protected com.liferay.portal.kernel.service.RoleLocalService roleLocalService;
1058            @BeanReference(type = RolePersistence.class)
1059            protected RolePersistence rolePersistence;
1060            @BeanReference(type = RoleFinder.class)
1061            protected RoleFinder roleFinder;
1062            @BeanReference(type = com.liferay.portal.kernel.service.TeamLocalService.class)
1063            protected com.liferay.portal.kernel.service.TeamLocalService teamLocalService;
1064            @BeanReference(type = TeamPersistence.class)
1065            protected TeamPersistence teamPersistence;
1066            @BeanReference(type = TeamFinder.class)
1067            protected TeamFinder teamFinder;
1068            @BeanReference(type = com.liferay.portal.kernel.service.UserLocalService.class)
1069            protected com.liferay.portal.kernel.service.UserLocalService userLocalService;
1070            @BeanReference(type = UserPersistence.class)
1071            protected UserPersistence userPersistence;
1072            @BeanReference(type = UserFinder.class)
1073            protected UserFinder userFinder;
1074            @BeanReference(type = com.liferay.portal.kernel.service.UserGroupLocalService.class)
1075            protected com.liferay.portal.kernel.service.UserGroupLocalService userGroupLocalService;
1076            @BeanReference(type = UserGroupPersistence.class)
1077            protected UserGroupPersistence userGroupPersistence;
1078            @BeanReference(type = UserGroupFinder.class)
1079            protected UserGroupFinder userGroupFinder;
1080            @BeanReference(type = com.liferay.announcements.kernel.service.AnnouncementsDeliveryLocalService.class)
1081            protected com.liferay.announcements.kernel.service.AnnouncementsDeliveryLocalService announcementsDeliveryLocalService;
1082            @BeanReference(type = AnnouncementsDeliveryPersistence.class)
1083            protected AnnouncementsDeliveryPersistence announcementsDeliveryPersistence;
1084            @BeanReference(type = com.liferay.announcements.kernel.service.AnnouncementsFlagLocalService.class)
1085            protected com.liferay.announcements.kernel.service.AnnouncementsFlagLocalService announcementsFlagLocalService;
1086            @BeanReference(type = AnnouncementsFlagPersistence.class)
1087            protected AnnouncementsFlagPersistence announcementsFlagPersistence;
1088            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
1089            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
1090    }