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.Projection;
030    import com.liferay.portal.kernel.exception.PortalException;
031    import com.liferay.portal.kernel.exception.SystemException;
032    import com.liferay.portal.kernel.search.Indexable;
033    import com.liferay.portal.kernel.search.IndexableType;
034    import com.liferay.portal.kernel.util.OrderByComparator;
035    import com.liferay.portal.model.ExportImportConfiguration;
036    import com.liferay.portal.model.PersistedModel;
037    import com.liferay.portal.service.BaseLocalServiceImpl;
038    import com.liferay.portal.service.ExportImportConfigurationLocalService;
039    import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
040    import com.liferay.portal.service.persistence.ExportImportConfigurationPersistence;
041    import com.liferay.portal.service.persistence.UserFinder;
042    import com.liferay.portal.service.persistence.UserPersistence;
043    import com.liferay.portal.util.PortalUtil;
044    
045    import com.liferay.portlet.trash.service.persistence.TrashEntryPersistence;
046    
047    import java.io.Serializable;
048    
049    import java.util.List;
050    
051    import javax.sql.DataSource;
052    
053    /**
054     * Provides the base implementation for the export import configuration local service.
055     *
056     * <p>
057     * 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.ExportImportConfigurationLocalServiceImpl}.
058     * </p>
059     *
060     * @author Brian Wing Shun Chan
061     * @see com.liferay.portal.service.impl.ExportImportConfigurationLocalServiceImpl
062     * @see com.liferay.portal.service.ExportImportConfigurationLocalServiceUtil
063     * @generated
064     */
065    @ProviderType
066    public abstract class ExportImportConfigurationLocalServiceBaseImpl
067            extends BaseLocalServiceImpl
068            implements ExportImportConfigurationLocalService, IdentifiableBean {
069            /*
070             * NOTE FOR DEVELOPERS:
071             *
072             * Never modify or reference this class directly. Always use {@link com.liferay.portal.service.ExportImportConfigurationLocalServiceUtil} to access the export import configuration local service.
073             */
074    
075            /**
076             * Adds the export import configuration to the database. Also notifies the appropriate model listeners.
077             *
078             * @param exportImportConfiguration the export import configuration
079             * @return the export import configuration that was added
080             */
081            @Indexable(type = IndexableType.REINDEX)
082            @Override
083            public ExportImportConfiguration addExportImportConfiguration(
084                    ExportImportConfiguration exportImportConfiguration) {
085                    exportImportConfiguration.setNew(true);
086    
087                    return exportImportConfigurationPersistence.update(exportImportConfiguration);
088            }
089    
090            /**
091             * Creates a new export import configuration with the primary key. Does not add the export import configuration to the database.
092             *
093             * @param exportImportConfigurationId the primary key for the new export import configuration
094             * @return the new export import configuration
095             */
096            @Override
097            public ExportImportConfiguration createExportImportConfiguration(
098                    long exportImportConfigurationId) {
099                    return exportImportConfigurationPersistence.create(exportImportConfigurationId);
100            }
101    
102            /**
103             * Deletes the export import configuration with the primary key from the database. Also notifies the appropriate model listeners.
104             *
105             * @param exportImportConfigurationId the primary key of the export import configuration
106             * @return the export import configuration that was removed
107             * @throws PortalException if a export import configuration with the primary key could not be found
108             */
109            @Indexable(type = IndexableType.DELETE)
110            @Override
111            public ExportImportConfiguration deleteExportImportConfiguration(
112                    long exportImportConfigurationId) throws PortalException {
113                    return exportImportConfigurationPersistence.remove(exportImportConfigurationId);
114            }
115    
116            /**
117             * Deletes the export import configuration from the database. Also notifies the appropriate model listeners.
118             *
119             * @param exportImportConfiguration the export import configuration
120             * @return the export import configuration that was removed
121             * @throws PortalException
122             */
123            @Indexable(type = IndexableType.DELETE)
124            @Override
125            public ExportImportConfiguration deleteExportImportConfiguration(
126                    ExportImportConfiguration exportImportConfiguration)
127                    throws PortalException {
128                    return exportImportConfigurationPersistence.remove(exportImportConfiguration);
129            }
130    
131            @Override
132            public DynamicQuery dynamicQuery() {
133                    Class<?> clazz = getClass();
134    
135                    return DynamicQueryFactoryUtil.forClass(ExportImportConfiguration.class,
136                            clazz.getClassLoader());
137            }
138    
139            /**
140             * Performs a dynamic query on the database and returns the matching rows.
141             *
142             * @param dynamicQuery the dynamic query
143             * @return the matching rows
144             */
145            @Override
146            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
147                    return exportImportConfigurationPersistence.findWithDynamicQuery(dynamicQuery);
148            }
149    
150            /**
151             * Performs a dynamic query on the database and returns a range of the matching rows.
152             *
153             * <p>
154             * 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.ExportImportConfigurationModelImpl}. 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.
155             * </p>
156             *
157             * @param dynamicQuery the dynamic query
158             * @param start the lower bound of the range of model instances
159             * @param end the upper bound of the range of model instances (not inclusive)
160             * @return the range of matching rows
161             */
162            @Override
163            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
164                    int end) {
165                    return exportImportConfigurationPersistence.findWithDynamicQuery(dynamicQuery,
166                            start, end);
167            }
168    
169            /**
170             * Performs a dynamic query on the database and returns an ordered range of the matching rows.
171             *
172             * <p>
173             * 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.ExportImportConfigurationModelImpl}. 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.
174             * </p>
175             *
176             * @param dynamicQuery the dynamic query
177             * @param start the lower bound of the range of model instances
178             * @param end the upper bound of the range of model instances (not inclusive)
179             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
180             * @return the ordered range of matching rows
181             */
182            @Override
183            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
184                    int end, OrderByComparator<T> orderByComparator) {
185                    return exportImportConfigurationPersistence.findWithDynamicQuery(dynamicQuery,
186                            start, end, orderByComparator);
187            }
188    
189            /**
190             * Returns the number of rows matching the dynamic query.
191             *
192             * @param dynamicQuery the dynamic query
193             * @return the number of rows matching the dynamic query
194             */
195            @Override
196            public long dynamicQueryCount(DynamicQuery dynamicQuery) {
197                    return exportImportConfigurationPersistence.countWithDynamicQuery(dynamicQuery);
198            }
199    
200            /**
201             * Returns the number of rows matching the dynamic query.
202             *
203             * @param dynamicQuery the dynamic query
204             * @param projection the projection to apply to the query
205             * @return the number of rows matching the dynamic query
206             */
207            @Override
208            public long dynamicQueryCount(DynamicQuery dynamicQuery,
209                    Projection projection) {
210                    return exportImportConfigurationPersistence.countWithDynamicQuery(dynamicQuery,
211                            projection);
212            }
213    
214            @Override
215            public ExportImportConfiguration fetchExportImportConfiguration(
216                    long exportImportConfigurationId) {
217                    return exportImportConfigurationPersistence.fetchByPrimaryKey(exportImportConfigurationId);
218            }
219    
220            /**
221             * Returns the export import configuration with the primary key.
222             *
223             * @param exportImportConfigurationId the primary key of the export import configuration
224             * @return the export import configuration
225             * @throws PortalException if a export import configuration with the primary key could not be found
226             */
227            @Override
228            public ExportImportConfiguration getExportImportConfiguration(
229                    long exportImportConfigurationId) throws PortalException {
230                    return exportImportConfigurationPersistence.findByPrimaryKey(exportImportConfigurationId);
231            }
232    
233            @Override
234            public ActionableDynamicQuery getActionableDynamicQuery() {
235                    ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
236    
237                    actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.ExportImportConfigurationLocalServiceUtil.getService());
238                    actionableDynamicQuery.setClass(ExportImportConfiguration.class);
239                    actionableDynamicQuery.setClassLoader(getClassLoader());
240    
241                    actionableDynamicQuery.setPrimaryKeyPropertyName(
242                            "exportImportConfigurationId");
243    
244                    return actionableDynamicQuery;
245            }
246    
247            protected void initActionableDynamicQuery(
248                    ActionableDynamicQuery actionableDynamicQuery) {
249                    actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.ExportImportConfigurationLocalServiceUtil.getService());
250                    actionableDynamicQuery.setClass(ExportImportConfiguration.class);
251                    actionableDynamicQuery.setClassLoader(getClassLoader());
252    
253                    actionableDynamicQuery.setPrimaryKeyPropertyName(
254                            "exportImportConfigurationId");
255            }
256    
257            /**
258             * @throws PortalException
259             */
260            @Override
261            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
262                    throws PortalException {
263                    return exportImportConfigurationLocalService.deleteExportImportConfiguration((ExportImportConfiguration)persistedModel);
264            }
265    
266            @Override
267            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
268                    throws PortalException {
269                    return exportImportConfigurationPersistence.findByPrimaryKey(primaryKeyObj);
270            }
271    
272            /**
273             * Returns a range of all the export import configurations.
274             *
275             * <p>
276             * 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.ExportImportConfigurationModelImpl}. 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.
277             * </p>
278             *
279             * @param start the lower bound of the range of export import configurations
280             * @param end the upper bound of the range of export import configurations (not inclusive)
281             * @return the range of export import configurations
282             */
283            @Override
284            public List<ExportImportConfiguration> getExportImportConfigurations(
285                    int start, int end) {
286                    return exportImportConfigurationPersistence.findAll(start, end);
287            }
288    
289            /**
290             * Returns the number of export import configurations.
291             *
292             * @return the number of export import configurations
293             */
294            @Override
295            public int getExportImportConfigurationsCount() {
296                    return exportImportConfigurationPersistence.countAll();
297            }
298    
299            /**
300             * Updates the export import configuration in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
301             *
302             * @param exportImportConfiguration the export import configuration
303             * @return the export import configuration that was updated
304             */
305            @Indexable(type = IndexableType.REINDEX)
306            @Override
307            public ExportImportConfiguration updateExportImportConfiguration(
308                    ExportImportConfiguration exportImportConfiguration) {
309                    return exportImportConfigurationPersistence.update(exportImportConfiguration);
310            }
311    
312            /**
313             * Returns the export import configuration local service.
314             *
315             * @return the export import configuration local service
316             */
317            public com.liferay.portal.service.ExportImportConfigurationLocalService getExportImportConfigurationLocalService() {
318                    return exportImportConfigurationLocalService;
319            }
320    
321            /**
322             * Sets the export import configuration local service.
323             *
324             * @param exportImportConfigurationLocalService the export import configuration local service
325             */
326            public void setExportImportConfigurationLocalService(
327                    com.liferay.portal.service.ExportImportConfigurationLocalService exportImportConfigurationLocalService) {
328                    this.exportImportConfigurationLocalService = exportImportConfigurationLocalService;
329            }
330    
331            /**
332             * Returns the export import configuration remote service.
333             *
334             * @return the export import configuration remote service
335             */
336            public com.liferay.portal.service.ExportImportConfigurationService getExportImportConfigurationService() {
337                    return exportImportConfigurationService;
338            }
339    
340            /**
341             * Sets the export import configuration remote service.
342             *
343             * @param exportImportConfigurationService the export import configuration remote service
344             */
345            public void setExportImportConfigurationService(
346                    com.liferay.portal.service.ExportImportConfigurationService exportImportConfigurationService) {
347                    this.exportImportConfigurationService = exportImportConfigurationService;
348            }
349    
350            /**
351             * Returns the export import configuration persistence.
352             *
353             * @return the export import configuration persistence
354             */
355            public ExportImportConfigurationPersistence getExportImportConfigurationPersistence() {
356                    return exportImportConfigurationPersistence;
357            }
358    
359            /**
360             * Sets the export import configuration persistence.
361             *
362             * @param exportImportConfigurationPersistence the export import configuration persistence
363             */
364            public void setExportImportConfigurationPersistence(
365                    ExportImportConfigurationPersistence exportImportConfigurationPersistence) {
366                    this.exportImportConfigurationPersistence = exportImportConfigurationPersistence;
367            }
368    
369            /**
370             * Returns the counter local service.
371             *
372             * @return the counter local service
373             */
374            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
375                    return counterLocalService;
376            }
377    
378            /**
379             * Sets the counter local service.
380             *
381             * @param counterLocalService the counter local service
382             */
383            public void setCounterLocalService(
384                    com.liferay.counter.service.CounterLocalService counterLocalService) {
385                    this.counterLocalService = counterLocalService;
386            }
387    
388            /**
389             * Returns the trash entry local service.
390             *
391             * @return the trash entry local service
392             */
393            public com.liferay.portlet.trash.service.TrashEntryLocalService getTrashEntryLocalService() {
394                    return trashEntryLocalService;
395            }
396    
397            /**
398             * Sets the trash entry local service.
399             *
400             * @param trashEntryLocalService the trash entry local service
401             */
402            public void setTrashEntryLocalService(
403                    com.liferay.portlet.trash.service.TrashEntryLocalService trashEntryLocalService) {
404                    this.trashEntryLocalService = trashEntryLocalService;
405            }
406    
407            /**
408             * Returns the trash entry remote service.
409             *
410             * @return the trash entry remote service
411             */
412            public com.liferay.portlet.trash.service.TrashEntryService getTrashEntryService() {
413                    return trashEntryService;
414            }
415    
416            /**
417             * Sets the trash entry remote service.
418             *
419             * @param trashEntryService the trash entry remote service
420             */
421            public void setTrashEntryService(
422                    com.liferay.portlet.trash.service.TrashEntryService trashEntryService) {
423                    this.trashEntryService = trashEntryService;
424            }
425    
426            /**
427             * Returns the trash entry persistence.
428             *
429             * @return the trash entry persistence
430             */
431            public TrashEntryPersistence getTrashEntryPersistence() {
432                    return trashEntryPersistence;
433            }
434    
435            /**
436             * Sets the trash entry persistence.
437             *
438             * @param trashEntryPersistence the trash entry persistence
439             */
440            public void setTrashEntryPersistence(
441                    TrashEntryPersistence trashEntryPersistence) {
442                    this.trashEntryPersistence = trashEntryPersistence;
443            }
444    
445            /**
446             * Returns the user local service.
447             *
448             * @return the user local service
449             */
450            public com.liferay.portal.service.UserLocalService getUserLocalService() {
451                    return userLocalService;
452            }
453    
454            /**
455             * Sets the user local service.
456             *
457             * @param userLocalService the user local service
458             */
459            public void setUserLocalService(
460                    com.liferay.portal.service.UserLocalService userLocalService) {
461                    this.userLocalService = userLocalService;
462            }
463    
464            /**
465             * Returns the user remote service.
466             *
467             * @return the user remote service
468             */
469            public com.liferay.portal.service.UserService getUserService() {
470                    return userService;
471            }
472    
473            /**
474             * Sets the user remote service.
475             *
476             * @param userService the user remote service
477             */
478            public void setUserService(
479                    com.liferay.portal.service.UserService userService) {
480                    this.userService = userService;
481            }
482    
483            /**
484             * Returns the user persistence.
485             *
486             * @return the user persistence
487             */
488            public UserPersistence getUserPersistence() {
489                    return userPersistence;
490            }
491    
492            /**
493             * Sets the user persistence.
494             *
495             * @param userPersistence the user persistence
496             */
497            public void setUserPersistence(UserPersistence userPersistence) {
498                    this.userPersistence = userPersistence;
499            }
500    
501            /**
502             * Returns the user finder.
503             *
504             * @return the user finder
505             */
506            public UserFinder getUserFinder() {
507                    return userFinder;
508            }
509    
510            /**
511             * Sets the user finder.
512             *
513             * @param userFinder the user finder
514             */
515            public void setUserFinder(UserFinder userFinder) {
516                    this.userFinder = userFinder;
517            }
518    
519            public void afterPropertiesSet() {
520                    persistedModelLocalServiceRegistry.register("com.liferay.portal.model.ExportImportConfiguration",
521                            exportImportConfigurationLocalService);
522            }
523    
524            public void destroy() {
525                    persistedModelLocalServiceRegistry.unregister(
526                            "com.liferay.portal.model.ExportImportConfiguration");
527            }
528    
529            /**
530             * Returns the Spring bean ID for this bean.
531             *
532             * @return the Spring bean ID for this bean
533             */
534            @Override
535            public String getBeanIdentifier() {
536                    return _beanIdentifier;
537            }
538    
539            /**
540             * Sets the Spring bean ID for this bean.
541             *
542             * @param beanIdentifier the Spring bean ID for this bean
543             */
544            @Override
545            public void setBeanIdentifier(String beanIdentifier) {
546                    _beanIdentifier = beanIdentifier;
547            }
548    
549            protected Class<?> getModelClass() {
550                    return ExportImportConfiguration.class;
551            }
552    
553            protected String getModelClassName() {
554                    return ExportImportConfiguration.class.getName();
555            }
556    
557            /**
558             * Performs a SQL query.
559             *
560             * @param sql the sql query
561             */
562            protected void runSQL(String sql) {
563                    try {
564                            DataSource dataSource = exportImportConfigurationPersistence.getDataSource();
565    
566                            DB db = DBFactoryUtil.getDB();
567    
568                            sql = db.buildSQL(sql);
569                            sql = PortalUtil.transformSQL(sql);
570    
571                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
572                                            sql, new int[0]);
573    
574                            sqlUpdate.update();
575                    }
576                    catch (Exception e) {
577                            throw new SystemException(e);
578                    }
579            }
580    
581            @BeanReference(type = com.liferay.portal.service.ExportImportConfigurationLocalService.class)
582            protected com.liferay.portal.service.ExportImportConfigurationLocalService exportImportConfigurationLocalService;
583            @BeanReference(type = com.liferay.portal.service.ExportImportConfigurationService.class)
584            protected com.liferay.portal.service.ExportImportConfigurationService exportImportConfigurationService;
585            @BeanReference(type = ExportImportConfigurationPersistence.class)
586            protected ExportImportConfigurationPersistence exportImportConfigurationPersistence;
587            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
588            protected com.liferay.counter.service.CounterLocalService counterLocalService;
589            @BeanReference(type = com.liferay.portlet.trash.service.TrashEntryLocalService.class)
590            protected com.liferay.portlet.trash.service.TrashEntryLocalService trashEntryLocalService;
591            @BeanReference(type = com.liferay.portlet.trash.service.TrashEntryService.class)
592            protected com.liferay.portlet.trash.service.TrashEntryService trashEntryService;
593            @BeanReference(type = TrashEntryPersistence.class)
594            protected TrashEntryPersistence trashEntryPersistence;
595            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
596            protected com.liferay.portal.service.UserLocalService userLocalService;
597            @BeanReference(type = com.liferay.portal.service.UserService.class)
598            protected com.liferay.portal.service.UserService userService;
599            @BeanReference(type = UserPersistence.class)
600            protected UserPersistence userPersistence;
601            @BeanReference(type = UserFinder.class)
602            protected UserFinder userFinder;
603            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
604            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
605            private String _beanIdentifier;
606    }