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.portal.service.base;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.BeanReference;
020    import com.liferay.portal.kernel.dao.db.DB;
021    import com.liferay.portal.kernel.dao.db.DBManagerUtil;
022    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
023    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
024    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
025    import com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery;
026    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
027    import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
028    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
029    import com.liferay.portal.kernel.dao.orm.Projection;
030    import com.liferay.portal.kernel.exception.PortalException;
031    import com.liferay.portal.kernel.exception.SystemException;
032    import com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService;
033    import com.liferay.portal.kernel.search.Indexable;
034    import com.liferay.portal.kernel.search.IndexableType;
035    import com.liferay.portal.kernel.util.OrderByComparator;
036    import com.liferay.portal.model.LayoutRevision;
037    import com.liferay.portal.model.PersistedModel;
038    import com.liferay.portal.service.BaseLocalServiceImpl;
039    import com.liferay.portal.service.LayoutRevisionLocalService;
040    import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
041    import com.liferay.portal.service.persistence.ImagePersistence;
042    import com.liferay.portal.service.persistence.LayoutBranchPersistence;
043    import com.liferay.portal.service.persistence.LayoutFinder;
044    import com.liferay.portal.service.persistence.LayoutPersistence;
045    import com.liferay.portal.service.persistence.LayoutRevisionPersistence;
046    import com.liferay.portal.service.persistence.LayoutSetBranchPersistence;
047    import com.liferay.portal.service.persistence.LayoutSetPersistence;
048    import com.liferay.portal.service.persistence.PortletPreferencesFinder;
049    import com.liferay.portal.service.persistence.PortletPreferencesPersistence;
050    import com.liferay.portal.service.persistence.RecentLayoutRevisionPersistence;
051    import com.liferay.portal.service.persistence.UserFinder;
052    import com.liferay.portal.service.persistence.UserPersistence;
053    import com.liferay.portal.service.persistence.WorkflowInstanceLinkPersistence;
054    import com.liferay.portal.util.PortalUtil;
055    
056    import java.io.Serializable;
057    
058    import java.util.List;
059    
060    import javax.sql.DataSource;
061    
062    /**
063     * Provides the base implementation for the layout revision local service.
064     *
065     * <p>
066     * 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.portal.service.impl.LayoutRevisionLocalServiceImpl}.
067     * </p>
068     *
069     * @author Brian Wing Shun Chan
070     * @see com.liferay.portal.service.impl.LayoutRevisionLocalServiceImpl
071     * @see com.liferay.portal.service.LayoutRevisionLocalServiceUtil
072     * @generated
073     */
074    @ProviderType
075    public abstract class LayoutRevisionLocalServiceBaseImpl
076            extends BaseLocalServiceImpl implements LayoutRevisionLocalService,
077                    IdentifiableOSGiService {
078            /*
079             * NOTE FOR DEVELOPERS:
080             *
081             * Never modify or reference this class directly. Always use {@link com.liferay.portal.service.LayoutRevisionLocalServiceUtil} to access the layout revision local service.
082             */
083    
084            /**
085             * Adds the layout revision to the database. Also notifies the appropriate model listeners.
086             *
087             * @param layoutRevision the layout revision
088             * @return the layout revision that was added
089             */
090            @Indexable(type = IndexableType.REINDEX)
091            @Override
092            public LayoutRevision addLayoutRevision(LayoutRevision layoutRevision) {
093                    layoutRevision.setNew(true);
094    
095                    return layoutRevisionPersistence.update(layoutRevision);
096            }
097    
098            /**
099             * Creates a new layout revision with the primary key. Does not add the layout revision to the database.
100             *
101             * @param layoutRevisionId the primary key for the new layout revision
102             * @return the new layout revision
103             */
104            @Override
105            public LayoutRevision createLayoutRevision(long layoutRevisionId) {
106                    return layoutRevisionPersistence.create(layoutRevisionId);
107            }
108    
109            /**
110             * Deletes the layout revision with the primary key from the database. Also notifies the appropriate model listeners.
111             *
112             * @param layoutRevisionId the primary key of the layout revision
113             * @return the layout revision that was removed
114             * @throws PortalException if a layout revision with the primary key could not be found
115             */
116            @Indexable(type = IndexableType.DELETE)
117            @Override
118            public LayoutRevision deleteLayoutRevision(long layoutRevisionId)
119                    throws PortalException {
120                    return layoutRevisionPersistence.remove(layoutRevisionId);
121            }
122    
123            /**
124             * Deletes the layout revision from the database. Also notifies the appropriate model listeners.
125             *
126             * @param layoutRevision the layout revision
127             * @return the layout revision that was removed
128             * @throws PortalException
129             */
130            @Indexable(type = IndexableType.DELETE)
131            @Override
132            public LayoutRevision deleteLayoutRevision(LayoutRevision layoutRevision)
133                    throws PortalException {
134                    return layoutRevisionPersistence.remove(layoutRevision);
135            }
136    
137            @Override
138            public DynamicQuery dynamicQuery() {
139                    Class<?> clazz = getClass();
140    
141                    return DynamicQueryFactoryUtil.forClass(LayoutRevision.class,
142                            clazz.getClassLoader());
143            }
144    
145            /**
146             * Performs a dynamic query on the database and returns the matching rows.
147             *
148             * @param dynamicQuery the dynamic query
149             * @return the matching rows
150             */
151            @Override
152            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
153                    return layoutRevisionPersistence.findWithDynamicQuery(dynamicQuery);
154            }
155    
156            /**
157             * Performs a dynamic query on the database and returns a range of the matching rows.
158             *
159             * <p>
160             * 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.portal.model.impl.LayoutRevisionModelImpl}. 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.
161             * </p>
162             *
163             * @param dynamicQuery the dynamic query
164             * @param start the lower bound of the range of model instances
165             * @param end the upper bound of the range of model instances (not inclusive)
166             * @return the range of matching rows
167             */
168            @Override
169            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
170                    int end) {
171                    return layoutRevisionPersistence.findWithDynamicQuery(dynamicQuery,
172                            start, end);
173            }
174    
175            /**
176             * Performs a dynamic query on the database and returns an ordered range of the matching rows.
177             *
178             * <p>
179             * 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.portal.model.impl.LayoutRevisionModelImpl}. 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.
180             * </p>
181             *
182             * @param dynamicQuery the dynamic query
183             * @param start the lower bound of the range of model instances
184             * @param end the upper bound of the range of model instances (not inclusive)
185             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
186             * @return the ordered range of matching rows
187             */
188            @Override
189            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
190                    int end, OrderByComparator<T> orderByComparator) {
191                    return layoutRevisionPersistence.findWithDynamicQuery(dynamicQuery,
192                            start, end, orderByComparator);
193            }
194    
195            /**
196             * Returns the number of rows matching the dynamic query.
197             *
198             * @param dynamicQuery the dynamic query
199             * @return the number of rows matching the dynamic query
200             */
201            @Override
202            public long dynamicQueryCount(DynamicQuery dynamicQuery) {
203                    return layoutRevisionPersistence.countWithDynamicQuery(dynamicQuery);
204            }
205    
206            /**
207             * Returns the number of rows matching the dynamic query.
208             *
209             * @param dynamicQuery the dynamic query
210             * @param projection the projection to apply to the query
211             * @return the number of rows matching the dynamic query
212             */
213            @Override
214            public long dynamicQueryCount(DynamicQuery dynamicQuery,
215                    Projection projection) {
216                    return layoutRevisionPersistence.countWithDynamicQuery(dynamicQuery,
217                            projection);
218            }
219    
220            @Override
221            public LayoutRevision fetchLayoutRevision(long layoutRevisionId) {
222                    return layoutRevisionPersistence.fetchByPrimaryKey(layoutRevisionId);
223            }
224    
225            /**
226             * Returns the layout revision with the primary key.
227             *
228             * @param layoutRevisionId the primary key of the layout revision
229             * @return the layout revision
230             * @throws PortalException if a layout revision with the primary key could not be found
231             */
232            @Override
233            public LayoutRevision getLayoutRevision(long layoutRevisionId)
234                    throws PortalException {
235                    return layoutRevisionPersistence.findByPrimaryKey(layoutRevisionId);
236            }
237    
238            @Override
239            public ActionableDynamicQuery getActionableDynamicQuery() {
240                    ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
241    
242                    actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.LayoutRevisionLocalServiceUtil.getService());
243                    actionableDynamicQuery.setClassLoader(getClassLoader());
244                    actionableDynamicQuery.setModelClass(LayoutRevision.class);
245    
246                    actionableDynamicQuery.setPrimaryKeyPropertyName("layoutRevisionId");
247    
248                    return actionableDynamicQuery;
249            }
250    
251            @Override
252            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
253                    IndexableActionableDynamicQuery indexableActionableDynamicQuery = new IndexableActionableDynamicQuery();
254    
255                    indexableActionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.LayoutRevisionLocalServiceUtil.getService());
256                    indexableActionableDynamicQuery.setClassLoader(getClassLoader());
257                    indexableActionableDynamicQuery.setModelClass(LayoutRevision.class);
258    
259                    indexableActionableDynamicQuery.setPrimaryKeyPropertyName(
260                            "layoutRevisionId");
261    
262                    return indexableActionableDynamicQuery;
263            }
264    
265            protected void initActionableDynamicQuery(
266                    ActionableDynamicQuery actionableDynamicQuery) {
267                    actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.LayoutRevisionLocalServiceUtil.getService());
268                    actionableDynamicQuery.setClassLoader(getClassLoader());
269                    actionableDynamicQuery.setModelClass(LayoutRevision.class);
270    
271                    actionableDynamicQuery.setPrimaryKeyPropertyName("layoutRevisionId");
272            }
273    
274            /**
275             * @throws PortalException
276             */
277            @Override
278            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
279                    throws PortalException {
280                    return layoutRevisionLocalService.deleteLayoutRevision((LayoutRevision)persistedModel);
281            }
282    
283            @Override
284            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
285                    throws PortalException {
286                    return layoutRevisionPersistence.findByPrimaryKey(primaryKeyObj);
287            }
288    
289            /**
290             * Returns a range of all the layout revisions.
291             *
292             * <p>
293             * 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.portal.model.impl.LayoutRevisionModelImpl}. 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.
294             * </p>
295             *
296             * @param start the lower bound of the range of layout revisions
297             * @param end the upper bound of the range of layout revisions (not inclusive)
298             * @return the range of layout revisions
299             */
300            @Override
301            public List<LayoutRevision> getLayoutRevisions(int start, int end) {
302                    return layoutRevisionPersistence.findAll(start, end);
303            }
304    
305            /**
306             * Returns the number of layout revisions.
307             *
308             * @return the number of layout revisions
309             */
310            @Override
311            public int getLayoutRevisionsCount() {
312                    return layoutRevisionPersistence.countAll();
313            }
314    
315            /**
316             * Updates the layout revision in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
317             *
318             * @param layoutRevision the layout revision
319             * @return the layout revision that was updated
320             */
321            @Indexable(type = IndexableType.REINDEX)
322            @Override
323            public LayoutRevision updateLayoutRevision(LayoutRevision layoutRevision) {
324                    return layoutRevisionPersistence.update(layoutRevision);
325            }
326    
327            /**
328             * Returns the layout revision local service.
329             *
330             * @return the layout revision local service
331             */
332            public LayoutRevisionLocalService getLayoutRevisionLocalService() {
333                    return layoutRevisionLocalService;
334            }
335    
336            /**
337             * Sets the layout revision local service.
338             *
339             * @param layoutRevisionLocalService the layout revision local service
340             */
341            public void setLayoutRevisionLocalService(
342                    LayoutRevisionLocalService layoutRevisionLocalService) {
343                    this.layoutRevisionLocalService = layoutRevisionLocalService;
344            }
345    
346            /**
347             * Returns the layout revision persistence.
348             *
349             * @return the layout revision persistence
350             */
351            public LayoutRevisionPersistence getLayoutRevisionPersistence() {
352                    return layoutRevisionPersistence;
353            }
354    
355            /**
356             * Sets the layout revision persistence.
357             *
358             * @param layoutRevisionPersistence the layout revision persistence
359             */
360            public void setLayoutRevisionPersistence(
361                    LayoutRevisionPersistence layoutRevisionPersistence) {
362                    this.layoutRevisionPersistence = layoutRevisionPersistence;
363            }
364    
365            /**
366             * Returns the counter local service.
367             *
368             * @return the counter local service
369             */
370            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
371                    return counterLocalService;
372            }
373    
374            /**
375             * Sets the counter local service.
376             *
377             * @param counterLocalService the counter local service
378             */
379            public void setCounterLocalService(
380                    com.liferay.counter.service.CounterLocalService counterLocalService) {
381                    this.counterLocalService = counterLocalService;
382            }
383    
384            /**
385             * Returns the image local service.
386             *
387             * @return the image local service
388             */
389            public com.liferay.portal.service.ImageLocalService getImageLocalService() {
390                    return imageLocalService;
391            }
392    
393            /**
394             * Sets the image local service.
395             *
396             * @param imageLocalService the image local service
397             */
398            public void setImageLocalService(
399                    com.liferay.portal.service.ImageLocalService imageLocalService) {
400                    this.imageLocalService = imageLocalService;
401            }
402    
403            /**
404             * Returns the image persistence.
405             *
406             * @return the image persistence
407             */
408            public ImagePersistence getImagePersistence() {
409                    return imagePersistence;
410            }
411    
412            /**
413             * Sets the image persistence.
414             *
415             * @param imagePersistence the image persistence
416             */
417            public void setImagePersistence(ImagePersistence imagePersistence) {
418                    this.imagePersistence = imagePersistence;
419            }
420    
421            /**
422             * Returns the layout local service.
423             *
424             * @return the layout local service
425             */
426            public com.liferay.portal.service.LayoutLocalService getLayoutLocalService() {
427                    return layoutLocalService;
428            }
429    
430            /**
431             * Sets the layout local service.
432             *
433             * @param layoutLocalService the layout local service
434             */
435            public void setLayoutLocalService(
436                    com.liferay.portal.service.LayoutLocalService layoutLocalService) {
437                    this.layoutLocalService = layoutLocalService;
438            }
439    
440            /**
441             * Returns the layout persistence.
442             *
443             * @return the layout persistence
444             */
445            public LayoutPersistence getLayoutPersistence() {
446                    return layoutPersistence;
447            }
448    
449            /**
450             * Sets the layout persistence.
451             *
452             * @param layoutPersistence the layout persistence
453             */
454            public void setLayoutPersistence(LayoutPersistence layoutPersistence) {
455                    this.layoutPersistence = layoutPersistence;
456            }
457    
458            /**
459             * Returns the layout finder.
460             *
461             * @return the layout finder
462             */
463            public LayoutFinder getLayoutFinder() {
464                    return layoutFinder;
465            }
466    
467            /**
468             * Sets the layout finder.
469             *
470             * @param layoutFinder the layout finder
471             */
472            public void setLayoutFinder(LayoutFinder layoutFinder) {
473                    this.layoutFinder = layoutFinder;
474            }
475    
476            /**
477             * Returns the layout branch local service.
478             *
479             * @return the layout branch local service
480             */
481            public com.liferay.portal.service.LayoutBranchLocalService getLayoutBranchLocalService() {
482                    return layoutBranchLocalService;
483            }
484    
485            /**
486             * Sets the layout branch local service.
487             *
488             * @param layoutBranchLocalService the layout branch local service
489             */
490            public void setLayoutBranchLocalService(
491                    com.liferay.portal.service.LayoutBranchLocalService layoutBranchLocalService) {
492                    this.layoutBranchLocalService = layoutBranchLocalService;
493            }
494    
495            /**
496             * Returns the layout branch persistence.
497             *
498             * @return the layout branch persistence
499             */
500            public LayoutBranchPersistence getLayoutBranchPersistence() {
501                    return layoutBranchPersistence;
502            }
503    
504            /**
505             * Sets the layout branch persistence.
506             *
507             * @param layoutBranchPersistence the layout branch persistence
508             */
509            public void setLayoutBranchPersistence(
510                    LayoutBranchPersistence layoutBranchPersistence) {
511                    this.layoutBranchPersistence = layoutBranchPersistence;
512            }
513    
514            /**
515             * Returns the layout set local service.
516             *
517             * @return the layout set local service
518             */
519            public com.liferay.portal.service.LayoutSetLocalService getLayoutSetLocalService() {
520                    return layoutSetLocalService;
521            }
522    
523            /**
524             * Sets the layout set local service.
525             *
526             * @param layoutSetLocalService the layout set local service
527             */
528            public void setLayoutSetLocalService(
529                    com.liferay.portal.service.LayoutSetLocalService layoutSetLocalService) {
530                    this.layoutSetLocalService = layoutSetLocalService;
531            }
532    
533            /**
534             * Returns the layout set persistence.
535             *
536             * @return the layout set persistence
537             */
538            public LayoutSetPersistence getLayoutSetPersistence() {
539                    return layoutSetPersistence;
540            }
541    
542            /**
543             * Sets the layout set persistence.
544             *
545             * @param layoutSetPersistence the layout set persistence
546             */
547            public void setLayoutSetPersistence(
548                    LayoutSetPersistence layoutSetPersistence) {
549                    this.layoutSetPersistence = layoutSetPersistence;
550            }
551    
552            /**
553             * Returns the layout set branch local service.
554             *
555             * @return the layout set branch local service
556             */
557            public com.liferay.portal.service.LayoutSetBranchLocalService getLayoutSetBranchLocalService() {
558                    return layoutSetBranchLocalService;
559            }
560    
561            /**
562             * Sets the layout set branch local service.
563             *
564             * @param layoutSetBranchLocalService the layout set branch local service
565             */
566            public void setLayoutSetBranchLocalService(
567                    com.liferay.portal.service.LayoutSetBranchLocalService layoutSetBranchLocalService) {
568                    this.layoutSetBranchLocalService = layoutSetBranchLocalService;
569            }
570    
571            /**
572             * Returns the layout set branch persistence.
573             *
574             * @return the layout set branch persistence
575             */
576            public LayoutSetBranchPersistence getLayoutSetBranchPersistence() {
577                    return layoutSetBranchPersistence;
578            }
579    
580            /**
581             * Sets the layout set branch persistence.
582             *
583             * @param layoutSetBranchPersistence the layout set branch persistence
584             */
585            public void setLayoutSetBranchPersistence(
586                    LayoutSetBranchPersistence layoutSetBranchPersistence) {
587                    this.layoutSetBranchPersistence = layoutSetBranchPersistence;
588            }
589    
590            /**
591             * Returns the portlet preferences local service.
592             *
593             * @return the portlet preferences local service
594             */
595            public com.liferay.portal.service.PortletPreferencesLocalService getPortletPreferencesLocalService() {
596                    return portletPreferencesLocalService;
597            }
598    
599            /**
600             * Sets the portlet preferences local service.
601             *
602             * @param portletPreferencesLocalService the portlet preferences local service
603             */
604            public void setPortletPreferencesLocalService(
605                    com.liferay.portal.service.PortletPreferencesLocalService portletPreferencesLocalService) {
606                    this.portletPreferencesLocalService = portletPreferencesLocalService;
607            }
608    
609            /**
610             * Returns the portlet preferences persistence.
611             *
612             * @return the portlet preferences persistence
613             */
614            public PortletPreferencesPersistence getPortletPreferencesPersistence() {
615                    return portletPreferencesPersistence;
616            }
617    
618            /**
619             * Sets the portlet preferences persistence.
620             *
621             * @param portletPreferencesPersistence the portlet preferences persistence
622             */
623            public void setPortletPreferencesPersistence(
624                    PortletPreferencesPersistence portletPreferencesPersistence) {
625                    this.portletPreferencesPersistence = portletPreferencesPersistence;
626            }
627    
628            /**
629             * Returns the portlet preferences finder.
630             *
631             * @return the portlet preferences finder
632             */
633            public PortletPreferencesFinder getPortletPreferencesFinder() {
634                    return portletPreferencesFinder;
635            }
636    
637            /**
638             * Sets the portlet preferences finder.
639             *
640             * @param portletPreferencesFinder the portlet preferences finder
641             */
642            public void setPortletPreferencesFinder(
643                    PortletPreferencesFinder portletPreferencesFinder) {
644                    this.portletPreferencesFinder = portletPreferencesFinder;
645            }
646    
647            /**
648             * Returns the recent layout revision local service.
649             *
650             * @return the recent layout revision local service
651             */
652            public com.liferay.portal.service.RecentLayoutRevisionLocalService getRecentLayoutRevisionLocalService() {
653                    return recentLayoutRevisionLocalService;
654            }
655    
656            /**
657             * Sets the recent layout revision local service.
658             *
659             * @param recentLayoutRevisionLocalService the recent layout revision local service
660             */
661            public void setRecentLayoutRevisionLocalService(
662                    com.liferay.portal.service.RecentLayoutRevisionLocalService recentLayoutRevisionLocalService) {
663                    this.recentLayoutRevisionLocalService = recentLayoutRevisionLocalService;
664            }
665    
666            /**
667             * Returns the recent layout revision persistence.
668             *
669             * @return the recent layout revision persistence
670             */
671            public RecentLayoutRevisionPersistence getRecentLayoutRevisionPersistence() {
672                    return recentLayoutRevisionPersistence;
673            }
674    
675            /**
676             * Sets the recent layout revision persistence.
677             *
678             * @param recentLayoutRevisionPersistence the recent layout revision persistence
679             */
680            public void setRecentLayoutRevisionPersistence(
681                    RecentLayoutRevisionPersistence recentLayoutRevisionPersistence) {
682                    this.recentLayoutRevisionPersistence = recentLayoutRevisionPersistence;
683            }
684    
685            /**
686             * Returns the resource local service.
687             *
688             * @return the resource local service
689             */
690            public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
691                    return resourceLocalService;
692            }
693    
694            /**
695             * Sets the resource local service.
696             *
697             * @param resourceLocalService the resource local service
698             */
699            public void setResourceLocalService(
700                    com.liferay.portal.service.ResourceLocalService resourceLocalService) {
701                    this.resourceLocalService = resourceLocalService;
702            }
703    
704            /**
705             * Returns the user local service.
706             *
707             * @return the user local service
708             */
709            public com.liferay.portal.service.UserLocalService getUserLocalService() {
710                    return userLocalService;
711            }
712    
713            /**
714             * Sets the user local service.
715             *
716             * @param userLocalService the user local service
717             */
718            public void setUserLocalService(
719                    com.liferay.portal.service.UserLocalService userLocalService) {
720                    this.userLocalService = userLocalService;
721            }
722    
723            /**
724             * Returns the user persistence.
725             *
726             * @return the user persistence
727             */
728            public UserPersistence getUserPersistence() {
729                    return userPersistence;
730            }
731    
732            /**
733             * Sets the user persistence.
734             *
735             * @param userPersistence the user persistence
736             */
737            public void setUserPersistence(UserPersistence userPersistence) {
738                    this.userPersistence = userPersistence;
739            }
740    
741            /**
742             * Returns the user finder.
743             *
744             * @return the user finder
745             */
746            public UserFinder getUserFinder() {
747                    return userFinder;
748            }
749    
750            /**
751             * Sets the user finder.
752             *
753             * @param userFinder the user finder
754             */
755            public void setUserFinder(UserFinder userFinder) {
756                    this.userFinder = userFinder;
757            }
758    
759            /**
760             * Returns the workflow instance link local service.
761             *
762             * @return the workflow instance link local service
763             */
764            public com.liferay.portal.service.WorkflowInstanceLinkLocalService getWorkflowInstanceLinkLocalService() {
765                    return workflowInstanceLinkLocalService;
766            }
767    
768            /**
769             * Sets the workflow instance link local service.
770             *
771             * @param workflowInstanceLinkLocalService the workflow instance link local service
772             */
773            public void setWorkflowInstanceLinkLocalService(
774                    com.liferay.portal.service.WorkflowInstanceLinkLocalService workflowInstanceLinkLocalService) {
775                    this.workflowInstanceLinkLocalService = workflowInstanceLinkLocalService;
776            }
777    
778            /**
779             * Returns the workflow instance link persistence.
780             *
781             * @return the workflow instance link persistence
782             */
783            public WorkflowInstanceLinkPersistence getWorkflowInstanceLinkPersistence() {
784                    return workflowInstanceLinkPersistence;
785            }
786    
787            /**
788             * Sets the workflow instance link persistence.
789             *
790             * @param workflowInstanceLinkPersistence the workflow instance link persistence
791             */
792            public void setWorkflowInstanceLinkPersistence(
793                    WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence) {
794                    this.workflowInstanceLinkPersistence = workflowInstanceLinkPersistence;
795            }
796    
797            public void afterPropertiesSet() {
798                    persistedModelLocalServiceRegistry.register("com.liferay.portal.model.LayoutRevision",
799                            layoutRevisionLocalService);
800            }
801    
802            public void destroy() {
803                    persistedModelLocalServiceRegistry.unregister(
804                            "com.liferay.portal.model.LayoutRevision");
805            }
806    
807            /**
808             * Returns the OSGi service identifier.
809             *
810             * @return the OSGi service identifier
811             */
812            @Override
813            public String getOSGiServiceIdentifier() {
814                    return LayoutRevisionLocalService.class.getName();
815            }
816    
817            protected Class<?> getModelClass() {
818                    return LayoutRevision.class;
819            }
820    
821            protected String getModelClassName() {
822                    return LayoutRevision.class.getName();
823            }
824    
825            /**
826             * Performs a SQL query.
827             *
828             * @param sql the sql query
829             */
830            protected void runSQL(String sql) {
831                    try {
832                            DataSource dataSource = layoutRevisionPersistence.getDataSource();
833    
834                            DB db = DBManagerUtil.getDB();
835    
836                            sql = db.buildSQL(sql);
837                            sql = PortalUtil.transformSQL(sql);
838    
839                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
840                                            sql, new int[0]);
841    
842                            sqlUpdate.update();
843                    }
844                    catch (Exception e) {
845                            throw new SystemException(e);
846                    }
847            }
848    
849            @BeanReference(type = com.liferay.portal.service.LayoutRevisionLocalService.class)
850            protected LayoutRevisionLocalService layoutRevisionLocalService;
851            @BeanReference(type = LayoutRevisionPersistence.class)
852            protected LayoutRevisionPersistence layoutRevisionPersistence;
853            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
854            protected com.liferay.counter.service.CounterLocalService counterLocalService;
855            @BeanReference(type = com.liferay.portal.service.ImageLocalService.class)
856            protected com.liferay.portal.service.ImageLocalService imageLocalService;
857            @BeanReference(type = ImagePersistence.class)
858            protected ImagePersistence imagePersistence;
859            @BeanReference(type = com.liferay.portal.service.LayoutLocalService.class)
860            protected com.liferay.portal.service.LayoutLocalService layoutLocalService;
861            @BeanReference(type = LayoutPersistence.class)
862            protected LayoutPersistence layoutPersistence;
863            @BeanReference(type = LayoutFinder.class)
864            protected LayoutFinder layoutFinder;
865            @BeanReference(type = com.liferay.portal.service.LayoutBranchLocalService.class)
866            protected com.liferay.portal.service.LayoutBranchLocalService layoutBranchLocalService;
867            @BeanReference(type = LayoutBranchPersistence.class)
868            protected LayoutBranchPersistence layoutBranchPersistence;
869            @BeanReference(type = com.liferay.portal.service.LayoutSetLocalService.class)
870            protected com.liferay.portal.service.LayoutSetLocalService layoutSetLocalService;
871            @BeanReference(type = LayoutSetPersistence.class)
872            protected LayoutSetPersistence layoutSetPersistence;
873            @BeanReference(type = com.liferay.portal.service.LayoutSetBranchLocalService.class)
874            protected com.liferay.portal.service.LayoutSetBranchLocalService layoutSetBranchLocalService;
875            @BeanReference(type = LayoutSetBranchPersistence.class)
876            protected LayoutSetBranchPersistence layoutSetBranchPersistence;
877            @BeanReference(type = com.liferay.portal.service.PortletPreferencesLocalService.class)
878            protected com.liferay.portal.service.PortletPreferencesLocalService portletPreferencesLocalService;
879            @BeanReference(type = PortletPreferencesPersistence.class)
880            protected PortletPreferencesPersistence portletPreferencesPersistence;
881            @BeanReference(type = PortletPreferencesFinder.class)
882            protected PortletPreferencesFinder portletPreferencesFinder;
883            @BeanReference(type = com.liferay.portal.service.RecentLayoutRevisionLocalService.class)
884            protected com.liferay.portal.service.RecentLayoutRevisionLocalService recentLayoutRevisionLocalService;
885            @BeanReference(type = RecentLayoutRevisionPersistence.class)
886            protected RecentLayoutRevisionPersistence recentLayoutRevisionPersistence;
887            @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
888            protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
889            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
890            protected com.liferay.portal.service.UserLocalService userLocalService;
891            @BeanReference(type = UserPersistence.class)
892            protected UserPersistence userPersistence;
893            @BeanReference(type = UserFinder.class)
894            protected UserFinder userFinder;
895            @BeanReference(type = com.liferay.portal.service.WorkflowInstanceLinkLocalService.class)
896            protected com.liferay.portal.service.WorkflowInstanceLinkLocalService workflowInstanceLinkLocalService;
897            @BeanReference(type = WorkflowInstanceLinkPersistence.class)
898            protected WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence;
899            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
900            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
901    }