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 that match the dynamic query.
196             *
197             * @param dynamicQuery the dynamic query
198             * @return the number of rows that match 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 that match 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 that match 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            @Override
342            public List<JournalFeed> getJournalFeedsByUuidAndCompanyId(String uuid,
343                    long companyId) {
344                    return journalFeedPersistence.findByUuid_C(uuid, companyId);
345            }
346    
347            @Override
348            public List<JournalFeed> getJournalFeedsByUuidAndCompanyId(String uuid,
349                    long companyId, int start, int end,
350                    OrderByComparator<JournalFeed> orderByComparator) {
351                    return journalFeedPersistence.findByUuid_C(uuid, companyId, start, end,
352                            orderByComparator);
353            }
354    
355            /**
356             * Returns the journal feed matching the UUID and group.
357             *
358             * @param uuid the journal feed's UUID
359             * @param groupId the primary key of the group
360             * @return the matching journal feed
361             * @throws PortalException if a matching journal feed could not be found
362             */
363            @Override
364            public JournalFeed getJournalFeedByUuidAndGroupId(String uuid, long groupId)
365                    throws PortalException {
366                    return journalFeedPersistence.findByUUID_G(uuid, groupId);
367            }
368    
369            /**
370             * Returns a range of all the journal feeds.
371             *
372             * <p>
373             * 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.
374             * </p>
375             *
376             * @param start the lower bound of the range of journal feeds
377             * @param end the upper bound of the range of journal feeds (not inclusive)
378             * @return the range of journal feeds
379             */
380            @Override
381            public List<JournalFeed> getJournalFeeds(int start, int end) {
382                    return journalFeedPersistence.findAll(start, end);
383            }
384    
385            /**
386             * Returns the number of journal feeds.
387             *
388             * @return the number of journal feeds
389             */
390            @Override
391            public int getJournalFeedsCount() {
392                    return journalFeedPersistence.countAll();
393            }
394    
395            /**
396             * Updates the journal feed in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
397             *
398             * @param journalFeed the journal feed
399             * @return the journal feed that was updated
400             */
401            @Indexable(type = IndexableType.REINDEX)
402            @Override
403            public JournalFeed updateJournalFeed(JournalFeed journalFeed) {
404                    return journalFeedPersistence.update(journalFeed);
405            }
406    
407            /**
408             * Returns the journal feed local service.
409             *
410             * @return the journal feed local service
411             */
412            public com.liferay.portlet.journal.service.JournalFeedLocalService getJournalFeedLocalService() {
413                    return journalFeedLocalService;
414            }
415    
416            /**
417             * Sets the journal feed local service.
418             *
419             * @param journalFeedLocalService the journal feed local service
420             */
421            public void setJournalFeedLocalService(
422                    com.liferay.portlet.journal.service.JournalFeedLocalService journalFeedLocalService) {
423                    this.journalFeedLocalService = journalFeedLocalService;
424            }
425    
426            /**
427             * Returns the journal feed remote service.
428             *
429             * @return the journal feed remote service
430             */
431            public com.liferay.portlet.journal.service.JournalFeedService getJournalFeedService() {
432                    return journalFeedService;
433            }
434    
435            /**
436             * Sets the journal feed remote service.
437             *
438             * @param journalFeedService the journal feed remote service
439             */
440            public void setJournalFeedService(
441                    com.liferay.portlet.journal.service.JournalFeedService journalFeedService) {
442                    this.journalFeedService = journalFeedService;
443            }
444    
445            /**
446             * Returns the journal feed persistence.
447             *
448             * @return the journal feed persistence
449             */
450            public JournalFeedPersistence getJournalFeedPersistence() {
451                    return journalFeedPersistence;
452            }
453    
454            /**
455             * Sets the journal feed persistence.
456             *
457             * @param journalFeedPersistence the journal feed persistence
458             */
459            public void setJournalFeedPersistence(
460                    JournalFeedPersistence journalFeedPersistence) {
461                    this.journalFeedPersistence = journalFeedPersistence;
462            }
463    
464            /**
465             * Returns the journal feed finder.
466             *
467             * @return the journal feed finder
468             */
469            public JournalFeedFinder getJournalFeedFinder() {
470                    return journalFeedFinder;
471            }
472    
473            /**
474             * Sets the journal feed finder.
475             *
476             * @param journalFeedFinder the journal feed finder
477             */
478            public void setJournalFeedFinder(JournalFeedFinder journalFeedFinder) {
479                    this.journalFeedFinder = journalFeedFinder;
480            }
481    
482            /**
483             * Returns the counter local service.
484             *
485             * @return the counter local service
486             */
487            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
488                    return counterLocalService;
489            }
490    
491            /**
492             * Sets the counter local service.
493             *
494             * @param counterLocalService the counter local service
495             */
496            public void setCounterLocalService(
497                    com.liferay.counter.service.CounterLocalService counterLocalService) {
498                    this.counterLocalService = counterLocalService;
499            }
500    
501            /**
502             * Returns the class name local service.
503             *
504             * @return the class name local service
505             */
506            public com.liferay.portal.service.ClassNameLocalService getClassNameLocalService() {
507                    return classNameLocalService;
508            }
509    
510            /**
511             * Sets the class name local service.
512             *
513             * @param classNameLocalService the class name local service
514             */
515            public void setClassNameLocalService(
516                    com.liferay.portal.service.ClassNameLocalService classNameLocalService) {
517                    this.classNameLocalService = classNameLocalService;
518            }
519    
520            /**
521             * Returns the class name remote service.
522             *
523             * @return the class name remote service
524             */
525            public com.liferay.portal.service.ClassNameService getClassNameService() {
526                    return classNameService;
527            }
528    
529            /**
530             * Sets the class name remote service.
531             *
532             * @param classNameService the class name remote service
533             */
534            public void setClassNameService(
535                    com.liferay.portal.service.ClassNameService classNameService) {
536                    this.classNameService = classNameService;
537            }
538    
539            /**
540             * Returns the class name persistence.
541             *
542             * @return the class name persistence
543             */
544            public ClassNamePersistence getClassNamePersistence() {
545                    return classNamePersistence;
546            }
547    
548            /**
549             * Sets the class name persistence.
550             *
551             * @param classNamePersistence the class name persistence
552             */
553            public void setClassNamePersistence(
554                    ClassNamePersistence classNamePersistence) {
555                    this.classNamePersistence = classNamePersistence;
556            }
557    
558            /**
559             * Returns the resource local service.
560             *
561             * @return the resource local service
562             */
563            public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
564                    return resourceLocalService;
565            }
566    
567            /**
568             * Sets the resource local service.
569             *
570             * @param resourceLocalService the resource local service
571             */
572            public void setResourceLocalService(
573                    com.liferay.portal.service.ResourceLocalService resourceLocalService) {
574                    this.resourceLocalService = resourceLocalService;
575            }
576    
577            /**
578             * Returns the system event local service.
579             *
580             * @return the system event local service
581             */
582            public com.liferay.portal.service.SystemEventLocalService getSystemEventLocalService() {
583                    return systemEventLocalService;
584            }
585    
586            /**
587             * Sets the system event local service.
588             *
589             * @param systemEventLocalService the system event local service
590             */
591            public void setSystemEventLocalService(
592                    com.liferay.portal.service.SystemEventLocalService systemEventLocalService) {
593                    this.systemEventLocalService = systemEventLocalService;
594            }
595    
596            /**
597             * Returns the system event persistence.
598             *
599             * @return the system event persistence
600             */
601            public SystemEventPersistence getSystemEventPersistence() {
602                    return systemEventPersistence;
603            }
604    
605            /**
606             * Sets the system event persistence.
607             *
608             * @param systemEventPersistence the system event persistence
609             */
610            public void setSystemEventPersistence(
611                    SystemEventPersistence systemEventPersistence) {
612                    this.systemEventPersistence = systemEventPersistence;
613            }
614    
615            /**
616             * Returns the user local service.
617             *
618             * @return the user local service
619             */
620            public com.liferay.portal.service.UserLocalService getUserLocalService() {
621                    return userLocalService;
622            }
623    
624            /**
625             * Sets the user local service.
626             *
627             * @param userLocalService the user local service
628             */
629            public void setUserLocalService(
630                    com.liferay.portal.service.UserLocalService userLocalService) {
631                    this.userLocalService = userLocalService;
632            }
633    
634            /**
635             * Returns the user remote service.
636             *
637             * @return the user remote service
638             */
639            public com.liferay.portal.service.UserService getUserService() {
640                    return userService;
641            }
642    
643            /**
644             * Sets the user remote service.
645             *
646             * @param userService the user remote service
647             */
648            public void setUserService(
649                    com.liferay.portal.service.UserService userService) {
650                    this.userService = userService;
651            }
652    
653            /**
654             * Returns the user persistence.
655             *
656             * @return the user persistence
657             */
658            public UserPersistence getUserPersistence() {
659                    return userPersistence;
660            }
661    
662            /**
663             * Sets the user persistence.
664             *
665             * @param userPersistence the user persistence
666             */
667            public void setUserPersistence(UserPersistence userPersistence) {
668                    this.userPersistence = userPersistence;
669            }
670    
671            /**
672             * Returns the user finder.
673             *
674             * @return the user finder
675             */
676            public UserFinder getUserFinder() {
677                    return userFinder;
678            }
679    
680            /**
681             * Sets the user finder.
682             *
683             * @param userFinder the user finder
684             */
685            public void setUserFinder(UserFinder userFinder) {
686                    this.userFinder = userFinder;
687            }
688    
689            /**
690             * Returns the d d m structure local service.
691             *
692             * @return the d d m structure local service
693             */
694            public com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalService getDDMStructureLocalService() {
695                    return ddmStructureLocalService;
696            }
697    
698            /**
699             * Sets the d d m structure local service.
700             *
701             * @param ddmStructureLocalService the d d m structure local service
702             */
703            public void setDDMStructureLocalService(
704                    com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalService ddmStructureLocalService) {
705                    this.ddmStructureLocalService = ddmStructureLocalService;
706            }
707    
708            /**
709             * Returns the d d m structure remote service.
710             *
711             * @return the d d m structure remote service
712             */
713            public com.liferay.portlet.dynamicdatamapping.service.DDMStructureService getDDMStructureService() {
714                    return ddmStructureService;
715            }
716    
717            /**
718             * Sets the d d m structure remote service.
719             *
720             * @param ddmStructureService the d d m structure remote service
721             */
722            public void setDDMStructureService(
723                    com.liferay.portlet.dynamicdatamapping.service.DDMStructureService ddmStructureService) {
724                    this.ddmStructureService = ddmStructureService;
725            }
726    
727            /**
728             * Returns the d d m structure persistence.
729             *
730             * @return the d d m structure persistence
731             */
732            public DDMStructurePersistence getDDMStructurePersistence() {
733                    return ddmStructurePersistence;
734            }
735    
736            /**
737             * Sets the d d m structure persistence.
738             *
739             * @param ddmStructurePersistence the d d m structure persistence
740             */
741            public void setDDMStructurePersistence(
742                    DDMStructurePersistence ddmStructurePersistence) {
743                    this.ddmStructurePersistence = ddmStructurePersistence;
744            }
745    
746            /**
747             * Returns the d d m structure finder.
748             *
749             * @return the d d m structure finder
750             */
751            public DDMStructureFinder getDDMStructureFinder() {
752                    return ddmStructureFinder;
753            }
754    
755            /**
756             * Sets the d d m structure finder.
757             *
758             * @param ddmStructureFinder the d d m structure finder
759             */
760            public void setDDMStructureFinder(DDMStructureFinder ddmStructureFinder) {
761                    this.ddmStructureFinder = ddmStructureFinder;
762            }
763    
764            /**
765             * Returns the expando value local service.
766             *
767             * @return the expando value local service
768             */
769            public com.liferay.portlet.expando.service.ExpandoValueLocalService getExpandoValueLocalService() {
770                    return expandoValueLocalService;
771            }
772    
773            /**
774             * Sets the expando value local service.
775             *
776             * @param expandoValueLocalService the expando value local service
777             */
778            public void setExpandoValueLocalService(
779                    com.liferay.portlet.expando.service.ExpandoValueLocalService expandoValueLocalService) {
780                    this.expandoValueLocalService = expandoValueLocalService;
781            }
782    
783            /**
784             * Returns the expando value remote service.
785             *
786             * @return the expando value remote service
787             */
788            public com.liferay.portlet.expando.service.ExpandoValueService getExpandoValueService() {
789                    return expandoValueService;
790            }
791    
792            /**
793             * Sets the expando value remote service.
794             *
795             * @param expandoValueService the expando value remote service
796             */
797            public void setExpandoValueService(
798                    com.liferay.portlet.expando.service.ExpandoValueService expandoValueService) {
799                    this.expandoValueService = expandoValueService;
800            }
801    
802            /**
803             * Returns the expando value persistence.
804             *
805             * @return the expando value persistence
806             */
807            public ExpandoValuePersistence getExpandoValuePersistence() {
808                    return expandoValuePersistence;
809            }
810    
811            /**
812             * Sets the expando value persistence.
813             *
814             * @param expandoValuePersistence the expando value persistence
815             */
816            public void setExpandoValuePersistence(
817                    ExpandoValuePersistence expandoValuePersistence) {
818                    this.expandoValuePersistence = expandoValuePersistence;
819            }
820    
821            public void afterPropertiesSet() {
822                    persistedModelLocalServiceRegistry.register("com.liferay.portlet.journal.model.JournalFeed",
823                            journalFeedLocalService);
824            }
825    
826            public void destroy() {
827                    persistedModelLocalServiceRegistry.unregister(
828                            "com.liferay.portlet.journal.model.JournalFeed");
829            }
830    
831            /**
832             * Returns the Spring bean ID for this bean.
833             *
834             * @return the Spring bean ID for this bean
835             */
836            @Override
837            public String getBeanIdentifier() {
838                    return _beanIdentifier;
839            }
840    
841            /**
842             * Sets the Spring bean ID for this bean.
843             *
844             * @param beanIdentifier the Spring bean ID for this bean
845             */
846            @Override
847            public void setBeanIdentifier(String beanIdentifier) {
848                    _beanIdentifier = beanIdentifier;
849            }
850    
851            protected Class<?> getModelClass() {
852                    return JournalFeed.class;
853            }
854    
855            protected String getModelClassName() {
856                    return JournalFeed.class.getName();
857            }
858    
859            /**
860             * Performs a SQL query.
861             *
862             * @param sql the sql query
863             */
864            protected void runSQL(String sql) {
865                    try {
866                            DataSource dataSource = journalFeedPersistence.getDataSource();
867    
868                            DB db = DBFactoryUtil.getDB();
869    
870                            sql = db.buildSQL(sql);
871                            sql = PortalUtil.transformSQL(sql);
872    
873                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
874                                            sql, new int[0]);
875    
876                            sqlUpdate.update();
877                    }
878                    catch (Exception e) {
879                            throw new SystemException(e);
880                    }
881            }
882    
883            @BeanReference(type = com.liferay.portlet.journal.service.JournalFeedLocalService.class)
884            protected com.liferay.portlet.journal.service.JournalFeedLocalService journalFeedLocalService;
885            @BeanReference(type = com.liferay.portlet.journal.service.JournalFeedService.class)
886            protected com.liferay.portlet.journal.service.JournalFeedService journalFeedService;
887            @BeanReference(type = JournalFeedPersistence.class)
888            protected JournalFeedPersistence journalFeedPersistence;
889            @BeanReference(type = JournalFeedFinder.class)
890            protected JournalFeedFinder journalFeedFinder;
891            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
892            protected com.liferay.counter.service.CounterLocalService counterLocalService;
893            @BeanReference(type = com.liferay.portal.service.ClassNameLocalService.class)
894            protected com.liferay.portal.service.ClassNameLocalService classNameLocalService;
895            @BeanReference(type = com.liferay.portal.service.ClassNameService.class)
896            protected com.liferay.portal.service.ClassNameService classNameService;
897            @BeanReference(type = ClassNamePersistence.class)
898            protected ClassNamePersistence classNamePersistence;
899            @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
900            protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
901            @BeanReference(type = com.liferay.portal.service.SystemEventLocalService.class)
902            protected com.liferay.portal.service.SystemEventLocalService systemEventLocalService;
903            @BeanReference(type = SystemEventPersistence.class)
904            protected SystemEventPersistence systemEventPersistence;
905            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
906            protected com.liferay.portal.service.UserLocalService userLocalService;
907            @BeanReference(type = com.liferay.portal.service.UserService.class)
908            protected com.liferay.portal.service.UserService userService;
909            @BeanReference(type = UserPersistence.class)
910            protected UserPersistence userPersistence;
911            @BeanReference(type = UserFinder.class)
912            protected UserFinder userFinder;
913            @BeanReference(type = com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalService.class)
914            protected com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalService ddmStructureLocalService;
915            @BeanReference(type = com.liferay.portlet.dynamicdatamapping.service.DDMStructureService.class)
916            protected com.liferay.portlet.dynamicdatamapping.service.DDMStructureService ddmStructureService;
917            @BeanReference(type = DDMStructurePersistence.class)
918            protected DDMStructurePersistence ddmStructurePersistence;
919            @BeanReference(type = DDMStructureFinder.class)
920            protected DDMStructureFinder ddmStructureFinder;
921            @BeanReference(type = com.liferay.portlet.expando.service.ExpandoValueLocalService.class)
922            protected com.liferay.portlet.expando.service.ExpandoValueLocalService expandoValueLocalService;
923            @BeanReference(type = com.liferay.portlet.expando.service.ExpandoValueService.class)
924            protected com.liferay.portlet.expando.service.ExpandoValueService expandoValueService;
925            @BeanReference(type = ExpandoValuePersistence.class)
926            protected ExpandoValuePersistence expandoValuePersistence;
927            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
928            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
929            private String _beanIdentifier;
930    }