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.portal.kernel.bean.BeanReference;
020    import com.liferay.portal.kernel.bean.IdentifiableBean;
021    import com.liferay.portal.kernel.dao.db.DB;
022    import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
023    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
024    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
025    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
026    import com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery;
027    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
028    import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
029    import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery;
030    import com.liferay.portal.kernel.dao.orm.Projection;
031    import com.liferay.portal.kernel.dao.orm.Property;
032    import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil;
033    import com.liferay.portal.kernel.exception.PortalException;
034    import com.liferay.portal.kernel.exception.SystemException;
035    import com.liferay.portal.kernel.search.Indexable;
036    import com.liferay.portal.kernel.search.IndexableType;
037    import com.liferay.portal.kernel.util.OrderByComparator;
038    import com.liferay.portal.model.PersistedModel;
039    import com.liferay.portal.service.BaseLocalServiceImpl;
040    import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
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.OrganizationFinder;
045    import com.liferay.portal.service.persistence.OrganizationPersistence;
046    import com.liferay.portal.service.persistence.RoleFinder;
047    import com.liferay.portal.service.persistence.RolePersistence;
048    import com.liferay.portal.service.persistence.TeamFinder;
049    import com.liferay.portal.service.persistence.TeamPersistence;
050    import com.liferay.portal.service.persistence.UserFinder;
051    import com.liferay.portal.service.persistence.UserGroupFinder;
052    import com.liferay.portal.service.persistence.UserGroupPersistence;
053    import com.liferay.portal.service.persistence.UserPersistence;
054    import com.liferay.portal.util.PortalUtil;
055    
056    import com.liferay.portlet.announcements.model.AnnouncementsEntry;
057    import com.liferay.portlet.announcements.service.AnnouncementsEntryLocalService;
058    import com.liferay.portlet.announcements.service.persistence.AnnouncementsDeliveryPersistence;
059    import com.liferay.portlet.announcements.service.persistence.AnnouncementsEntryFinder;
060    import com.liferay.portlet.announcements.service.persistence.AnnouncementsEntryPersistence;
061    import com.liferay.portlet.announcements.service.persistence.AnnouncementsFlagPersistence;
062    import com.liferay.portlet.exportimport.lar.ExportImportHelperUtil;
063    import com.liferay.portlet.exportimport.lar.ManifestSummary;
064    import com.liferay.portlet.exportimport.lar.PortletDataContext;
065    import com.liferay.portlet.exportimport.lar.StagedModelDataHandlerUtil;
066    import com.liferay.portlet.exportimport.lar.StagedModelType;
067    
068    import java.io.Serializable;
069    
070    import java.util.List;
071    
072    import javax.sql.DataSource;
073    
074    /**
075     * Provides the base implementation for the announcements entry local service.
076     *
077     * <p>
078     * 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}.
079     * </p>
080     *
081     * @author Brian Wing Shun Chan
082     * @see com.liferay.portlet.announcements.service.impl.AnnouncementsEntryLocalServiceImpl
083     * @see com.liferay.portlet.announcements.service.AnnouncementsEntryLocalServiceUtil
084     * @generated
085     */
086    @ProviderType
087    public abstract class AnnouncementsEntryLocalServiceBaseImpl
088            extends BaseLocalServiceImpl implements AnnouncementsEntryLocalService,
089                    IdentifiableBean {
090            /*
091             * NOTE FOR DEVELOPERS:
092             *
093             * Never modify or reference this class directly. Always use {@link com.liferay.portlet.announcements.service.AnnouncementsEntryLocalServiceUtil} to access the announcements entry local service.
094             */
095    
096            /**
097             * Adds the announcements entry to the database. Also notifies the appropriate model listeners.
098             *
099             * @param announcementsEntry the announcements entry
100             * @return the announcements entry that was added
101             */
102            @Indexable(type = IndexableType.REINDEX)
103            @Override
104            public AnnouncementsEntry addAnnouncementsEntry(
105                    AnnouncementsEntry announcementsEntry) {
106                    announcementsEntry.setNew(true);
107    
108                    return announcementsEntryPersistence.update(announcementsEntry);
109            }
110    
111            /**
112             * Creates a new announcements entry with the primary key. Does not add the announcements entry to the database.
113             *
114             * @param entryId the primary key for the new announcements entry
115             * @return the new announcements entry
116             */
117            @Override
118            public AnnouncementsEntry createAnnouncementsEntry(long entryId) {
119                    return announcementsEntryPersistence.create(entryId);
120            }
121    
122            /**
123             * Deletes the announcements entry with the primary key from the database. Also notifies the appropriate model listeners.
124             *
125             * @param entryId the primary key of the announcements entry
126             * @return the announcements entry that was removed
127             * @throws PortalException if a announcements entry with the primary key could not be found
128             */
129            @Indexable(type = IndexableType.DELETE)
130            @Override
131            public AnnouncementsEntry deleteAnnouncementsEntry(long entryId)
132                    throws PortalException {
133                    return announcementsEntryPersistence.remove(entryId);
134            }
135    
136            /**
137             * Deletes the announcements entry from the database. Also notifies the appropriate model listeners.
138             *
139             * @param announcementsEntry the announcements entry
140             * @return the announcements entry that was removed
141             */
142            @Indexable(type = IndexableType.DELETE)
143            @Override
144            public AnnouncementsEntry deleteAnnouncementsEntry(
145                    AnnouncementsEntry announcementsEntry) {
146                    return announcementsEntryPersistence.remove(announcementsEntry);
147            }
148    
149            @Override
150            public DynamicQuery dynamicQuery() {
151                    Class<?> clazz = getClass();
152    
153                    return DynamicQueryFactoryUtil.forClass(AnnouncementsEntry.class,
154                            clazz.getClassLoader());
155            }
156    
157            /**
158             * Performs a dynamic query on the database and returns the matching rows.
159             *
160             * @param dynamicQuery the dynamic query
161             * @return the matching rows
162             */
163            @Override
164            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
165                    return announcementsEntryPersistence.findWithDynamicQuery(dynamicQuery);
166            }
167    
168            /**
169             * Performs a dynamic query on the database and returns a range of the matching rows.
170             *
171             * <p>
172             * 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.
173             * </p>
174             *
175             * @param dynamicQuery the dynamic query
176             * @param start the lower bound of the range of model instances
177             * @param end the upper bound of the range of model instances (not inclusive)
178             * @return the range of matching rows
179             */
180            @Override
181            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
182                    int end) {
183                    return announcementsEntryPersistence.findWithDynamicQuery(dynamicQuery,
184                            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.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.
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 announcementsEntryPersistence.findWithDynamicQuery(dynamicQuery,
204                            start, 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 announcementsEntryPersistence.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 announcementsEntryPersistence.countWithDynamicQuery(dynamicQuery,
229                            projection);
230            }
231    
232            @Override
233            public AnnouncementsEntry fetchAnnouncementsEntry(long entryId) {
234                    return announcementsEntryPersistence.fetchByPrimaryKey(entryId);
235            }
236    
237            /**
238             * Returns the announcements entry with the matching UUID and company.
239             *
240             * @param uuid the announcements entry's UUID
241             * @param companyId the primary key of the company
242             * @return the matching announcements entry, or <code>null</code> if a matching announcements entry could not be found
243             */
244            @Override
245            public AnnouncementsEntry fetchAnnouncementsEntryByUuidAndCompanyId(
246                    String uuid, long companyId) {
247                    return announcementsEntryPersistence.fetchByUuid_C_First(uuid,
248                            companyId, null);
249            }
250    
251            /**
252             * Returns the announcements entry with the primary key.
253             *
254             * @param entryId the primary key of the announcements entry
255             * @return the announcements entry
256             * @throws PortalException if a announcements entry with the primary key could not be found
257             */
258            @Override
259            public AnnouncementsEntry getAnnouncementsEntry(long entryId)
260                    throws PortalException {
261                    return announcementsEntryPersistence.findByPrimaryKey(entryId);
262            }
263    
264            @Override
265            public ActionableDynamicQuery getActionableDynamicQuery() {
266                    ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
267    
268                    actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.announcements.service.AnnouncementsEntryLocalServiceUtil.getService());
269                    actionableDynamicQuery.setClass(AnnouncementsEntry.class);
270                    actionableDynamicQuery.setClassLoader(getClassLoader());
271    
272                    actionableDynamicQuery.setPrimaryKeyPropertyName("entryId");
273    
274                    return actionableDynamicQuery;
275            }
276    
277            protected void initActionableDynamicQuery(
278                    ActionableDynamicQuery actionableDynamicQuery) {
279                    actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.announcements.service.AnnouncementsEntryLocalServiceUtil.getService());
280                    actionableDynamicQuery.setClass(AnnouncementsEntry.class);
281                    actionableDynamicQuery.setClassLoader(getClassLoader());
282    
283                    actionableDynamicQuery.setPrimaryKeyPropertyName("entryId");
284            }
285    
286            @Override
287            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
288                    final PortletDataContext portletDataContext) {
289                    final ExportActionableDynamicQuery exportActionableDynamicQuery = new ExportActionableDynamicQuery() {
290                                    @Override
291                                    public long performCount() throws PortalException {
292                                            ManifestSummary manifestSummary = portletDataContext.getManifestSummary();
293    
294                                            StagedModelType stagedModelType = getStagedModelType();
295    
296                                            long modelAdditionCount = super.performCount();
297    
298                                            manifestSummary.addModelAdditionCount(stagedModelType.toString(),
299                                                    modelAdditionCount);
300    
301                                            long modelDeletionCount = ExportImportHelperUtil.getModelDeletionCount(portletDataContext,
302                                                            stagedModelType);
303    
304                                            manifestSummary.addModelDeletionCount(stagedModelType.toString(),
305                                                    modelDeletionCount);
306    
307                                            return modelAdditionCount;
308                                    }
309                            };
310    
311                    initActionableDynamicQuery(exportActionableDynamicQuery);
312    
313                    exportActionableDynamicQuery.setAddCriteriaMethod(new ActionableDynamicQuery.AddCriteriaMethod() {
314                                    @Override
315                                    public void addCriteria(DynamicQuery dynamicQuery) {
316                                            portletDataContext.addDateRangeCriteria(dynamicQuery,
317                                                    "modifiedDate");
318    
319                                            StagedModelType stagedModelType = exportActionableDynamicQuery.getStagedModelType();
320    
321                                            if (stagedModelType.getReferrerClassNameId() >= 0) {
322                                                    Property classNameIdProperty = PropertyFactoryUtil.forName(
323                                                                    "classNameId");
324    
325                                                    dynamicQuery.add(classNameIdProperty.eq(
326                                                                    stagedModelType.getReferrerClassNameId()));
327                                            }
328                                    }
329                            });
330    
331                    exportActionableDynamicQuery.setCompanyId(portletDataContext.getCompanyId());
332    
333                    exportActionableDynamicQuery.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod() {
334                                    @Override
335                                    public void performAction(Object object)
336                                            throws PortalException {
337                                            AnnouncementsEntry stagedModel = (AnnouncementsEntry)object;
338    
339                                            StagedModelDataHandlerUtil.exportStagedModel(portletDataContext,
340                                                    stagedModel);
341                                    }
342                            });
343                    exportActionableDynamicQuery.setStagedModelType(new StagedModelType(
344                                    PortalUtil.getClassNameId(AnnouncementsEntry.class.getName())));
345    
346                    return exportActionableDynamicQuery;
347            }
348    
349            /**
350             * @throws PortalException
351             */
352            @Override
353            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
354                    throws PortalException {
355                    return announcementsEntryLocalService.deleteAnnouncementsEntry((AnnouncementsEntry)persistedModel);
356            }
357    
358            @Override
359            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
360                    throws PortalException {
361                    return announcementsEntryPersistence.findByPrimaryKey(primaryKeyObj);
362            }
363    
364            /**
365             * Returns the announcements entry with the matching UUID and company.
366             *
367             * @param uuid the announcements entry's UUID
368             * @param companyId the primary key of the company
369             * @return the matching announcements entry
370             * @throws PortalException if a matching announcements entry could not be found
371             */
372            @Override
373            public AnnouncementsEntry getAnnouncementsEntryByUuidAndCompanyId(
374                    String uuid, long companyId) throws PortalException {
375                    return announcementsEntryPersistence.findByUuid_C_First(uuid,
376                            companyId, null);
377            }
378    
379            /**
380             * Returns a range of all the announcements entries.
381             *
382             * <p>
383             * 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.
384             * </p>
385             *
386             * @param start the lower bound of the range of announcements entries
387             * @param end the upper bound of the range of announcements entries (not inclusive)
388             * @return the range of announcements entries
389             */
390            @Override
391            public List<AnnouncementsEntry> getAnnouncementsEntries(int start, int end) {
392                    return announcementsEntryPersistence.findAll(start, end);
393            }
394    
395            /**
396             * Returns the number of announcements entries.
397             *
398             * @return the number of announcements entries
399             */
400            @Override
401            public int getAnnouncementsEntriesCount() {
402                    return announcementsEntryPersistence.countAll();
403            }
404    
405            /**
406             * Updates the announcements entry in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
407             *
408             * @param announcementsEntry the announcements entry
409             * @return the announcements entry that was updated
410             */
411            @Indexable(type = IndexableType.REINDEX)
412            @Override
413            public AnnouncementsEntry updateAnnouncementsEntry(
414                    AnnouncementsEntry announcementsEntry) {
415                    return announcementsEntryPersistence.update(announcementsEntry);
416            }
417    
418            /**
419             * Returns the announcements entry local service.
420             *
421             * @return the announcements entry local service
422             */
423            public AnnouncementsEntryLocalService getAnnouncementsEntryLocalService() {
424                    return announcementsEntryLocalService;
425            }
426    
427            /**
428             * Sets the announcements entry local service.
429             *
430             * @param announcementsEntryLocalService the announcements entry local service
431             */
432            public void setAnnouncementsEntryLocalService(
433                    AnnouncementsEntryLocalService announcementsEntryLocalService) {
434                    this.announcementsEntryLocalService = announcementsEntryLocalService;
435            }
436    
437            /**
438             * Returns the announcements entry remote service.
439             *
440             * @return the announcements entry remote service
441             */
442            public com.liferay.portlet.announcements.service.AnnouncementsEntryService getAnnouncementsEntryService() {
443                    return announcementsEntryService;
444            }
445    
446            /**
447             * Sets the announcements entry remote service.
448             *
449             * @param announcementsEntryService the announcements entry remote service
450             */
451            public void setAnnouncementsEntryService(
452                    com.liferay.portlet.announcements.service.AnnouncementsEntryService announcementsEntryService) {
453                    this.announcementsEntryService = announcementsEntryService;
454            }
455    
456            /**
457             * Returns the announcements entry persistence.
458             *
459             * @return the announcements entry persistence
460             */
461            public AnnouncementsEntryPersistence getAnnouncementsEntryPersistence() {
462                    return announcementsEntryPersistence;
463            }
464    
465            /**
466             * Sets the announcements entry persistence.
467             *
468             * @param announcementsEntryPersistence the announcements entry persistence
469             */
470            public void setAnnouncementsEntryPersistence(
471                    AnnouncementsEntryPersistence announcementsEntryPersistence) {
472                    this.announcementsEntryPersistence = announcementsEntryPersistence;
473            }
474    
475            /**
476             * Returns the announcements entry finder.
477             *
478             * @return the announcements entry finder
479             */
480            public AnnouncementsEntryFinder getAnnouncementsEntryFinder() {
481                    return announcementsEntryFinder;
482            }
483    
484            /**
485             * Sets the announcements entry finder.
486             *
487             * @param announcementsEntryFinder the announcements entry finder
488             */
489            public void setAnnouncementsEntryFinder(
490                    AnnouncementsEntryFinder announcementsEntryFinder) {
491                    this.announcementsEntryFinder = announcementsEntryFinder;
492            }
493    
494            /**
495             * Returns the counter local service.
496             *
497             * @return the counter local service
498             */
499            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
500                    return counterLocalService;
501            }
502    
503            /**
504             * Sets the counter local service.
505             *
506             * @param counterLocalService the counter local service
507             */
508            public void setCounterLocalService(
509                    com.liferay.counter.service.CounterLocalService counterLocalService) {
510                    this.counterLocalService = counterLocalService;
511            }
512    
513            /**
514             * Returns the mail remote service.
515             *
516             * @return the mail remote service
517             */
518            public com.liferay.mail.service.MailService getMailService() {
519                    return mailService;
520            }
521    
522            /**
523             * Sets the mail remote service.
524             *
525             * @param mailService the mail remote service
526             */
527            public void setMailService(com.liferay.mail.service.MailService mailService) {
528                    this.mailService = mailService;
529            }
530    
531            /**
532             * Returns the company local service.
533             *
534             * @return the company local service
535             */
536            public com.liferay.portal.service.CompanyLocalService getCompanyLocalService() {
537                    return companyLocalService;
538            }
539    
540            /**
541             * Sets the company local service.
542             *
543             * @param companyLocalService the company local service
544             */
545            public void setCompanyLocalService(
546                    com.liferay.portal.service.CompanyLocalService companyLocalService) {
547                    this.companyLocalService = companyLocalService;
548            }
549    
550            /**
551             * Returns the company remote service.
552             *
553             * @return the company remote service
554             */
555            public com.liferay.portal.service.CompanyService getCompanyService() {
556                    return companyService;
557            }
558    
559            /**
560             * Sets the company remote service.
561             *
562             * @param companyService the company remote service
563             */
564            public void setCompanyService(
565                    com.liferay.portal.service.CompanyService companyService) {
566                    this.companyService = companyService;
567            }
568    
569            /**
570             * Returns the company persistence.
571             *
572             * @return the company persistence
573             */
574            public CompanyPersistence getCompanyPersistence() {
575                    return companyPersistence;
576            }
577    
578            /**
579             * Sets the company persistence.
580             *
581             * @param companyPersistence the company persistence
582             */
583            public void setCompanyPersistence(CompanyPersistence companyPersistence) {
584                    this.companyPersistence = companyPersistence;
585            }
586    
587            /**
588             * Returns the group local service.
589             *
590             * @return the group local service
591             */
592            public com.liferay.portal.service.GroupLocalService getGroupLocalService() {
593                    return groupLocalService;
594            }
595    
596            /**
597             * Sets the group local service.
598             *
599             * @param groupLocalService the group local service
600             */
601            public void setGroupLocalService(
602                    com.liferay.portal.service.GroupLocalService groupLocalService) {
603                    this.groupLocalService = groupLocalService;
604            }
605    
606            /**
607             * Returns the group remote service.
608             *
609             * @return the group remote service
610             */
611            public com.liferay.portal.service.GroupService getGroupService() {
612                    return groupService;
613            }
614    
615            /**
616             * Sets the group remote service.
617             *
618             * @param groupService the group remote service
619             */
620            public void setGroupService(
621                    com.liferay.portal.service.GroupService groupService) {
622                    this.groupService = groupService;
623            }
624    
625            /**
626             * Returns the group persistence.
627             *
628             * @return the group persistence
629             */
630            public GroupPersistence getGroupPersistence() {
631                    return groupPersistence;
632            }
633    
634            /**
635             * Sets the group persistence.
636             *
637             * @param groupPersistence the group persistence
638             */
639            public void setGroupPersistence(GroupPersistence groupPersistence) {
640                    this.groupPersistence = groupPersistence;
641            }
642    
643            /**
644             * Returns the group finder.
645             *
646             * @return the group finder
647             */
648            public GroupFinder getGroupFinder() {
649                    return groupFinder;
650            }
651    
652            /**
653             * Sets the group finder.
654             *
655             * @param groupFinder the group finder
656             */
657            public void setGroupFinder(GroupFinder groupFinder) {
658                    this.groupFinder = groupFinder;
659            }
660    
661            /**
662             * Returns the organization local service.
663             *
664             * @return the organization local service
665             */
666            public com.liferay.portal.service.OrganizationLocalService getOrganizationLocalService() {
667                    return organizationLocalService;
668            }
669    
670            /**
671             * Sets the organization local service.
672             *
673             * @param organizationLocalService the organization local service
674             */
675            public void setOrganizationLocalService(
676                    com.liferay.portal.service.OrganizationLocalService organizationLocalService) {
677                    this.organizationLocalService = organizationLocalService;
678            }
679    
680            /**
681             * Returns the organization remote service.
682             *
683             * @return the organization remote service
684             */
685            public com.liferay.portal.service.OrganizationService getOrganizationService() {
686                    return organizationService;
687            }
688    
689            /**
690             * Sets the organization remote service.
691             *
692             * @param organizationService the organization remote service
693             */
694            public void setOrganizationService(
695                    com.liferay.portal.service.OrganizationService organizationService) {
696                    this.organizationService = organizationService;
697            }
698    
699            /**
700             * Returns the organization persistence.
701             *
702             * @return the organization persistence
703             */
704            public OrganizationPersistence getOrganizationPersistence() {
705                    return organizationPersistence;
706            }
707    
708            /**
709             * Sets the organization persistence.
710             *
711             * @param organizationPersistence the organization persistence
712             */
713            public void setOrganizationPersistence(
714                    OrganizationPersistence organizationPersistence) {
715                    this.organizationPersistence = organizationPersistence;
716            }
717    
718            /**
719             * Returns the organization finder.
720             *
721             * @return the organization finder
722             */
723            public OrganizationFinder getOrganizationFinder() {
724                    return organizationFinder;
725            }
726    
727            /**
728             * Sets the organization finder.
729             *
730             * @param organizationFinder the organization finder
731             */
732            public void setOrganizationFinder(OrganizationFinder organizationFinder) {
733                    this.organizationFinder = organizationFinder;
734            }
735    
736            /**
737             * Returns the resource local service.
738             *
739             * @return the resource local service
740             */
741            public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
742                    return resourceLocalService;
743            }
744    
745            /**
746             * Sets the resource local service.
747             *
748             * @param resourceLocalService the resource local service
749             */
750            public void setResourceLocalService(
751                    com.liferay.portal.service.ResourceLocalService resourceLocalService) {
752                    this.resourceLocalService = resourceLocalService;
753            }
754    
755            /**
756             * Returns the role local service.
757             *
758             * @return the role local service
759             */
760            public com.liferay.portal.service.RoleLocalService getRoleLocalService() {
761                    return roleLocalService;
762            }
763    
764            /**
765             * Sets the role local service.
766             *
767             * @param roleLocalService the role local service
768             */
769            public void setRoleLocalService(
770                    com.liferay.portal.service.RoleLocalService roleLocalService) {
771                    this.roleLocalService = roleLocalService;
772            }
773    
774            /**
775             * Returns the role remote service.
776             *
777             * @return the role remote service
778             */
779            public com.liferay.portal.service.RoleService getRoleService() {
780                    return roleService;
781            }
782    
783            /**
784             * Sets the role remote service.
785             *
786             * @param roleService the role remote service
787             */
788            public void setRoleService(
789                    com.liferay.portal.service.RoleService roleService) {
790                    this.roleService = roleService;
791            }
792    
793            /**
794             * Returns the role persistence.
795             *
796             * @return the role persistence
797             */
798            public RolePersistence getRolePersistence() {
799                    return rolePersistence;
800            }
801    
802            /**
803             * Sets the role persistence.
804             *
805             * @param rolePersistence the role persistence
806             */
807            public void setRolePersistence(RolePersistence rolePersistence) {
808                    this.rolePersistence = rolePersistence;
809            }
810    
811            /**
812             * Returns the role finder.
813             *
814             * @return the role finder
815             */
816            public RoleFinder getRoleFinder() {
817                    return roleFinder;
818            }
819    
820            /**
821             * Sets the role finder.
822             *
823             * @param roleFinder the role finder
824             */
825            public void setRoleFinder(RoleFinder roleFinder) {
826                    this.roleFinder = roleFinder;
827            }
828    
829            /**
830             * Returns the team local service.
831             *
832             * @return the team local service
833             */
834            public com.liferay.portal.service.TeamLocalService getTeamLocalService() {
835                    return teamLocalService;
836            }
837    
838            /**
839             * Sets the team local service.
840             *
841             * @param teamLocalService the team local service
842             */
843            public void setTeamLocalService(
844                    com.liferay.portal.service.TeamLocalService teamLocalService) {
845                    this.teamLocalService = teamLocalService;
846            }
847    
848            /**
849             * Returns the team remote service.
850             *
851             * @return the team remote service
852             */
853            public com.liferay.portal.service.TeamService getTeamService() {
854                    return teamService;
855            }
856    
857            /**
858             * Sets the team remote service.
859             *
860             * @param teamService the team remote service
861             */
862            public void setTeamService(
863                    com.liferay.portal.service.TeamService teamService) {
864                    this.teamService = teamService;
865            }
866    
867            /**
868             * Returns the team persistence.
869             *
870             * @return the team persistence
871             */
872            public TeamPersistence getTeamPersistence() {
873                    return teamPersistence;
874            }
875    
876            /**
877             * Sets the team persistence.
878             *
879             * @param teamPersistence the team persistence
880             */
881            public void setTeamPersistence(TeamPersistence teamPersistence) {
882                    this.teamPersistence = teamPersistence;
883            }
884    
885            /**
886             * Returns the team finder.
887             *
888             * @return the team finder
889             */
890            public TeamFinder getTeamFinder() {
891                    return teamFinder;
892            }
893    
894            /**
895             * Sets the team finder.
896             *
897             * @param teamFinder the team finder
898             */
899            public void setTeamFinder(TeamFinder teamFinder) {
900                    this.teamFinder = teamFinder;
901            }
902    
903            /**
904             * Returns the user local service.
905             *
906             * @return the user local service
907             */
908            public com.liferay.portal.service.UserLocalService getUserLocalService() {
909                    return userLocalService;
910            }
911    
912            /**
913             * Sets the user local service.
914             *
915             * @param userLocalService the user local service
916             */
917            public void setUserLocalService(
918                    com.liferay.portal.service.UserLocalService userLocalService) {
919                    this.userLocalService = userLocalService;
920            }
921    
922            /**
923             * Returns the user remote service.
924             *
925             * @return the user remote service
926             */
927            public com.liferay.portal.service.UserService getUserService() {
928                    return userService;
929            }
930    
931            /**
932             * Sets the user remote service.
933             *
934             * @param userService the user remote service
935             */
936            public void setUserService(
937                    com.liferay.portal.service.UserService userService) {
938                    this.userService = userService;
939            }
940    
941            /**
942             * Returns the user persistence.
943             *
944             * @return the user persistence
945             */
946            public UserPersistence getUserPersistence() {
947                    return userPersistence;
948            }
949    
950            /**
951             * Sets the user persistence.
952             *
953             * @param userPersistence the user persistence
954             */
955            public void setUserPersistence(UserPersistence userPersistence) {
956                    this.userPersistence = userPersistence;
957            }
958    
959            /**
960             * Returns the user finder.
961             *
962             * @return the user finder
963             */
964            public UserFinder getUserFinder() {
965                    return userFinder;
966            }
967    
968            /**
969             * Sets the user finder.
970             *
971             * @param userFinder the user finder
972             */
973            public void setUserFinder(UserFinder userFinder) {
974                    this.userFinder = userFinder;
975            }
976    
977            /**
978             * Returns the user group local service.
979             *
980             * @return the user group local service
981             */
982            public com.liferay.portal.service.UserGroupLocalService getUserGroupLocalService() {
983                    return userGroupLocalService;
984            }
985    
986            /**
987             * Sets the user group local service.
988             *
989             * @param userGroupLocalService the user group local service
990             */
991            public void setUserGroupLocalService(
992                    com.liferay.portal.service.UserGroupLocalService userGroupLocalService) {
993                    this.userGroupLocalService = userGroupLocalService;
994            }
995    
996            /**
997             * Returns the user group remote service.
998             *
999             * @return the user group remote service
1000             */
1001            public com.liferay.portal.service.UserGroupService getUserGroupService() {
1002                    return userGroupService;
1003            }
1004    
1005            /**
1006             * Sets the user group remote service.
1007             *
1008             * @param userGroupService the user group remote service
1009             */
1010            public void setUserGroupService(
1011                    com.liferay.portal.service.UserGroupService userGroupService) {
1012                    this.userGroupService = userGroupService;
1013            }
1014    
1015            /**
1016             * Returns the user group persistence.
1017             *
1018             * @return the user group persistence
1019             */
1020            public UserGroupPersistence getUserGroupPersistence() {
1021                    return userGroupPersistence;
1022            }
1023    
1024            /**
1025             * Sets the user group persistence.
1026             *
1027             * @param userGroupPersistence the user group persistence
1028             */
1029            public void setUserGroupPersistence(
1030                    UserGroupPersistence userGroupPersistence) {
1031                    this.userGroupPersistence = userGroupPersistence;
1032            }
1033    
1034            /**
1035             * Returns the user group finder.
1036             *
1037             * @return the user group finder
1038             */
1039            public UserGroupFinder getUserGroupFinder() {
1040                    return userGroupFinder;
1041            }
1042    
1043            /**
1044             * Sets the user group finder.
1045             *
1046             * @param userGroupFinder the user group finder
1047             */
1048            public void setUserGroupFinder(UserGroupFinder userGroupFinder) {
1049                    this.userGroupFinder = userGroupFinder;
1050            }
1051    
1052            /**
1053             * Returns the announcements delivery local service.
1054             *
1055             * @return the announcements delivery local service
1056             */
1057            public com.liferay.portlet.announcements.service.AnnouncementsDeliveryLocalService getAnnouncementsDeliveryLocalService() {
1058                    return announcementsDeliveryLocalService;
1059            }
1060    
1061            /**
1062             * Sets the announcements delivery local service.
1063             *
1064             * @param announcementsDeliveryLocalService the announcements delivery local service
1065             */
1066            public void setAnnouncementsDeliveryLocalService(
1067                    com.liferay.portlet.announcements.service.AnnouncementsDeliveryLocalService announcementsDeliveryLocalService) {
1068                    this.announcementsDeliveryLocalService = announcementsDeliveryLocalService;
1069            }
1070    
1071            /**
1072             * Returns the announcements delivery remote service.
1073             *
1074             * @return the announcements delivery remote service
1075             */
1076            public com.liferay.portlet.announcements.service.AnnouncementsDeliveryService getAnnouncementsDeliveryService() {
1077                    return announcementsDeliveryService;
1078            }
1079    
1080            /**
1081             * Sets the announcements delivery remote service.
1082             *
1083             * @param announcementsDeliveryService the announcements delivery remote service
1084             */
1085            public void setAnnouncementsDeliveryService(
1086                    com.liferay.portlet.announcements.service.AnnouncementsDeliveryService announcementsDeliveryService) {
1087                    this.announcementsDeliveryService = announcementsDeliveryService;
1088            }
1089    
1090            /**
1091             * Returns the announcements delivery persistence.
1092             *
1093             * @return the announcements delivery persistence
1094             */
1095            public AnnouncementsDeliveryPersistence getAnnouncementsDeliveryPersistence() {
1096                    return announcementsDeliveryPersistence;
1097            }
1098    
1099            /**
1100             * Sets the announcements delivery persistence.
1101             *
1102             * @param announcementsDeliveryPersistence the announcements delivery persistence
1103             */
1104            public void setAnnouncementsDeliveryPersistence(
1105                    AnnouncementsDeliveryPersistence announcementsDeliveryPersistence) {
1106                    this.announcementsDeliveryPersistence = announcementsDeliveryPersistence;
1107            }
1108    
1109            /**
1110             * Returns the announcements flag local service.
1111             *
1112             * @return the announcements flag local service
1113             */
1114            public com.liferay.portlet.announcements.service.AnnouncementsFlagLocalService getAnnouncementsFlagLocalService() {
1115                    return announcementsFlagLocalService;
1116            }
1117    
1118            /**
1119             * Sets the announcements flag local service.
1120             *
1121             * @param announcementsFlagLocalService the announcements flag local service
1122             */
1123            public void setAnnouncementsFlagLocalService(
1124                    com.liferay.portlet.announcements.service.AnnouncementsFlagLocalService announcementsFlagLocalService) {
1125                    this.announcementsFlagLocalService = announcementsFlagLocalService;
1126            }
1127    
1128            /**
1129             * Returns the announcements flag remote service.
1130             *
1131             * @return the announcements flag remote service
1132             */
1133            public com.liferay.portlet.announcements.service.AnnouncementsFlagService getAnnouncementsFlagService() {
1134                    return announcementsFlagService;
1135            }
1136    
1137            /**
1138             * Sets the announcements flag remote service.
1139             *
1140             * @param announcementsFlagService the announcements flag remote service
1141             */
1142            public void setAnnouncementsFlagService(
1143                    com.liferay.portlet.announcements.service.AnnouncementsFlagService announcementsFlagService) {
1144                    this.announcementsFlagService = announcementsFlagService;
1145            }
1146    
1147            /**
1148             * Returns the announcements flag persistence.
1149             *
1150             * @return the announcements flag persistence
1151             */
1152            public AnnouncementsFlagPersistence getAnnouncementsFlagPersistence() {
1153                    return announcementsFlagPersistence;
1154            }
1155    
1156            /**
1157             * Sets the announcements flag persistence.
1158             *
1159             * @param announcementsFlagPersistence the announcements flag persistence
1160             */
1161            public void setAnnouncementsFlagPersistence(
1162                    AnnouncementsFlagPersistence announcementsFlagPersistence) {
1163                    this.announcementsFlagPersistence = announcementsFlagPersistence;
1164            }
1165    
1166            public void afterPropertiesSet() {
1167                    persistedModelLocalServiceRegistry.register("com.liferay.portlet.announcements.model.AnnouncementsEntry",
1168                            announcementsEntryLocalService);
1169            }
1170    
1171            public void destroy() {
1172                    persistedModelLocalServiceRegistry.unregister(
1173                            "com.liferay.portlet.announcements.model.AnnouncementsEntry");
1174            }
1175    
1176            /**
1177             * Returns the Spring bean ID for this bean.
1178             *
1179             * @return the Spring bean ID for this bean
1180             */
1181            @Override
1182            public String getBeanIdentifier() {
1183                    return _beanIdentifier;
1184            }
1185    
1186            /**
1187             * Sets the Spring bean ID for this bean.
1188             *
1189             * @param beanIdentifier the Spring bean ID for this bean
1190             */
1191            @Override
1192            public void setBeanIdentifier(String beanIdentifier) {
1193                    _beanIdentifier = beanIdentifier;
1194            }
1195    
1196            protected Class<?> getModelClass() {
1197                    return AnnouncementsEntry.class;
1198            }
1199    
1200            protected String getModelClassName() {
1201                    return AnnouncementsEntry.class.getName();
1202            }
1203    
1204            /**
1205             * Performs a SQL query.
1206             *
1207             * @param sql the sql query
1208             */
1209            protected void runSQL(String sql) {
1210                    try {
1211                            DataSource dataSource = announcementsEntryPersistence.getDataSource();
1212    
1213                            DB db = DBFactoryUtil.getDB();
1214    
1215                            sql = db.buildSQL(sql);
1216                            sql = PortalUtil.transformSQL(sql);
1217    
1218                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
1219                                            sql, new int[0]);
1220    
1221                            sqlUpdate.update();
1222                    }
1223                    catch (Exception e) {
1224                            throw new SystemException(e);
1225                    }
1226            }
1227    
1228            @BeanReference(type = AnnouncementsEntryLocalService.class)
1229            protected AnnouncementsEntryLocalService announcementsEntryLocalService;
1230            @BeanReference(type = com.liferay.portlet.announcements.service.AnnouncementsEntryService.class)
1231            protected com.liferay.portlet.announcements.service.AnnouncementsEntryService announcementsEntryService;
1232            @BeanReference(type = AnnouncementsEntryPersistence.class)
1233            protected AnnouncementsEntryPersistence announcementsEntryPersistence;
1234            @BeanReference(type = AnnouncementsEntryFinder.class)
1235            protected AnnouncementsEntryFinder announcementsEntryFinder;
1236            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
1237            protected com.liferay.counter.service.CounterLocalService counterLocalService;
1238            @BeanReference(type = com.liferay.mail.service.MailService.class)
1239            protected com.liferay.mail.service.MailService mailService;
1240            @BeanReference(type = com.liferay.portal.service.CompanyLocalService.class)
1241            protected com.liferay.portal.service.CompanyLocalService companyLocalService;
1242            @BeanReference(type = com.liferay.portal.service.CompanyService.class)
1243            protected com.liferay.portal.service.CompanyService companyService;
1244            @BeanReference(type = CompanyPersistence.class)
1245            protected CompanyPersistence companyPersistence;
1246            @BeanReference(type = com.liferay.portal.service.GroupLocalService.class)
1247            protected com.liferay.portal.service.GroupLocalService groupLocalService;
1248            @BeanReference(type = com.liferay.portal.service.GroupService.class)
1249            protected com.liferay.portal.service.GroupService groupService;
1250            @BeanReference(type = GroupPersistence.class)
1251            protected GroupPersistence groupPersistence;
1252            @BeanReference(type = GroupFinder.class)
1253            protected GroupFinder groupFinder;
1254            @BeanReference(type = com.liferay.portal.service.OrganizationLocalService.class)
1255            protected com.liferay.portal.service.OrganizationLocalService organizationLocalService;
1256            @BeanReference(type = com.liferay.portal.service.OrganizationService.class)
1257            protected com.liferay.portal.service.OrganizationService organizationService;
1258            @BeanReference(type = OrganizationPersistence.class)
1259            protected OrganizationPersistence organizationPersistence;
1260            @BeanReference(type = OrganizationFinder.class)
1261            protected OrganizationFinder organizationFinder;
1262            @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
1263            protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
1264            @BeanReference(type = com.liferay.portal.service.RoleLocalService.class)
1265            protected com.liferay.portal.service.RoleLocalService roleLocalService;
1266            @BeanReference(type = com.liferay.portal.service.RoleService.class)
1267            protected com.liferay.portal.service.RoleService roleService;
1268            @BeanReference(type = RolePersistence.class)
1269            protected RolePersistence rolePersistence;
1270            @BeanReference(type = RoleFinder.class)
1271            protected RoleFinder roleFinder;
1272            @BeanReference(type = com.liferay.portal.service.TeamLocalService.class)
1273            protected com.liferay.portal.service.TeamLocalService teamLocalService;
1274            @BeanReference(type = com.liferay.portal.service.TeamService.class)
1275            protected com.liferay.portal.service.TeamService teamService;
1276            @BeanReference(type = TeamPersistence.class)
1277            protected TeamPersistence teamPersistence;
1278            @BeanReference(type = TeamFinder.class)
1279            protected TeamFinder teamFinder;
1280            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
1281            protected com.liferay.portal.service.UserLocalService userLocalService;
1282            @BeanReference(type = com.liferay.portal.service.UserService.class)
1283            protected com.liferay.portal.service.UserService userService;
1284            @BeanReference(type = UserPersistence.class)
1285            protected UserPersistence userPersistence;
1286            @BeanReference(type = UserFinder.class)
1287            protected UserFinder userFinder;
1288            @BeanReference(type = com.liferay.portal.service.UserGroupLocalService.class)
1289            protected com.liferay.portal.service.UserGroupLocalService userGroupLocalService;
1290            @BeanReference(type = com.liferay.portal.service.UserGroupService.class)
1291            protected com.liferay.portal.service.UserGroupService userGroupService;
1292            @BeanReference(type = UserGroupPersistence.class)
1293            protected UserGroupPersistence userGroupPersistence;
1294            @BeanReference(type = UserGroupFinder.class)
1295            protected UserGroupFinder userGroupFinder;
1296            @BeanReference(type = com.liferay.portlet.announcements.service.AnnouncementsDeliveryLocalService.class)
1297            protected com.liferay.portlet.announcements.service.AnnouncementsDeliveryLocalService announcementsDeliveryLocalService;
1298            @BeanReference(type = com.liferay.portlet.announcements.service.AnnouncementsDeliveryService.class)
1299            protected com.liferay.portlet.announcements.service.AnnouncementsDeliveryService announcementsDeliveryService;
1300            @BeanReference(type = AnnouncementsDeliveryPersistence.class)
1301            protected AnnouncementsDeliveryPersistence announcementsDeliveryPersistence;
1302            @BeanReference(type = com.liferay.portlet.announcements.service.AnnouncementsFlagLocalService.class)
1303            protected com.liferay.portlet.announcements.service.AnnouncementsFlagLocalService announcementsFlagLocalService;
1304            @BeanReference(type = com.liferay.portlet.announcements.service.AnnouncementsFlagService.class)
1305            protected com.liferay.portlet.announcements.service.AnnouncementsFlagService announcementsFlagService;
1306            @BeanReference(type = AnnouncementsFlagPersistence.class)
1307            protected AnnouncementsFlagPersistence announcementsFlagPersistence;
1308            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
1309            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
1310            private String _beanIdentifier;
1311    }