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