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