001
014
015 package com.liferay.portlet.exportimport.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.IndexableActionableDynamicQuery;
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.module.framework.service.IdentifiableOSGiService;
033 import com.liferay.portal.kernel.search.Indexable;
034 import com.liferay.portal.kernel.search.IndexableType;
035 import com.liferay.portal.kernel.util.OrderByComparator;
036 import com.liferay.portal.model.PersistedModel;
037 import com.liferay.portal.service.BaseLocalServiceImpl;
038 import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
039 import com.liferay.portal.service.persistence.ClassNamePersistence;
040 import com.liferay.portal.service.persistence.UserFinder;
041 import com.liferay.portal.service.persistence.UserPersistence;
042 import com.liferay.portal.util.PortalUtil;
043
044 import com.liferay.portlet.exportimport.model.ExportImportConfiguration;
045 import com.liferay.portlet.exportimport.service.ExportImportConfigurationLocalService;
046 import com.liferay.portlet.exportimport.service.persistence.ExportImportConfigurationPersistence;
047 import com.liferay.portlet.trash.service.persistence.TrashEntryPersistence;
048
049 import java.io.Serializable;
050
051 import java.util.List;
052
053 import javax.sql.DataSource;
054
055
067 @ProviderType
068 public abstract class ExportImportConfigurationLocalServiceBaseImpl
069 extends BaseLocalServiceImpl
070 implements ExportImportConfigurationLocalService, IdentifiableOSGiService {
071
076
077
083 @Indexable(type = IndexableType.REINDEX)
084 @Override
085 public ExportImportConfiguration addExportImportConfiguration(
086 ExportImportConfiguration exportImportConfiguration) {
087 exportImportConfiguration.setNew(true);
088
089 return exportImportConfigurationPersistence.update(exportImportConfiguration);
090 }
091
092
098 @Override
099 public ExportImportConfiguration createExportImportConfiguration(
100 long exportImportConfigurationId) {
101 return exportImportConfigurationPersistence.create(exportImportConfigurationId);
102 }
103
104
111 @Indexable(type = IndexableType.DELETE)
112 @Override
113 public ExportImportConfiguration deleteExportImportConfiguration(
114 long exportImportConfigurationId) throws PortalException {
115 return exportImportConfigurationPersistence.remove(exportImportConfigurationId);
116 }
117
118
124 @Indexable(type = IndexableType.DELETE)
125 @Override
126 public ExportImportConfiguration deleteExportImportConfiguration(
127 ExportImportConfiguration exportImportConfiguration) {
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
145 @Override
146 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
147 return exportImportConfigurationPersistence.findWithDynamicQuery(dynamicQuery);
148 }
149
150
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
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
195 @Override
196 public long dynamicQueryCount(DynamicQuery dynamicQuery) {
197 return exportImportConfigurationPersistence.countWithDynamicQuery(dynamicQuery);
198 }
199
200
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
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.portlet.exportimport.service.ExportImportConfigurationLocalServiceUtil.getService());
238 actionableDynamicQuery.setClassLoader(getClassLoader());
239 actionableDynamicQuery.setModelClass(ExportImportConfiguration.class);
240
241 actionableDynamicQuery.setPrimaryKeyPropertyName(
242 "exportImportConfigurationId");
243
244 return actionableDynamicQuery;
245 }
246
247 @Override
248 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
249 IndexableActionableDynamicQuery indexableActionableDynamicQuery = new IndexableActionableDynamicQuery();
250
251 indexableActionableDynamicQuery.setBaseLocalService(com.liferay.portlet.exportimport.service.ExportImportConfigurationLocalServiceUtil.getService());
252 indexableActionableDynamicQuery.setClassLoader(getClassLoader());
253 indexableActionableDynamicQuery.setModelClass(ExportImportConfiguration.class);
254
255 indexableActionableDynamicQuery.setPrimaryKeyPropertyName(
256 "exportImportConfigurationId");
257
258 return indexableActionableDynamicQuery;
259 }
260
261 protected void initActionableDynamicQuery(
262 ActionableDynamicQuery actionableDynamicQuery) {
263 actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.exportimport.service.ExportImportConfigurationLocalServiceUtil.getService());
264 actionableDynamicQuery.setClassLoader(getClassLoader());
265 actionableDynamicQuery.setModelClass(ExportImportConfiguration.class);
266
267 actionableDynamicQuery.setPrimaryKeyPropertyName(
268 "exportImportConfigurationId");
269 }
270
271
274 @Override
275 public PersistedModel deletePersistedModel(PersistedModel persistedModel)
276 throws PortalException {
277 return exportImportConfigurationLocalService.deleteExportImportConfiguration((ExportImportConfiguration)persistedModel);
278 }
279
280 @Override
281 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
282 throws PortalException {
283 return exportImportConfigurationPersistence.findByPrimaryKey(primaryKeyObj);
284 }
285
286
297 @Override
298 public List<ExportImportConfiguration> getExportImportConfigurations(
299 int start, int end) {
300 return exportImportConfigurationPersistence.findAll(start, end);
301 }
302
303
308 @Override
309 public int getExportImportConfigurationsCount() {
310 return exportImportConfigurationPersistence.countAll();
311 }
312
313
319 @Indexable(type = IndexableType.REINDEX)
320 @Override
321 public ExportImportConfiguration updateExportImportConfiguration(
322 ExportImportConfiguration exportImportConfiguration) {
323 return exportImportConfigurationPersistence.update(exportImportConfiguration);
324 }
325
326
331 public com.liferay.portlet.exportimport.service.ExportImportLocalService getExportImportLocalService() {
332 return exportImportLocalService;
333 }
334
335
340 public void setExportImportLocalService(
341 com.liferay.portlet.exportimport.service.ExportImportLocalService exportImportLocalService) {
342 this.exportImportLocalService = exportImportLocalService;
343 }
344
345
350 public ExportImportConfigurationLocalService getExportImportConfigurationLocalService() {
351 return exportImportConfigurationLocalService;
352 }
353
354
359 public void setExportImportConfigurationLocalService(
360 ExportImportConfigurationLocalService exportImportConfigurationLocalService) {
361 this.exportImportConfigurationLocalService = exportImportConfigurationLocalService;
362 }
363
364
369 public ExportImportConfigurationPersistence getExportImportConfigurationPersistence() {
370 return exportImportConfigurationPersistence;
371 }
372
373
378 public void setExportImportConfigurationPersistence(
379 ExportImportConfigurationPersistence exportImportConfigurationPersistence) {
380 this.exportImportConfigurationPersistence = exportImportConfigurationPersistence;
381 }
382
383
388 public com.liferay.portlet.exportimport.service.StagingLocalService getStagingLocalService() {
389 return stagingLocalService;
390 }
391
392
397 public void setStagingLocalService(
398 com.liferay.portlet.exportimport.service.StagingLocalService stagingLocalService) {
399 this.stagingLocalService = stagingLocalService;
400 }
401
402
407 public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
408 return counterLocalService;
409 }
410
411
416 public void setCounterLocalService(
417 com.liferay.counter.service.CounterLocalService counterLocalService) {
418 this.counterLocalService = counterLocalService;
419 }
420
421
426 public com.liferay.portal.service.ClassNameLocalService getClassNameLocalService() {
427 return classNameLocalService;
428 }
429
430
435 public void setClassNameLocalService(
436 com.liferay.portal.service.ClassNameLocalService classNameLocalService) {
437 this.classNameLocalService = classNameLocalService;
438 }
439
440
445 public ClassNamePersistence getClassNamePersistence() {
446 return classNamePersistence;
447 }
448
449
454 public void setClassNamePersistence(
455 ClassNamePersistence classNamePersistence) {
456 this.classNamePersistence = classNamePersistence;
457 }
458
459
464 public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
465 return resourceLocalService;
466 }
467
468
473 public void setResourceLocalService(
474 com.liferay.portal.service.ResourceLocalService resourceLocalService) {
475 this.resourceLocalService = resourceLocalService;
476 }
477
478
483 public com.liferay.portal.service.UserLocalService getUserLocalService() {
484 return userLocalService;
485 }
486
487
492 public void setUserLocalService(
493 com.liferay.portal.service.UserLocalService userLocalService) {
494 this.userLocalService = userLocalService;
495 }
496
497
502 public UserPersistence getUserPersistence() {
503 return userPersistence;
504 }
505
506
511 public void setUserPersistence(UserPersistence userPersistence) {
512 this.userPersistence = userPersistence;
513 }
514
515
520 public UserFinder getUserFinder() {
521 return userFinder;
522 }
523
524
529 public void setUserFinder(UserFinder userFinder) {
530 this.userFinder = userFinder;
531 }
532
533
538 public com.liferay.portlet.trash.service.TrashEntryLocalService getTrashEntryLocalService() {
539 return trashEntryLocalService;
540 }
541
542
547 public void setTrashEntryLocalService(
548 com.liferay.portlet.trash.service.TrashEntryLocalService trashEntryLocalService) {
549 this.trashEntryLocalService = trashEntryLocalService;
550 }
551
552
557 public TrashEntryPersistence getTrashEntryPersistence() {
558 return trashEntryPersistence;
559 }
560
561
566 public void setTrashEntryPersistence(
567 TrashEntryPersistence trashEntryPersistence) {
568 this.trashEntryPersistence = trashEntryPersistence;
569 }
570
571 public void afterPropertiesSet() {
572 persistedModelLocalServiceRegistry.register("com.liferay.portlet.exportimport.model.ExportImportConfiguration",
573 exportImportConfigurationLocalService);
574 }
575
576 public void destroy() {
577 persistedModelLocalServiceRegistry.unregister(
578 "com.liferay.portlet.exportimport.model.ExportImportConfiguration");
579 }
580
581
586 @Override
587 public String getOSGiServiceIdentifier() {
588 return ExportImportConfigurationLocalService.class.getName();
589 }
590
591 protected Class<?> getModelClass() {
592 return ExportImportConfiguration.class;
593 }
594
595 protected String getModelClassName() {
596 return ExportImportConfiguration.class.getName();
597 }
598
599
604 protected void runSQL(String sql) {
605 try {
606 DataSource dataSource = exportImportConfigurationPersistence.getDataSource();
607
608 DB db = DBManagerUtil.getDB();
609
610 sql = db.buildSQL(sql);
611 sql = PortalUtil.transformSQL(sql);
612
613 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
614 sql, new int[0]);
615
616 sqlUpdate.update();
617 }
618 catch (Exception e) {
619 throw new SystemException(e);
620 }
621 }
622
623 @BeanReference(type = com.liferay.portlet.exportimport.service.ExportImportLocalService.class)
624 protected com.liferay.portlet.exportimport.service.ExportImportLocalService exportImportLocalService;
625 @BeanReference(type = com.liferay.portlet.exportimport.service.ExportImportConfigurationLocalService.class)
626 protected ExportImportConfigurationLocalService exportImportConfigurationLocalService;
627 @BeanReference(type = ExportImportConfigurationPersistence.class)
628 protected ExportImportConfigurationPersistence exportImportConfigurationPersistence;
629 @BeanReference(type = com.liferay.portlet.exportimport.service.StagingLocalService.class)
630 protected com.liferay.portlet.exportimport.service.StagingLocalService stagingLocalService;
631 @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
632 protected com.liferay.counter.service.CounterLocalService counterLocalService;
633 @BeanReference(type = com.liferay.portal.service.ClassNameLocalService.class)
634 protected com.liferay.portal.service.ClassNameLocalService classNameLocalService;
635 @BeanReference(type = ClassNamePersistence.class)
636 protected ClassNamePersistence classNamePersistence;
637 @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
638 protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
639 @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
640 protected com.liferay.portal.service.UserLocalService userLocalService;
641 @BeanReference(type = UserPersistence.class)
642 protected UserPersistence userPersistence;
643 @BeanReference(type = UserFinder.class)
644 protected UserFinder userFinder;
645 @BeanReference(type = com.liferay.portlet.trash.service.TrashEntryLocalService.class)
646 protected com.liferay.portlet.trash.service.TrashEntryLocalService trashEntryLocalService;
647 @BeanReference(type = TrashEntryPersistence.class)
648 protected TrashEntryPersistence trashEntryPersistence;
649 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
650 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
651 }