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