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