001
014
015 package com.liferay.portlet.expando.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.DBFactoryUtil;
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.Projection;
029 import com.liferay.portal.kernel.exception.PortalException;
030 import com.liferay.portal.kernel.exception.SystemException;
031 import com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService;
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.PersistedModel;
036 import com.liferay.portal.service.BaseLocalServiceImpl;
037 import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
038 import com.liferay.portal.service.persistence.ClassNamePersistence;
039 import com.liferay.portal.service.persistence.UserFinder;
040 import com.liferay.portal.service.persistence.UserPersistence;
041 import com.liferay.portal.util.PortalUtil;
042
043 import com.liferay.portlet.expando.model.ExpandoColumn;
044 import com.liferay.portlet.expando.service.ExpandoColumnLocalService;
045 import com.liferay.portlet.expando.service.persistence.ExpandoColumnPersistence;
046 import com.liferay.portlet.expando.service.persistence.ExpandoRowPersistence;
047 import com.liferay.portlet.expando.service.persistence.ExpandoTablePersistence;
048 import com.liferay.portlet.expando.service.persistence.ExpandoValuePersistence;
049
050 import java.io.Serializable;
051
052 import java.util.List;
053
054 import javax.sql.DataSource;
055
056
068 @ProviderType
069 public abstract class ExpandoColumnLocalServiceBaseImpl
070 extends BaseLocalServiceImpl implements ExpandoColumnLocalService,
071 IdentifiableOSGiService {
072
077
078
084 @Indexable(type = IndexableType.REINDEX)
085 @Override
086 public ExpandoColumn addExpandoColumn(ExpandoColumn expandoColumn) {
087 expandoColumn.setNew(true);
088
089 return expandoColumnPersistence.update(expandoColumn);
090 }
091
092
098 @Override
099 public ExpandoColumn createExpandoColumn(long columnId) {
100 return expandoColumnPersistence.create(columnId);
101 }
102
103
110 @Indexable(type = IndexableType.DELETE)
111 @Override
112 public ExpandoColumn deleteExpandoColumn(long columnId)
113 throws PortalException {
114 return expandoColumnPersistence.remove(columnId);
115 }
116
117
123 @Indexable(type = IndexableType.DELETE)
124 @Override
125 public ExpandoColumn deleteExpandoColumn(ExpandoColumn expandoColumn) {
126 return expandoColumnPersistence.remove(expandoColumn);
127 }
128
129 @Override
130 public DynamicQuery dynamicQuery() {
131 Class<?> clazz = getClass();
132
133 return DynamicQueryFactoryUtil.forClass(ExpandoColumn.class,
134 clazz.getClassLoader());
135 }
136
137
143 @Override
144 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
145 return expandoColumnPersistence.findWithDynamicQuery(dynamicQuery);
146 }
147
148
160 @Override
161 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
162 int end) {
163 return expandoColumnPersistence.findWithDynamicQuery(dynamicQuery,
164 start, end);
165 }
166
167
180 @Override
181 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
182 int end, OrderByComparator<T> orderByComparator) {
183 return expandoColumnPersistence.findWithDynamicQuery(dynamicQuery,
184 start, end, orderByComparator);
185 }
186
187
193 @Override
194 public long dynamicQueryCount(DynamicQuery dynamicQuery) {
195 return expandoColumnPersistence.countWithDynamicQuery(dynamicQuery);
196 }
197
198
205 @Override
206 public long dynamicQueryCount(DynamicQuery dynamicQuery,
207 Projection projection) {
208 return expandoColumnPersistence.countWithDynamicQuery(dynamicQuery,
209 projection);
210 }
211
212 @Override
213 public ExpandoColumn fetchExpandoColumn(long columnId) {
214 return expandoColumnPersistence.fetchByPrimaryKey(columnId);
215 }
216
217
224 @Override
225 public ExpandoColumn getExpandoColumn(long columnId)
226 throws PortalException {
227 return expandoColumnPersistence.findByPrimaryKey(columnId);
228 }
229
230 @Override
231 public ActionableDynamicQuery getActionableDynamicQuery() {
232 ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
233
234 actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.expando.service.ExpandoColumnLocalServiceUtil.getService());
235 actionableDynamicQuery.setClass(ExpandoColumn.class);
236 actionableDynamicQuery.setClassLoader(getClassLoader());
237
238 actionableDynamicQuery.setPrimaryKeyPropertyName("columnId");
239
240 return actionableDynamicQuery;
241 }
242
243 protected void initActionableDynamicQuery(
244 ActionableDynamicQuery actionableDynamicQuery) {
245 actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.expando.service.ExpandoColumnLocalServiceUtil.getService());
246 actionableDynamicQuery.setClass(ExpandoColumn.class);
247 actionableDynamicQuery.setClassLoader(getClassLoader());
248
249 actionableDynamicQuery.setPrimaryKeyPropertyName("columnId");
250 }
251
252
255 @Override
256 public PersistedModel deletePersistedModel(PersistedModel persistedModel)
257 throws PortalException {
258 return expandoColumnLocalService.deleteExpandoColumn((ExpandoColumn)persistedModel);
259 }
260
261 @Override
262 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
263 throws PortalException {
264 return expandoColumnPersistence.findByPrimaryKey(primaryKeyObj);
265 }
266
267
278 @Override
279 public List<ExpandoColumn> getExpandoColumns(int start, int end) {
280 return expandoColumnPersistence.findAll(start, end);
281 }
282
283
288 @Override
289 public int getExpandoColumnsCount() {
290 return expandoColumnPersistence.countAll();
291 }
292
293
299 @Indexable(type = IndexableType.REINDEX)
300 @Override
301 public ExpandoColumn updateExpandoColumn(ExpandoColumn expandoColumn) {
302 return expandoColumnPersistence.update(expandoColumn);
303 }
304
305
310 public ExpandoColumnLocalService getExpandoColumnLocalService() {
311 return expandoColumnLocalService;
312 }
313
314
319 public void setExpandoColumnLocalService(
320 ExpandoColumnLocalService expandoColumnLocalService) {
321 this.expandoColumnLocalService = expandoColumnLocalService;
322 }
323
324
329 public com.liferay.portlet.expando.service.ExpandoColumnService getExpandoColumnService() {
330 return expandoColumnService;
331 }
332
333
338 public void setExpandoColumnService(
339 com.liferay.portlet.expando.service.ExpandoColumnService expandoColumnService) {
340 this.expandoColumnService = expandoColumnService;
341 }
342
343
348 public ExpandoColumnPersistence getExpandoColumnPersistence() {
349 return expandoColumnPersistence;
350 }
351
352
357 public void setExpandoColumnPersistence(
358 ExpandoColumnPersistence expandoColumnPersistence) {
359 this.expandoColumnPersistence = expandoColumnPersistence;
360 }
361
362
367 public com.liferay.portlet.expando.service.ExpandoRowLocalService getExpandoRowLocalService() {
368 return expandoRowLocalService;
369 }
370
371
376 public void setExpandoRowLocalService(
377 com.liferay.portlet.expando.service.ExpandoRowLocalService expandoRowLocalService) {
378 this.expandoRowLocalService = expandoRowLocalService;
379 }
380
381
386 public ExpandoRowPersistence getExpandoRowPersistence() {
387 return expandoRowPersistence;
388 }
389
390
395 public void setExpandoRowPersistence(
396 ExpandoRowPersistence expandoRowPersistence) {
397 this.expandoRowPersistence = expandoRowPersistence;
398 }
399
400
405 public com.liferay.portlet.expando.service.ExpandoTableLocalService getExpandoTableLocalService() {
406 return expandoTableLocalService;
407 }
408
409
414 public void setExpandoTableLocalService(
415 com.liferay.portlet.expando.service.ExpandoTableLocalService expandoTableLocalService) {
416 this.expandoTableLocalService = expandoTableLocalService;
417 }
418
419
424 public ExpandoTablePersistence getExpandoTablePersistence() {
425 return expandoTablePersistence;
426 }
427
428
433 public void setExpandoTablePersistence(
434 ExpandoTablePersistence expandoTablePersistence) {
435 this.expandoTablePersistence = expandoTablePersistence;
436 }
437
438
443 public com.liferay.portlet.expando.service.ExpandoValueLocalService getExpandoValueLocalService() {
444 return expandoValueLocalService;
445 }
446
447
452 public void setExpandoValueLocalService(
453 com.liferay.portlet.expando.service.ExpandoValueLocalService expandoValueLocalService) {
454 this.expandoValueLocalService = expandoValueLocalService;
455 }
456
457
462 public com.liferay.portlet.expando.service.ExpandoValueService getExpandoValueService() {
463 return expandoValueService;
464 }
465
466
471 public void setExpandoValueService(
472 com.liferay.portlet.expando.service.ExpandoValueService expandoValueService) {
473 this.expandoValueService = expandoValueService;
474 }
475
476
481 public ExpandoValuePersistence getExpandoValuePersistence() {
482 return expandoValuePersistence;
483 }
484
485
490 public void setExpandoValuePersistence(
491 ExpandoValuePersistence expandoValuePersistence) {
492 this.expandoValuePersistence = expandoValuePersistence;
493 }
494
495
500 public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
501 return counterLocalService;
502 }
503
504
509 public void setCounterLocalService(
510 com.liferay.counter.service.CounterLocalService counterLocalService) {
511 this.counterLocalService = counterLocalService;
512 }
513
514
519 public com.liferay.portal.service.ClassNameLocalService getClassNameLocalService() {
520 return classNameLocalService;
521 }
522
523
528 public void setClassNameLocalService(
529 com.liferay.portal.service.ClassNameLocalService classNameLocalService) {
530 this.classNameLocalService = classNameLocalService;
531 }
532
533
538 public com.liferay.portal.service.ClassNameService getClassNameService() {
539 return classNameService;
540 }
541
542
547 public void setClassNameService(
548 com.liferay.portal.service.ClassNameService classNameService) {
549 this.classNameService = classNameService;
550 }
551
552
557 public ClassNamePersistence getClassNamePersistence() {
558 return classNamePersistence;
559 }
560
561
566 public void setClassNamePersistence(
567 ClassNamePersistence classNamePersistence) {
568 this.classNamePersistence = classNamePersistence;
569 }
570
571
576 public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
577 return resourceLocalService;
578 }
579
580
585 public void setResourceLocalService(
586 com.liferay.portal.service.ResourceLocalService resourceLocalService) {
587 this.resourceLocalService = resourceLocalService;
588 }
589
590
595 public com.liferay.portal.service.UserLocalService getUserLocalService() {
596 return userLocalService;
597 }
598
599
604 public void setUserLocalService(
605 com.liferay.portal.service.UserLocalService userLocalService) {
606 this.userLocalService = userLocalService;
607 }
608
609
614 public com.liferay.portal.service.UserService getUserService() {
615 return userService;
616 }
617
618
623 public void setUserService(
624 com.liferay.portal.service.UserService userService) {
625 this.userService = userService;
626 }
627
628
633 public UserPersistence getUserPersistence() {
634 return userPersistence;
635 }
636
637
642 public void setUserPersistence(UserPersistence userPersistence) {
643 this.userPersistence = userPersistence;
644 }
645
646
651 public UserFinder getUserFinder() {
652 return userFinder;
653 }
654
655
660 public void setUserFinder(UserFinder userFinder) {
661 this.userFinder = userFinder;
662 }
663
664 public void afterPropertiesSet() {
665 persistedModelLocalServiceRegistry.register("com.liferay.portlet.expando.model.ExpandoColumn",
666 expandoColumnLocalService);
667 }
668
669 public void destroy() {
670 persistedModelLocalServiceRegistry.unregister(
671 "com.liferay.portlet.expando.model.ExpandoColumn");
672 }
673
674
679 @Override
680 public String getOSGiServiceIdentifier() {
681 return ExpandoColumnLocalService.class.getName();
682 }
683
684 protected Class<?> getModelClass() {
685 return ExpandoColumn.class;
686 }
687
688 protected String getModelClassName() {
689 return ExpandoColumn.class.getName();
690 }
691
692
697 protected void runSQL(String sql) {
698 try {
699 DataSource dataSource = expandoColumnPersistence.getDataSource();
700
701 DB db = DBFactoryUtil.getDB();
702
703 sql = db.buildSQL(sql);
704 sql = PortalUtil.transformSQL(sql);
705
706 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
707 sql, new int[0]);
708
709 sqlUpdate.update();
710 }
711 catch (Exception e) {
712 throw new SystemException(e);
713 }
714 }
715
716 @BeanReference(type = com.liferay.portlet.expando.service.ExpandoColumnLocalService.class)
717 protected ExpandoColumnLocalService expandoColumnLocalService;
718 @BeanReference(type = com.liferay.portlet.expando.service.ExpandoColumnService.class)
719 protected com.liferay.portlet.expando.service.ExpandoColumnService expandoColumnService;
720 @BeanReference(type = ExpandoColumnPersistence.class)
721 protected ExpandoColumnPersistence expandoColumnPersistence;
722 @BeanReference(type = com.liferay.portlet.expando.service.ExpandoRowLocalService.class)
723 protected com.liferay.portlet.expando.service.ExpandoRowLocalService expandoRowLocalService;
724 @BeanReference(type = ExpandoRowPersistence.class)
725 protected ExpandoRowPersistence expandoRowPersistence;
726 @BeanReference(type = com.liferay.portlet.expando.service.ExpandoTableLocalService.class)
727 protected com.liferay.portlet.expando.service.ExpandoTableLocalService expandoTableLocalService;
728 @BeanReference(type = ExpandoTablePersistence.class)
729 protected ExpandoTablePersistence expandoTablePersistence;
730 @BeanReference(type = com.liferay.portlet.expando.service.ExpandoValueLocalService.class)
731 protected com.liferay.portlet.expando.service.ExpandoValueLocalService expandoValueLocalService;
732 @BeanReference(type = com.liferay.portlet.expando.service.ExpandoValueService.class)
733 protected com.liferay.portlet.expando.service.ExpandoValueService expandoValueService;
734 @BeanReference(type = ExpandoValuePersistence.class)
735 protected ExpandoValuePersistence expandoValuePersistence;
736 @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
737 protected com.liferay.counter.service.CounterLocalService counterLocalService;
738 @BeanReference(type = com.liferay.portal.service.ClassNameLocalService.class)
739 protected com.liferay.portal.service.ClassNameLocalService classNameLocalService;
740 @BeanReference(type = com.liferay.portal.service.ClassNameService.class)
741 protected com.liferay.portal.service.ClassNameService classNameService;
742 @BeanReference(type = ClassNamePersistence.class)
743 protected ClassNamePersistence classNamePersistence;
744 @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
745 protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
746 @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
747 protected com.liferay.portal.service.UserLocalService userLocalService;
748 @BeanReference(type = com.liferay.portal.service.UserService.class)
749 protected com.liferay.portal.service.UserService userService;
750 @BeanReference(type = UserPersistence.class)
751 protected UserPersistence userPersistence;
752 @BeanReference(type = UserFinder.class)
753 protected UserFinder userFinder;
754 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
755 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
756 }