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