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,
299                                                    modelAdditionCount);
300    
301                                            long modelDeletionCount = ExportImportHelperUtil.getModelDeletionCount(portletDataContext,
302                                                            stagedModelType);
303    
304                                            manifestSummary.addModelDeletionCount(stagedModelType,
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                                            long referrerClassNameId = stagedModelType.getReferrerClassNameId();
322    
323                                            Property classNameIdProperty = PropertyFactoryUtil.forName(
324                                                            "classNameId");
325    
326                                            if ((referrerClassNameId != StagedModelType.REFERRER_CLASS_NAME_ID_ALL) &&
327                                                            (referrerClassNameId != StagedModelType.REFERRER_CLASS_NAME_ID_ANY)) {
328                                                    dynamicQuery.add(classNameIdProperty.eq(
329                                                                    stagedModelType.getReferrerClassNameId()));
330                                            }
331                                            else if (referrerClassNameId == StagedModelType.REFERRER_CLASS_NAME_ID_ANY) {
332                                                    dynamicQuery.add(classNameIdProperty.isNotNull());
333                                            }
334                                    }
335                            });
336    
337                    exportActionableDynamicQuery.setCompanyId(portletDataContext.getCompanyId());
338    
339                    exportActionableDynamicQuery.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod<AnnouncementsEntry>() {
340                                    @Override
341                                    public void performAction(AnnouncementsEntry announcementsEntry)
342                                            throws PortalException {
343                                            StagedModelDataHandlerUtil.exportStagedModel(portletDataContext,
344                                                    announcementsEntry);
345                                    }
346                            });
347                    exportActionableDynamicQuery.setStagedModelType(new StagedModelType(
348                                    PortalUtil.getClassNameId(AnnouncementsEntry.class.getName()),
349                                    StagedModelType.REFERRER_CLASS_NAME_ID_ALL));
350    
351                    return exportActionableDynamicQuery;
352            }
353    
354            /**
355             * @throws PortalException
356             */
357            @Override
358            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
359                    throws PortalException {
360                    return announcementsEntryLocalService.deleteAnnouncementsEntry((AnnouncementsEntry)persistedModel);
361            }
362    
363            @Override
364            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
365                    throws PortalException {
366                    return announcementsEntryPersistence.findByPrimaryKey(primaryKeyObj);
367            }
368    
369            /**
370             * Returns the announcements entry with the matching UUID and company.
371             *
372             * @param uuid the announcements entry's UUID
373             * @param companyId the primary key of the company
374             * @return the matching announcements entry
375             * @throws PortalException if a matching announcements entry could not be found
376             */
377            @Override
378            public AnnouncementsEntry getAnnouncementsEntryByUuidAndCompanyId(
379                    String uuid, long companyId) throws PortalException {
380                    return announcementsEntryPersistence.findByUuid_C_First(uuid,
381                            companyId, null);
382            }
383    
384            /**
385             * Returns a range of all the announcements entries.
386             *
387             * <p>
388             * 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.
389             * </p>
390             *
391             * @param start the lower bound of the range of announcements entries
392             * @param end the upper bound of the range of announcements entries (not inclusive)
393             * @return the range of announcements entries
394             */
395            @Override
396            public List<AnnouncementsEntry> getAnnouncementsEntries(int start, int end) {
397                    return announcementsEntryPersistence.findAll(start, end);
398            }
399    
400            /**
401             * Returns the number of announcements entries.
402             *
403             * @return the number of announcements entries
404             */
405            @Override
406            public int getAnnouncementsEntriesCount() {
407                    return announcementsEntryPersistence.countAll();
408            }
409    
410            /**
411             * Updates the announcements entry in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
412             *
413             * @param announcementsEntry the announcements entry
414             * @return the announcements entry that was updated
415             */
416            @Indexable(type = IndexableType.REINDEX)
417            @Override
418            public AnnouncementsEntry updateAnnouncementsEntry(
419                    AnnouncementsEntry announcementsEntry) {
420                    return announcementsEntryPersistence.update(announcementsEntry);
421            }
422    
423            /**
424             * Returns the announcements entry local service.
425             *
426             * @return the announcements entry local service
427             */
428            public AnnouncementsEntryLocalService getAnnouncementsEntryLocalService() {
429                    return announcementsEntryLocalService;
430            }
431    
432            /**
433             * Sets the announcements entry local service.
434             *
435             * @param announcementsEntryLocalService the announcements entry local service
436             */
437            public void setAnnouncementsEntryLocalService(
438                    AnnouncementsEntryLocalService announcementsEntryLocalService) {
439                    this.announcementsEntryLocalService = announcementsEntryLocalService;
440            }
441    
442            /**
443             * Returns the announcements entry remote service.
444             *
445             * @return the announcements entry remote service
446             */
447            public com.liferay.portlet.announcements.service.AnnouncementsEntryService getAnnouncementsEntryService() {
448                    return announcementsEntryService;
449            }
450    
451            /**
452             * Sets the announcements entry remote service.
453             *
454             * @param announcementsEntryService the announcements entry remote service
455             */
456            public void setAnnouncementsEntryService(
457                    com.liferay.portlet.announcements.service.AnnouncementsEntryService announcementsEntryService) {
458                    this.announcementsEntryService = announcementsEntryService;
459            }
460    
461            /**
462             * Returns the announcements entry persistence.
463             *
464             * @return the announcements entry persistence
465             */
466            public AnnouncementsEntryPersistence getAnnouncementsEntryPersistence() {
467                    return announcementsEntryPersistence;
468            }
469    
470            /**
471             * Sets the announcements entry persistence.
472             *
473             * @param announcementsEntryPersistence the announcements entry persistence
474             */
475            public void setAnnouncementsEntryPersistence(
476                    AnnouncementsEntryPersistence announcementsEntryPersistence) {
477                    this.announcementsEntryPersistence = announcementsEntryPersistence;
478            }
479    
480            /**
481             * Returns the announcements entry finder.
482             *
483             * @return the announcements entry finder
484             */
485            public AnnouncementsEntryFinder getAnnouncementsEntryFinder() {
486                    return announcementsEntryFinder;
487            }
488    
489            /**
490             * Sets the announcements entry finder.
491             *
492             * @param announcementsEntryFinder the announcements entry finder
493             */
494            public void setAnnouncementsEntryFinder(
495                    AnnouncementsEntryFinder announcementsEntryFinder) {
496                    this.announcementsEntryFinder = announcementsEntryFinder;
497            }
498    
499            /**
500             * Returns the counter local service.
501             *
502             * @return the counter local service
503             */
504            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
505                    return counterLocalService;
506            }
507    
508            /**
509             * Sets the counter local service.
510             *
511             * @param counterLocalService the counter local service
512             */
513            public void setCounterLocalService(
514                    com.liferay.counter.service.CounterLocalService counterLocalService) {
515                    this.counterLocalService = counterLocalService;
516            }
517    
518            /**
519             * Returns the mail remote service.
520             *
521             * @return the mail remote service
522             */
523            public com.liferay.mail.service.MailService getMailService() {
524                    return mailService;
525            }
526    
527            /**
528             * Sets the mail remote service.
529             *
530             * @param mailService the mail remote service
531             */
532            public void setMailService(com.liferay.mail.service.MailService mailService) {
533                    this.mailService = mailService;
534            }
535    
536            /**
537             * Returns the company local service.
538             *
539             * @return the company local service
540             */
541            public com.liferay.portal.service.CompanyLocalService getCompanyLocalService() {
542                    return companyLocalService;
543            }
544    
545            /**
546             * Sets the company local service.
547             *
548             * @param companyLocalService the company local service
549             */
550            public void setCompanyLocalService(
551                    com.liferay.portal.service.CompanyLocalService companyLocalService) {
552                    this.companyLocalService = companyLocalService;
553            }
554    
555            /**
556             * Returns the company remote service.
557             *
558             * @return the company remote service
559             */
560            public com.liferay.portal.service.CompanyService getCompanyService() {
561                    return companyService;
562            }
563    
564            /**
565             * Sets the company remote service.
566             *
567             * @param companyService the company remote service
568             */
569            public void setCompanyService(
570                    com.liferay.portal.service.CompanyService companyService) {
571                    this.companyService = companyService;
572            }
573    
574            /**
575             * Returns the company persistence.
576             *
577             * @return the company persistence
578             */
579            public CompanyPersistence getCompanyPersistence() {
580                    return companyPersistence;
581            }
582    
583            /**
584             * Sets the company persistence.
585             *
586             * @param companyPersistence the company persistence
587             */
588            public void setCompanyPersistence(CompanyPersistence companyPersistence) {
589                    this.companyPersistence = companyPersistence;
590            }
591    
592            /**
593             * Returns the group local service.
594             *
595             * @return the group local service
596             */
597            public com.liferay.portal.service.GroupLocalService getGroupLocalService() {
598                    return groupLocalService;
599            }
600    
601            /**
602             * Sets the group local service.
603             *
604             * @param groupLocalService the group local service
605             */
606            public void setGroupLocalService(
607                    com.liferay.portal.service.GroupLocalService groupLocalService) {
608                    this.groupLocalService = groupLocalService;
609            }
610    
611            /**
612             * Returns the group remote service.
613             *
614             * @return the group remote service
615             */
616            public com.liferay.portal.service.GroupService getGroupService() {
617                    return groupService;
618            }
619    
620            /**
621             * Sets the group remote service.
622             *
623             * @param groupService the group remote service
624             */
625            public void setGroupService(
626                    com.liferay.portal.service.GroupService groupService) {
627                    this.groupService = groupService;
628            }
629    
630            /**
631             * Returns the group persistence.
632             *
633             * @return the group persistence
634             */
635            public GroupPersistence getGroupPersistence() {
636                    return groupPersistence;
637            }
638    
639            /**
640             * Sets the group persistence.
641             *
642             * @param groupPersistence the group persistence
643             */
644            public void setGroupPersistence(GroupPersistence groupPersistence) {
645                    this.groupPersistence = groupPersistence;
646            }
647    
648            /**
649             * Returns the group finder.
650             *
651             * @return the group finder
652             */
653            public GroupFinder getGroupFinder() {
654                    return groupFinder;
655            }
656    
657            /**
658             * Sets the group finder.
659             *
660             * @param groupFinder the group finder
661             */
662            public void setGroupFinder(GroupFinder groupFinder) {
663                    this.groupFinder = groupFinder;
664            }
665    
666            /**
667             * Returns the organization local service.
668             *
669             * @return the organization local service
670             */
671            public com.liferay.portal.service.OrganizationLocalService getOrganizationLocalService() {
672                    return organizationLocalService;
673            }
674    
675            /**
676             * Sets the organization local service.
677             *
678             * @param organizationLocalService the organization local service
679             */
680            public void setOrganizationLocalService(
681                    com.liferay.portal.service.OrganizationLocalService organizationLocalService) {
682                    this.organizationLocalService = organizationLocalService;
683            }
684    
685            /**
686             * Returns the organization remote service.
687             *
688             * @return the organization remote service
689             */
690            public com.liferay.portal.service.OrganizationService getOrganizationService() {
691                    return organizationService;
692            }
693    
694            /**
695             * Sets the organization remote service.
696             *
697             * @param organizationService the organization remote service
698             */
699            public void setOrganizationService(
700                    com.liferay.portal.service.OrganizationService organizationService) {
701                    this.organizationService = organizationService;
702            }
703    
704            /**
705             * Returns the organization persistence.
706             *
707             * @return the organization persistence
708             */
709            public OrganizationPersistence getOrganizationPersistence() {
710                    return organizationPersistence;
711            }
712    
713            /**
714             * Sets the organization persistence.
715             *
716             * @param organizationPersistence the organization persistence
717             */
718            public void setOrganizationPersistence(
719                    OrganizationPersistence organizationPersistence) {
720                    this.organizationPersistence = organizationPersistence;
721            }
722    
723            /**
724             * Returns the organization finder.
725             *
726             * @return the organization finder
727             */
728            public OrganizationFinder getOrganizationFinder() {
729                    return organizationFinder;
730            }
731    
732            /**
733             * Sets the organization finder.
734             *
735             * @param organizationFinder the organization finder
736             */
737            public void setOrganizationFinder(OrganizationFinder organizationFinder) {
738                    this.organizationFinder = organizationFinder;
739            }
740    
741            /**
742             * Returns the resource local service.
743             *
744             * @return the resource local service
745             */
746            public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
747                    return resourceLocalService;
748            }
749    
750            /**
751             * Sets the resource local service.
752             *
753             * @param resourceLocalService the resource local service
754             */
755            public void setResourceLocalService(
756                    com.liferay.portal.service.ResourceLocalService resourceLocalService) {
757                    this.resourceLocalService = resourceLocalService;
758            }
759    
760            /**
761             * Returns the role local service.
762             *
763             * @return the role local service
764             */
765            public com.liferay.portal.service.RoleLocalService getRoleLocalService() {
766                    return roleLocalService;
767            }
768    
769            /**
770             * Sets the role local service.
771             *
772             * @param roleLocalService the role local service
773             */
774            public void setRoleLocalService(
775                    com.liferay.portal.service.RoleLocalService roleLocalService) {
776                    this.roleLocalService = roleLocalService;
777            }
778    
779            /**
780             * Returns the role remote service.
781             *
782             * @return the role remote service
783             */
784            public com.liferay.portal.service.RoleService getRoleService() {
785                    return roleService;
786            }
787    
788            /**
789             * Sets the role remote service.
790             *
791             * @param roleService the role remote service
792             */
793            public void setRoleService(
794                    com.liferay.portal.service.RoleService roleService) {
795                    this.roleService = roleService;
796            }
797    
798            /**
799             * Returns the role persistence.
800             *
801             * @return the role persistence
802             */
803            public RolePersistence getRolePersistence() {
804                    return rolePersistence;
805            }
806    
807            /**
808             * Sets the role persistence.
809             *
810             * @param rolePersistence the role persistence
811             */
812            public void setRolePersistence(RolePersistence rolePersistence) {
813                    this.rolePersistence = rolePersistence;
814            }
815    
816            /**
817             * Returns the role finder.
818             *
819             * @return the role finder
820             */
821            public RoleFinder getRoleFinder() {
822                    return roleFinder;
823            }
824    
825            /**
826             * Sets the role finder.
827             *
828             * @param roleFinder the role finder
829             */
830            public void setRoleFinder(RoleFinder roleFinder) {
831                    this.roleFinder = roleFinder;
832            }
833    
834            /**
835             * Returns the team local service.
836             *
837             * @return the team local service
838             */
839            public com.liferay.portal.service.TeamLocalService getTeamLocalService() {
840                    return teamLocalService;
841            }
842    
843            /**
844             * Sets the team local service.
845             *
846             * @param teamLocalService the team local service
847             */
848            public void setTeamLocalService(
849                    com.liferay.portal.service.TeamLocalService teamLocalService) {
850                    this.teamLocalService = teamLocalService;
851            }
852    
853            /**
854             * Returns the team remote service.
855             *
856             * @return the team remote service
857             */
858            public com.liferay.portal.service.TeamService getTeamService() {
859                    return teamService;
860            }
861    
862            /**
863             * Sets the team remote service.
864             *
865             * @param teamService the team remote service
866             */
867            public void setTeamService(
868                    com.liferay.portal.service.TeamService teamService) {
869                    this.teamService = teamService;
870            }
871    
872            /**
873             * Returns the team persistence.
874             *
875             * @return the team persistence
876             */
877            public TeamPersistence getTeamPersistence() {
878                    return teamPersistence;
879            }
880    
881            /**
882             * Sets the team persistence.
883             *
884             * @param teamPersistence the team persistence
885             */
886            public void setTeamPersistence(TeamPersistence teamPersistence) {
887                    this.teamPersistence = teamPersistence;
888            }
889    
890            /**
891             * Returns the team finder.
892             *
893             * @return the team finder
894             */
895            public TeamFinder getTeamFinder() {
896                    return teamFinder;
897            }
898    
899            /**
900             * Sets the team finder.
901             *
902             * @param teamFinder the team finder
903             */
904            public void setTeamFinder(TeamFinder teamFinder) {
905                    this.teamFinder = teamFinder;
906            }
907    
908            /**
909             * Returns the user local service.
910             *
911             * @return the user local service
912             */
913            public com.liferay.portal.service.UserLocalService getUserLocalService() {
914                    return userLocalService;
915            }
916    
917            /**
918             * Sets the user local service.
919             *
920             * @param userLocalService the user local service
921             */
922            public void setUserLocalService(
923                    com.liferay.portal.service.UserLocalService userLocalService) {
924                    this.userLocalService = userLocalService;
925            }
926    
927            /**
928             * Returns the user remote service.
929             *
930             * @return the user remote service
931             */
932            public com.liferay.portal.service.UserService getUserService() {
933                    return userService;
934            }
935    
936            /**
937             * Sets the user remote service.
938             *
939             * @param userService the user remote service
940             */
941            public void setUserService(
942                    com.liferay.portal.service.UserService userService) {
943                    this.userService = userService;
944            }
945    
946            /**
947             * Returns the user persistence.
948             *
949             * @return the user persistence
950             */
951            public UserPersistence getUserPersistence() {
952                    return userPersistence;
953            }
954    
955            /**
956             * Sets the user persistence.
957             *
958             * @param userPersistence the user persistence
959             */
960            public void setUserPersistence(UserPersistence userPersistence) {
961                    this.userPersistence = userPersistence;
962            }
963    
964            /**
965             * Returns the user finder.
966             *
967             * @return the user finder
968             */
969            public UserFinder getUserFinder() {
970                    return userFinder;
971            }
972    
973            /**
974             * Sets the user finder.
975             *
976             * @param userFinder the user finder
977             */
978            public void setUserFinder(UserFinder userFinder) {
979                    this.userFinder = userFinder;
980            }
981    
982            /**
983             * Returns the user group local service.
984             *
985             * @return the user group local service
986             */
987            public com.liferay.portal.service.UserGroupLocalService getUserGroupLocalService() {
988                    return userGroupLocalService;
989            }
990    
991            /**
992             * Sets the user group local service.
993             *
994             * @param userGroupLocalService the user group local service
995             */
996            public void setUserGroupLocalService(
997                    com.liferay.portal.service.UserGroupLocalService userGroupLocalService) {
998                    this.userGroupLocalService = userGroupLocalService;
999            }
1000    
1001            /**
1002             * Returns the user group remote service.
1003             *
1004             * @return the user group remote service
1005             */
1006            public com.liferay.portal.service.UserGroupService getUserGroupService() {
1007                    return userGroupService;
1008            }
1009    
1010            /**
1011             * Sets the user group remote service.
1012             *
1013             * @param userGroupService the user group remote service
1014             */
1015            public void setUserGroupService(
1016                    com.liferay.portal.service.UserGroupService userGroupService) {
1017                    this.userGroupService = userGroupService;
1018            }
1019    
1020            /**
1021             * Returns the user group persistence.
1022             *
1023             * @return the user group persistence
1024             */
1025            public UserGroupPersistence getUserGroupPersistence() {
1026                    return userGroupPersistence;
1027            }
1028    
1029            /**
1030             * Sets the user group persistence.
1031             *
1032             * @param userGroupPersistence the user group persistence
1033             */
1034            public void setUserGroupPersistence(
1035                    UserGroupPersistence userGroupPersistence) {
1036                    this.userGroupPersistence = userGroupPersistence;
1037            }
1038    
1039            /**
1040             * Returns the user group finder.
1041             *
1042             * @return the user group finder
1043             */
1044            public UserGroupFinder getUserGroupFinder() {
1045                    return userGroupFinder;
1046            }
1047    
1048            /**
1049             * Sets the user group finder.
1050             *
1051             * @param userGroupFinder the user group finder
1052             */
1053            public void setUserGroupFinder(UserGroupFinder userGroupFinder) {
1054                    this.userGroupFinder = userGroupFinder;
1055            }
1056    
1057            /**
1058             * Returns the announcements delivery local service.
1059             *
1060             * @return the announcements delivery local service
1061             */
1062            public com.liferay.portlet.announcements.service.AnnouncementsDeliveryLocalService getAnnouncementsDeliveryLocalService() {
1063                    return announcementsDeliveryLocalService;
1064            }
1065    
1066            /**
1067             * Sets the announcements delivery local service.
1068             *
1069             * @param announcementsDeliveryLocalService the announcements delivery local service
1070             */
1071            public void setAnnouncementsDeliveryLocalService(
1072                    com.liferay.portlet.announcements.service.AnnouncementsDeliveryLocalService announcementsDeliveryLocalService) {
1073                    this.announcementsDeliveryLocalService = announcementsDeliveryLocalService;
1074            }
1075    
1076            /**
1077             * Returns the announcements delivery remote service.
1078             *
1079             * @return the announcements delivery remote service
1080             */
1081            public com.liferay.portlet.announcements.service.AnnouncementsDeliveryService getAnnouncementsDeliveryService() {
1082                    return announcementsDeliveryService;
1083            }
1084    
1085            /**
1086             * Sets the announcements delivery remote service.
1087             *
1088             * @param announcementsDeliveryService the announcements delivery remote service
1089             */
1090            public void setAnnouncementsDeliveryService(
1091                    com.liferay.portlet.announcements.service.AnnouncementsDeliveryService announcementsDeliveryService) {
1092                    this.announcementsDeliveryService = announcementsDeliveryService;
1093            }
1094    
1095            /**
1096             * Returns the announcements delivery persistence.
1097             *
1098             * @return the announcements delivery persistence
1099             */
1100            public AnnouncementsDeliveryPersistence getAnnouncementsDeliveryPersistence() {
1101                    return announcementsDeliveryPersistence;
1102            }
1103    
1104            /**
1105             * Sets the announcements delivery persistence.
1106             *
1107             * @param announcementsDeliveryPersistence the announcements delivery persistence
1108             */
1109            public void setAnnouncementsDeliveryPersistence(
1110                    AnnouncementsDeliveryPersistence announcementsDeliveryPersistence) {
1111                    this.announcementsDeliveryPersistence = announcementsDeliveryPersistence;
1112            }
1113    
1114            /**
1115             * Returns the announcements flag local service.
1116             *
1117             * @return the announcements flag local service
1118             */
1119            public com.liferay.portlet.announcements.service.AnnouncementsFlagLocalService getAnnouncementsFlagLocalService() {
1120                    return announcementsFlagLocalService;
1121            }
1122    
1123            /**
1124             * Sets the announcements flag local service.
1125             *
1126             * @param announcementsFlagLocalService the announcements flag local service
1127             */
1128            public void setAnnouncementsFlagLocalService(
1129                    com.liferay.portlet.announcements.service.AnnouncementsFlagLocalService announcementsFlagLocalService) {
1130                    this.announcementsFlagLocalService = announcementsFlagLocalService;
1131            }
1132    
1133            /**
1134             * Returns the announcements flag remote service.
1135             *
1136             * @return the announcements flag remote service
1137             */
1138            public com.liferay.portlet.announcements.service.AnnouncementsFlagService getAnnouncementsFlagService() {
1139                    return announcementsFlagService;
1140            }
1141    
1142            /**
1143             * Sets the announcements flag remote service.
1144             *
1145             * @param announcementsFlagService the announcements flag remote service
1146             */
1147            public void setAnnouncementsFlagService(
1148                    com.liferay.portlet.announcements.service.AnnouncementsFlagService announcementsFlagService) {
1149                    this.announcementsFlagService = announcementsFlagService;
1150            }
1151    
1152            /**
1153             * Returns the announcements flag persistence.
1154             *
1155             * @return the announcements flag persistence
1156             */
1157            public AnnouncementsFlagPersistence getAnnouncementsFlagPersistence() {
1158                    return announcementsFlagPersistence;
1159            }
1160    
1161            /**
1162             * Sets the announcements flag persistence.
1163             *
1164             * @param announcementsFlagPersistence the announcements flag persistence
1165             */
1166            public void setAnnouncementsFlagPersistence(
1167                    AnnouncementsFlagPersistence announcementsFlagPersistence) {
1168                    this.announcementsFlagPersistence = announcementsFlagPersistence;
1169            }
1170    
1171            public void afterPropertiesSet() {
1172                    persistedModelLocalServiceRegistry.register("com.liferay.portlet.announcements.model.AnnouncementsEntry",
1173                            announcementsEntryLocalService);
1174            }
1175    
1176            public void destroy() {
1177                    persistedModelLocalServiceRegistry.unregister(
1178                            "com.liferay.portlet.announcements.model.AnnouncementsEntry");
1179            }
1180    
1181            /**
1182             * Returns the Spring bean ID for this bean.
1183             *
1184             * @return the Spring bean ID for this bean
1185             */
1186            @Override
1187            public String getBeanIdentifier() {
1188                    return _beanIdentifier;
1189            }
1190    
1191            /**
1192             * Sets the Spring bean ID for this bean.
1193             *
1194             * @param beanIdentifier the Spring bean ID for this bean
1195             */
1196            @Override
1197            public void setBeanIdentifier(String beanIdentifier) {
1198                    _beanIdentifier = beanIdentifier;
1199            }
1200    
1201            protected Class<?> getModelClass() {
1202                    return AnnouncementsEntry.class;
1203            }
1204    
1205            protected String getModelClassName() {
1206                    return AnnouncementsEntry.class.getName();
1207            }
1208    
1209            /**
1210             * Performs a SQL query.
1211             *
1212             * @param sql the sql query
1213             */
1214            protected void runSQL(String sql) {
1215                    try {
1216                            DataSource dataSource = announcementsEntryPersistence.getDataSource();
1217    
1218                            DB db = DBFactoryUtil.getDB();
1219    
1220                            sql = db.buildSQL(sql);
1221                            sql = PortalUtil.transformSQL(sql);
1222    
1223                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
1224                                            sql, new int[0]);
1225    
1226                            sqlUpdate.update();
1227                    }
1228                    catch (Exception e) {
1229                            throw new SystemException(e);
1230                    }
1231            }
1232    
1233            @BeanReference(type = com.liferay.portlet.announcements.service.AnnouncementsEntryLocalService.class)
1234            protected AnnouncementsEntryLocalService announcementsEntryLocalService;
1235            @BeanReference(type = com.liferay.portlet.announcements.service.AnnouncementsEntryService.class)
1236            protected com.liferay.portlet.announcements.service.AnnouncementsEntryService announcementsEntryService;
1237            @BeanReference(type = AnnouncementsEntryPersistence.class)
1238            protected AnnouncementsEntryPersistence announcementsEntryPersistence;
1239            @BeanReference(type = AnnouncementsEntryFinder.class)
1240            protected AnnouncementsEntryFinder announcementsEntryFinder;
1241            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
1242            protected com.liferay.counter.service.CounterLocalService counterLocalService;
1243            @BeanReference(type = com.liferay.mail.service.MailService.class)
1244            protected com.liferay.mail.service.MailService mailService;
1245            @BeanReference(type = com.liferay.portal.service.CompanyLocalService.class)
1246            protected com.liferay.portal.service.CompanyLocalService companyLocalService;
1247            @BeanReference(type = com.liferay.portal.service.CompanyService.class)
1248            protected com.liferay.portal.service.CompanyService companyService;
1249            @BeanReference(type = CompanyPersistence.class)
1250            protected CompanyPersistence companyPersistence;
1251            @BeanReference(type = com.liferay.portal.service.GroupLocalService.class)
1252            protected com.liferay.portal.service.GroupLocalService groupLocalService;
1253            @BeanReference(type = com.liferay.portal.service.GroupService.class)
1254            protected com.liferay.portal.service.GroupService groupService;
1255            @BeanReference(type = GroupPersistence.class)
1256            protected GroupPersistence groupPersistence;
1257            @BeanReference(type = GroupFinder.class)
1258            protected GroupFinder groupFinder;
1259            @BeanReference(type = com.liferay.portal.service.OrganizationLocalService.class)
1260            protected com.liferay.portal.service.OrganizationLocalService organizationLocalService;
1261            @BeanReference(type = com.liferay.portal.service.OrganizationService.class)
1262            protected com.liferay.portal.service.OrganizationService organizationService;
1263            @BeanReference(type = OrganizationPersistence.class)
1264            protected OrganizationPersistence organizationPersistence;
1265            @BeanReference(type = OrganizationFinder.class)
1266            protected OrganizationFinder organizationFinder;
1267            @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
1268            protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
1269            @BeanReference(type = com.liferay.portal.service.RoleLocalService.class)
1270            protected com.liferay.portal.service.RoleLocalService roleLocalService;
1271            @BeanReference(type = com.liferay.portal.service.RoleService.class)
1272            protected com.liferay.portal.service.RoleService roleService;
1273            @BeanReference(type = RolePersistence.class)
1274            protected RolePersistence rolePersistence;
1275            @BeanReference(type = RoleFinder.class)
1276            protected RoleFinder roleFinder;
1277            @BeanReference(type = com.liferay.portal.service.TeamLocalService.class)
1278            protected com.liferay.portal.service.TeamLocalService teamLocalService;
1279            @BeanReference(type = com.liferay.portal.service.TeamService.class)
1280            protected com.liferay.portal.service.TeamService teamService;
1281            @BeanReference(type = TeamPersistence.class)
1282            protected TeamPersistence teamPersistence;
1283            @BeanReference(type = TeamFinder.class)
1284            protected TeamFinder teamFinder;
1285            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
1286            protected com.liferay.portal.service.UserLocalService userLocalService;
1287            @BeanReference(type = com.liferay.portal.service.UserService.class)
1288            protected com.liferay.portal.service.UserService userService;
1289            @BeanReference(type = UserPersistence.class)
1290            protected UserPersistence userPersistence;
1291            @BeanReference(type = UserFinder.class)
1292            protected UserFinder userFinder;
1293            @BeanReference(type = com.liferay.portal.service.UserGroupLocalService.class)
1294            protected com.liferay.portal.service.UserGroupLocalService userGroupLocalService;
1295            @BeanReference(type = com.liferay.portal.service.UserGroupService.class)
1296            protected com.liferay.portal.service.UserGroupService userGroupService;
1297            @BeanReference(type = UserGroupPersistence.class)
1298            protected UserGroupPersistence userGroupPersistence;
1299            @BeanReference(type = UserGroupFinder.class)
1300            protected UserGroupFinder userGroupFinder;
1301            @BeanReference(type = com.liferay.portlet.announcements.service.AnnouncementsDeliveryLocalService.class)
1302            protected com.liferay.portlet.announcements.service.AnnouncementsDeliveryLocalService announcementsDeliveryLocalService;
1303            @BeanReference(type = com.liferay.portlet.announcements.service.AnnouncementsDeliveryService.class)
1304            protected com.liferay.portlet.announcements.service.AnnouncementsDeliveryService announcementsDeliveryService;
1305            @BeanReference(type = AnnouncementsDeliveryPersistence.class)
1306            protected AnnouncementsDeliveryPersistence announcementsDeliveryPersistence;
1307            @BeanReference(type = com.liferay.portlet.announcements.service.AnnouncementsFlagLocalService.class)
1308            protected com.liferay.portlet.announcements.service.AnnouncementsFlagLocalService announcementsFlagLocalService;
1309            @BeanReference(type = com.liferay.portlet.announcements.service.AnnouncementsFlagService.class)
1310            protected com.liferay.portlet.announcements.service.AnnouncementsFlagService announcementsFlagService;
1311            @BeanReference(type = AnnouncementsFlagPersistence.class)
1312            protected AnnouncementsFlagPersistence announcementsFlagPersistence;
1313            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
1314            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
1315            private String _beanIdentifier;
1316    }