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,
290                                                    modelAdditionCount);
291    
292                                            long modelDeletionCount = ExportImportHelperUtil.getModelDeletionCount(portletDataContext,
293                                                            stagedModelType);
294    
295                                            manifestSummary.addModelDeletionCount(stagedModelType,
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<LayoutSetPrototype>() {
315                                    @Override
316                                    public void performAction(LayoutSetPrototype layoutSetPrototype)
317                                            throws PortalException {
318                                            StagedModelDataHandlerUtil.exportStagedModel(portletDataContext,
319                                                    layoutSetPrototype);
320                                    }
321                            });
322                    exportActionableDynamicQuery.setStagedModelType(new StagedModelType(
323                                    PortalUtil.getClassNameId(LayoutSetPrototype.class.getName())));
324    
325                    return exportActionableDynamicQuery;
326            }
327    
328            /**
329             * @throws PortalException
330             */
331            @Override
332            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
333                    throws PortalException {
334                    return layoutSetPrototypeLocalService.deleteLayoutSetPrototype((LayoutSetPrototype)persistedModel);
335            }
336    
337            @Override
338            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
339                    throws PortalException {
340                    return layoutSetPrototypePersistence.findByPrimaryKey(primaryKeyObj);
341            }
342    
343            /**
344             * Returns the layout set prototype with the matching UUID and company.
345             *
346             * @param uuid the layout set prototype's UUID
347             * @param companyId the primary key of the company
348             * @return the matching layout set prototype
349             * @throws PortalException if a matching layout set prototype could not be found
350             */
351            @Override
352            public LayoutSetPrototype getLayoutSetPrototypeByUuidAndCompanyId(
353                    String uuid, long companyId) throws PortalException {
354                    return layoutSetPrototypePersistence.findByUuid_C_First(uuid,
355                            companyId, null);
356            }
357    
358            /**
359             * Returns a range of all the layout set prototypes.
360             *
361             * <p>
362             * 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.
363             * </p>
364             *
365             * @param start the lower bound of the range of layout set prototypes
366             * @param end the upper bound of the range of layout set prototypes (not inclusive)
367             * @return the range of layout set prototypes
368             */
369            @Override
370            public List<LayoutSetPrototype> getLayoutSetPrototypes(int start, int end) {
371                    return layoutSetPrototypePersistence.findAll(start, end);
372            }
373    
374            /**
375             * Returns the number of layout set prototypes.
376             *
377             * @return the number of layout set prototypes
378             */
379            @Override
380            public int getLayoutSetPrototypesCount() {
381                    return layoutSetPrototypePersistence.countAll();
382            }
383    
384            /**
385             * Updates the layout set prototype in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
386             *
387             * @param layoutSetPrototype the layout set prototype
388             * @return the layout set prototype that was updated
389             */
390            @Indexable(type = IndexableType.REINDEX)
391            @Override
392            public LayoutSetPrototype updateLayoutSetPrototype(
393                    LayoutSetPrototype layoutSetPrototype) {
394                    return layoutSetPrototypePersistence.update(layoutSetPrototype);
395            }
396    
397            /**
398             * Returns the layout set prototype local service.
399             *
400             * @return the layout set prototype local service
401             */
402            public LayoutSetPrototypeLocalService getLayoutSetPrototypeLocalService() {
403                    return layoutSetPrototypeLocalService;
404            }
405    
406            /**
407             * Sets the layout set prototype local service.
408             *
409             * @param layoutSetPrototypeLocalService the layout set prototype local service
410             */
411            public void setLayoutSetPrototypeLocalService(
412                    LayoutSetPrototypeLocalService layoutSetPrototypeLocalService) {
413                    this.layoutSetPrototypeLocalService = layoutSetPrototypeLocalService;
414            }
415    
416            /**
417             * Returns the layout set prototype remote service.
418             *
419             * @return the layout set prototype remote service
420             */
421            public com.liferay.portal.service.LayoutSetPrototypeService getLayoutSetPrototypeService() {
422                    return layoutSetPrototypeService;
423            }
424    
425            /**
426             * Sets the layout set prototype remote service.
427             *
428             * @param layoutSetPrototypeService the layout set prototype remote service
429             */
430            public void setLayoutSetPrototypeService(
431                    com.liferay.portal.service.LayoutSetPrototypeService layoutSetPrototypeService) {
432                    this.layoutSetPrototypeService = layoutSetPrototypeService;
433            }
434    
435            /**
436             * Returns the layout set prototype persistence.
437             *
438             * @return the layout set prototype persistence
439             */
440            public LayoutSetPrototypePersistence getLayoutSetPrototypePersistence() {
441                    return layoutSetPrototypePersistence;
442            }
443    
444            /**
445             * Sets the layout set prototype persistence.
446             *
447             * @param layoutSetPrototypePersistence the layout set prototype persistence
448             */
449            public void setLayoutSetPrototypePersistence(
450                    LayoutSetPrototypePersistence layoutSetPrototypePersistence) {
451                    this.layoutSetPrototypePersistence = layoutSetPrototypePersistence;
452            }
453    
454            /**
455             * Returns the counter local service.
456             *
457             * @return the counter local service
458             */
459            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
460                    return counterLocalService;
461            }
462    
463            /**
464             * Sets the counter local service.
465             *
466             * @param counterLocalService the counter local service
467             */
468            public void setCounterLocalService(
469                    com.liferay.counter.service.CounterLocalService counterLocalService) {
470                    this.counterLocalService = counterLocalService;
471            }
472    
473            /**
474             * Returns the group local service.
475             *
476             * @return the group local service
477             */
478            public com.liferay.portal.service.GroupLocalService getGroupLocalService() {
479                    return groupLocalService;
480            }
481    
482            /**
483             * Sets the group local service.
484             *
485             * @param groupLocalService the group local service
486             */
487            public void setGroupLocalService(
488                    com.liferay.portal.service.GroupLocalService groupLocalService) {
489                    this.groupLocalService = groupLocalService;
490            }
491    
492            /**
493             * Returns the group remote service.
494             *
495             * @return the group remote service
496             */
497            public com.liferay.portal.service.GroupService getGroupService() {
498                    return groupService;
499            }
500    
501            /**
502             * Sets the group remote service.
503             *
504             * @param groupService the group remote service
505             */
506            public void setGroupService(
507                    com.liferay.portal.service.GroupService groupService) {
508                    this.groupService = groupService;
509            }
510    
511            /**
512             * Returns the group persistence.
513             *
514             * @return the group persistence
515             */
516            public GroupPersistence getGroupPersistence() {
517                    return groupPersistence;
518            }
519    
520            /**
521             * Sets the group persistence.
522             *
523             * @param groupPersistence the group persistence
524             */
525            public void setGroupPersistence(GroupPersistence groupPersistence) {
526                    this.groupPersistence = groupPersistence;
527            }
528    
529            /**
530             * Returns the group finder.
531             *
532             * @return the group finder
533             */
534            public GroupFinder getGroupFinder() {
535                    return groupFinder;
536            }
537    
538            /**
539             * Sets the group finder.
540             *
541             * @param groupFinder the group finder
542             */
543            public void setGroupFinder(GroupFinder groupFinder) {
544                    this.groupFinder = groupFinder;
545            }
546    
547            /**
548             * Returns the layout local service.
549             *
550             * @return the layout local service
551             */
552            public com.liferay.portal.service.LayoutLocalService getLayoutLocalService() {
553                    return layoutLocalService;
554            }
555    
556            /**
557             * Sets the layout local service.
558             *
559             * @param layoutLocalService the layout local service
560             */
561            public void setLayoutLocalService(
562                    com.liferay.portal.service.LayoutLocalService layoutLocalService) {
563                    this.layoutLocalService = layoutLocalService;
564            }
565    
566            /**
567             * Returns the layout remote service.
568             *
569             * @return the layout remote service
570             */
571            public com.liferay.portal.service.LayoutService getLayoutService() {
572                    return layoutService;
573            }
574    
575            /**
576             * Sets the layout remote service.
577             *
578             * @param layoutService the layout remote service
579             */
580            public void setLayoutService(
581                    com.liferay.portal.service.LayoutService layoutService) {
582                    this.layoutService = layoutService;
583            }
584    
585            /**
586             * Returns the layout persistence.
587             *
588             * @return the layout persistence
589             */
590            public LayoutPersistence getLayoutPersistence() {
591                    return layoutPersistence;
592            }
593    
594            /**
595             * Sets the layout persistence.
596             *
597             * @param layoutPersistence the layout persistence
598             */
599            public void setLayoutPersistence(LayoutPersistence layoutPersistence) {
600                    this.layoutPersistence = layoutPersistence;
601            }
602    
603            /**
604             * Returns the layout finder.
605             *
606             * @return the layout finder
607             */
608            public LayoutFinder getLayoutFinder() {
609                    return layoutFinder;
610            }
611    
612            /**
613             * Sets the layout finder.
614             *
615             * @param layoutFinder the layout finder
616             */
617            public void setLayoutFinder(LayoutFinder layoutFinder) {
618                    this.layoutFinder = layoutFinder;
619            }
620    
621            /**
622             * Returns the layout set local service.
623             *
624             * @return the layout set local service
625             */
626            public com.liferay.portal.service.LayoutSetLocalService getLayoutSetLocalService() {
627                    return layoutSetLocalService;
628            }
629    
630            /**
631             * Sets the layout set local service.
632             *
633             * @param layoutSetLocalService the layout set local service
634             */
635            public void setLayoutSetLocalService(
636                    com.liferay.portal.service.LayoutSetLocalService layoutSetLocalService) {
637                    this.layoutSetLocalService = layoutSetLocalService;
638            }
639    
640            /**
641             * Returns the layout set remote service.
642             *
643             * @return the layout set remote service
644             */
645            public com.liferay.portal.service.LayoutSetService getLayoutSetService() {
646                    return layoutSetService;
647            }
648    
649            /**
650             * Sets the layout set remote service.
651             *
652             * @param layoutSetService the layout set remote service
653             */
654            public void setLayoutSetService(
655                    com.liferay.portal.service.LayoutSetService layoutSetService) {
656                    this.layoutSetService = layoutSetService;
657            }
658    
659            /**
660             * Returns the layout set persistence.
661             *
662             * @return the layout set persistence
663             */
664            public LayoutSetPersistence getLayoutSetPersistence() {
665                    return layoutSetPersistence;
666            }
667    
668            /**
669             * Sets the layout set persistence.
670             *
671             * @param layoutSetPersistence the layout set persistence
672             */
673            public void setLayoutSetPersistence(
674                    LayoutSetPersistence layoutSetPersistence) {
675                    this.layoutSetPersistence = layoutSetPersistence;
676            }
677    
678            /**
679             * Returns the resource local service.
680             *
681             * @return the resource local service
682             */
683            public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
684                    return resourceLocalService;
685            }
686    
687            /**
688             * Sets the resource local service.
689             *
690             * @param resourceLocalService the resource local service
691             */
692            public void setResourceLocalService(
693                    com.liferay.portal.service.ResourceLocalService resourceLocalService) {
694                    this.resourceLocalService = resourceLocalService;
695            }
696    
697            /**
698             * Returns the user local service.
699             *
700             * @return the user local service
701             */
702            public com.liferay.portal.service.UserLocalService getUserLocalService() {
703                    return userLocalService;
704            }
705    
706            /**
707             * Sets the user local service.
708             *
709             * @param userLocalService the user local service
710             */
711            public void setUserLocalService(
712                    com.liferay.portal.service.UserLocalService userLocalService) {
713                    this.userLocalService = userLocalService;
714            }
715    
716            /**
717             * Returns the user remote service.
718             *
719             * @return the user remote service
720             */
721            public com.liferay.portal.service.UserService getUserService() {
722                    return userService;
723            }
724    
725            /**
726             * Sets the user remote service.
727             *
728             * @param userService the user remote service
729             */
730            public void setUserService(
731                    com.liferay.portal.service.UserService userService) {
732                    this.userService = userService;
733            }
734    
735            /**
736             * Returns the user persistence.
737             *
738             * @return the user persistence
739             */
740            public UserPersistence getUserPersistence() {
741                    return userPersistence;
742            }
743    
744            /**
745             * Sets the user persistence.
746             *
747             * @param userPersistence the user persistence
748             */
749            public void setUserPersistence(UserPersistence userPersistence) {
750                    this.userPersistence = userPersistence;
751            }
752    
753            /**
754             * Returns the user finder.
755             *
756             * @return the user finder
757             */
758            public UserFinder getUserFinder() {
759                    return userFinder;
760            }
761    
762            /**
763             * Sets the user finder.
764             *
765             * @param userFinder the user finder
766             */
767            public void setUserFinder(UserFinder userFinder) {
768                    this.userFinder = userFinder;
769            }
770    
771            public void afterPropertiesSet() {
772                    persistedModelLocalServiceRegistry.register("com.liferay.portal.model.LayoutSetPrototype",
773                            layoutSetPrototypeLocalService);
774            }
775    
776            public void destroy() {
777                    persistedModelLocalServiceRegistry.unregister(
778                            "com.liferay.portal.model.LayoutSetPrototype");
779            }
780    
781            /**
782             * Returns the Spring bean ID for this bean.
783             *
784             * @return the Spring bean ID for this bean
785             */
786            @Override
787            public String getBeanIdentifier() {
788                    return _beanIdentifier;
789            }
790    
791            /**
792             * Sets the Spring bean ID for this bean.
793             *
794             * @param beanIdentifier the Spring bean ID for this bean
795             */
796            @Override
797            public void setBeanIdentifier(String beanIdentifier) {
798                    _beanIdentifier = beanIdentifier;
799            }
800    
801            protected Class<?> getModelClass() {
802                    return LayoutSetPrototype.class;
803            }
804    
805            protected String getModelClassName() {
806                    return LayoutSetPrototype.class.getName();
807            }
808    
809            /**
810             * Performs a SQL query.
811             *
812             * @param sql the sql query
813             */
814            protected void runSQL(String sql) {
815                    try {
816                            DataSource dataSource = layoutSetPrototypePersistence.getDataSource();
817    
818                            DB db = DBFactoryUtil.getDB();
819    
820                            sql = db.buildSQL(sql);
821                            sql = PortalUtil.transformSQL(sql);
822    
823                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
824                                            sql, new int[0]);
825    
826                            sqlUpdate.update();
827                    }
828                    catch (Exception e) {
829                            throw new SystemException(e);
830                    }
831            }
832    
833            @BeanReference(type = com.liferay.portal.service.LayoutSetPrototypeLocalService.class)
834            protected LayoutSetPrototypeLocalService layoutSetPrototypeLocalService;
835            @BeanReference(type = com.liferay.portal.service.LayoutSetPrototypeService.class)
836            protected com.liferay.portal.service.LayoutSetPrototypeService layoutSetPrototypeService;
837            @BeanReference(type = LayoutSetPrototypePersistence.class)
838            protected LayoutSetPrototypePersistence layoutSetPrototypePersistence;
839            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
840            protected com.liferay.counter.service.CounterLocalService counterLocalService;
841            @BeanReference(type = com.liferay.portal.service.GroupLocalService.class)
842            protected com.liferay.portal.service.GroupLocalService groupLocalService;
843            @BeanReference(type = com.liferay.portal.service.GroupService.class)
844            protected com.liferay.portal.service.GroupService groupService;
845            @BeanReference(type = GroupPersistence.class)
846            protected GroupPersistence groupPersistence;
847            @BeanReference(type = GroupFinder.class)
848            protected GroupFinder groupFinder;
849            @BeanReference(type = com.liferay.portal.service.LayoutLocalService.class)
850            protected com.liferay.portal.service.LayoutLocalService layoutLocalService;
851            @BeanReference(type = com.liferay.portal.service.LayoutService.class)
852            protected com.liferay.portal.service.LayoutService layoutService;
853            @BeanReference(type = LayoutPersistence.class)
854            protected LayoutPersistence layoutPersistence;
855            @BeanReference(type = LayoutFinder.class)
856            protected LayoutFinder layoutFinder;
857            @BeanReference(type = com.liferay.portal.service.LayoutSetLocalService.class)
858            protected com.liferay.portal.service.LayoutSetLocalService layoutSetLocalService;
859            @BeanReference(type = com.liferay.portal.service.LayoutSetService.class)
860            protected com.liferay.portal.service.LayoutSetService layoutSetService;
861            @BeanReference(type = LayoutSetPersistence.class)
862            protected LayoutSetPersistence layoutSetPersistence;
863            @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
864            protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
865            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
866            protected com.liferay.portal.service.UserLocalService userLocalService;
867            @BeanReference(type = com.liferay.portal.service.UserService.class)
868            protected com.liferay.portal.service.UserService userService;
869            @BeanReference(type = UserPersistence.class)
870            protected UserPersistence userPersistence;
871            @BeanReference(type = UserFinder.class)
872            protected UserFinder userFinder;
873            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
874            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
875            private String _beanIdentifier;
876    }