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