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.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.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.ExpandoRow;
044 import com.liferay.portlet.expando.service.ExpandoRowLocalService;
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 ExpandoRowLocalServiceBaseImpl
070 extends BaseLocalServiceImpl implements ExpandoRowLocalService,
071 IdentifiableBean {
072
077
078
084 @Indexable(type = IndexableType.REINDEX)
085 @Override
086 public ExpandoRow addExpandoRow(ExpandoRow expandoRow) {
087 expandoRow.setNew(true);
088
089 return expandoRowPersistence.update(expandoRow);
090 }
091
092
098 @Override
099 public ExpandoRow createExpandoRow(long rowId) {
100 return expandoRowPersistence.create(rowId);
101 }
102
103
110 @Indexable(type = IndexableType.DELETE)
111 @Override
112 public ExpandoRow deleteExpandoRow(long rowId) throws PortalException {
113 return expandoRowPersistence.remove(rowId);
114 }
115
116
122 @Indexable(type = IndexableType.DELETE)
123 @Override
124 public ExpandoRow deleteExpandoRow(ExpandoRow expandoRow) {
125 return expandoRowPersistence.remove(expandoRow);
126 }
127
128 @Override
129 public DynamicQuery dynamicQuery() {
130 Class<?> clazz = getClass();
131
132 return DynamicQueryFactoryUtil.forClass(ExpandoRow.class,
133 clazz.getClassLoader());
134 }
135
136
142 @Override
143 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
144 return expandoRowPersistence.findWithDynamicQuery(dynamicQuery);
145 }
146
147
159 @Override
160 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
161 int end) {
162 return expandoRowPersistence.findWithDynamicQuery(dynamicQuery, start,
163 end);
164 }
165
166
179 @Override
180 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
181 int end, OrderByComparator<T> orderByComparator) {
182 return expandoRowPersistence.findWithDynamicQuery(dynamicQuery, start,
183 end, orderByComparator);
184 }
185
186
192 @Override
193 public long dynamicQueryCount(DynamicQuery dynamicQuery) {
194 return expandoRowPersistence.countWithDynamicQuery(dynamicQuery);
195 }
196
197
204 @Override
205 public long dynamicQueryCount(DynamicQuery dynamicQuery,
206 Projection projection) {
207 return expandoRowPersistence.countWithDynamicQuery(dynamicQuery,
208 projection);
209 }
210
211 @Override
212 public ExpandoRow fetchExpandoRow(long rowId) {
213 return expandoRowPersistence.fetchByPrimaryKey(rowId);
214 }
215
216
223 @Override
224 public ExpandoRow getExpandoRow(long rowId) throws PortalException {
225 return expandoRowPersistence.findByPrimaryKey(rowId);
226 }
227
228 @Override
229 public ActionableDynamicQuery getActionableDynamicQuery() {
230 ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
231
232 actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.expando.service.ExpandoRowLocalServiceUtil.getService());
233 actionableDynamicQuery.setClass(ExpandoRow.class);
234 actionableDynamicQuery.setClassLoader(getClassLoader());
235
236 actionableDynamicQuery.setPrimaryKeyPropertyName("rowId");
237
238 return actionableDynamicQuery;
239 }
240
241 protected void initActionableDynamicQuery(
242 ActionableDynamicQuery actionableDynamicQuery) {
243 actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.expando.service.ExpandoRowLocalServiceUtil.getService());
244 actionableDynamicQuery.setClass(ExpandoRow.class);
245 actionableDynamicQuery.setClassLoader(getClassLoader());
246
247 actionableDynamicQuery.setPrimaryKeyPropertyName("rowId");
248 }
249
250
253 @Override
254 public PersistedModel deletePersistedModel(PersistedModel persistedModel)
255 throws PortalException {
256 return expandoRowLocalService.deleteExpandoRow((ExpandoRow)persistedModel);
257 }
258
259 @Override
260 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
261 throws PortalException {
262 return expandoRowPersistence.findByPrimaryKey(primaryKeyObj);
263 }
264
265
276 @Override
277 public List<ExpandoRow> getExpandoRows(int start, int end) {
278 return expandoRowPersistence.findAll(start, end);
279 }
280
281
286 @Override
287 public int getExpandoRowsCount() {
288 return expandoRowPersistence.countAll();
289 }
290
291
297 @Indexable(type = IndexableType.REINDEX)
298 @Override
299 public ExpandoRow updateExpandoRow(ExpandoRow expandoRow) {
300 return expandoRowPersistence.update(expandoRow);
301 }
302
303
308 public com.liferay.portlet.expando.service.ExpandoColumnLocalService getExpandoColumnLocalService() {
309 return expandoColumnLocalService;
310 }
311
312
317 public void setExpandoColumnLocalService(
318 com.liferay.portlet.expando.service.ExpandoColumnLocalService expandoColumnLocalService) {
319 this.expandoColumnLocalService = expandoColumnLocalService;
320 }
321
322
327 public com.liferay.portlet.expando.service.ExpandoColumnService getExpandoColumnService() {
328 return expandoColumnService;
329 }
330
331
336 public void setExpandoColumnService(
337 com.liferay.portlet.expando.service.ExpandoColumnService expandoColumnService) {
338 this.expandoColumnService = expandoColumnService;
339 }
340
341
346 public ExpandoColumnPersistence getExpandoColumnPersistence() {
347 return expandoColumnPersistence;
348 }
349
350
355 public void setExpandoColumnPersistence(
356 ExpandoColumnPersistence expandoColumnPersistence) {
357 this.expandoColumnPersistence = expandoColumnPersistence;
358 }
359
360
365 public ExpandoRowLocalService getExpandoRowLocalService() {
366 return expandoRowLocalService;
367 }
368
369
374 public void setExpandoRowLocalService(
375 ExpandoRowLocalService expandoRowLocalService) {
376 this.expandoRowLocalService = expandoRowLocalService;
377 }
378
379
384 public ExpandoRowPersistence getExpandoRowPersistence() {
385 return expandoRowPersistence;
386 }
387
388
393 public void setExpandoRowPersistence(
394 ExpandoRowPersistence expandoRowPersistence) {
395 this.expandoRowPersistence = expandoRowPersistence;
396 }
397
398
403 public com.liferay.portlet.expando.service.ExpandoTableLocalService getExpandoTableLocalService() {
404 return expandoTableLocalService;
405 }
406
407
412 public void setExpandoTableLocalService(
413 com.liferay.portlet.expando.service.ExpandoTableLocalService expandoTableLocalService) {
414 this.expandoTableLocalService = expandoTableLocalService;
415 }
416
417
422 public ExpandoTablePersistence getExpandoTablePersistence() {
423 return expandoTablePersistence;
424 }
425
426
431 public void setExpandoTablePersistence(
432 ExpandoTablePersistence expandoTablePersistence) {
433 this.expandoTablePersistence = expandoTablePersistence;
434 }
435
436
441 public com.liferay.portlet.expando.service.ExpandoValueLocalService getExpandoValueLocalService() {
442 return expandoValueLocalService;
443 }
444
445
450 public void setExpandoValueLocalService(
451 com.liferay.portlet.expando.service.ExpandoValueLocalService expandoValueLocalService) {
452 this.expandoValueLocalService = expandoValueLocalService;
453 }
454
455
460 public com.liferay.portlet.expando.service.ExpandoValueService getExpandoValueService() {
461 return expandoValueService;
462 }
463
464
469 public void setExpandoValueService(
470 com.liferay.portlet.expando.service.ExpandoValueService expandoValueService) {
471 this.expandoValueService = expandoValueService;
472 }
473
474
479 public ExpandoValuePersistence getExpandoValuePersistence() {
480 return expandoValuePersistence;
481 }
482
483
488 public void setExpandoValuePersistence(
489 ExpandoValuePersistence expandoValuePersistence) {
490 this.expandoValuePersistence = expandoValuePersistence;
491 }
492
493
498 public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
499 return counterLocalService;
500 }
501
502
507 public void setCounterLocalService(
508 com.liferay.counter.service.CounterLocalService counterLocalService) {
509 this.counterLocalService = counterLocalService;
510 }
511
512
517 public com.liferay.portal.service.ClassNameLocalService getClassNameLocalService() {
518 return classNameLocalService;
519 }
520
521
526 public void setClassNameLocalService(
527 com.liferay.portal.service.ClassNameLocalService classNameLocalService) {
528 this.classNameLocalService = classNameLocalService;
529 }
530
531
536 public com.liferay.portal.service.ClassNameService getClassNameService() {
537 return classNameService;
538 }
539
540
545 public void setClassNameService(
546 com.liferay.portal.service.ClassNameService classNameService) {
547 this.classNameService = classNameService;
548 }
549
550
555 public ClassNamePersistence getClassNamePersistence() {
556 return classNamePersistence;
557 }
558
559
564 public void setClassNamePersistence(
565 ClassNamePersistence classNamePersistence) {
566 this.classNamePersistence = classNamePersistence;
567 }
568
569
574 public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
575 return resourceLocalService;
576 }
577
578
583 public void setResourceLocalService(
584 com.liferay.portal.service.ResourceLocalService resourceLocalService) {
585 this.resourceLocalService = resourceLocalService;
586 }
587
588
593 public com.liferay.portal.service.UserLocalService getUserLocalService() {
594 return userLocalService;
595 }
596
597
602 public void setUserLocalService(
603 com.liferay.portal.service.UserLocalService userLocalService) {
604 this.userLocalService = userLocalService;
605 }
606
607
612 public com.liferay.portal.service.UserService getUserService() {
613 return userService;
614 }
615
616
621 public void setUserService(
622 com.liferay.portal.service.UserService userService) {
623 this.userService = userService;
624 }
625
626
631 public UserPersistence getUserPersistence() {
632 return userPersistence;
633 }
634
635
640 public void setUserPersistence(UserPersistence userPersistence) {
641 this.userPersistence = userPersistence;
642 }
643
644
649 public UserFinder getUserFinder() {
650 return userFinder;
651 }
652
653
658 public void setUserFinder(UserFinder userFinder) {
659 this.userFinder = userFinder;
660 }
661
662 public void afterPropertiesSet() {
663 persistedModelLocalServiceRegistry.register("com.liferay.portlet.expando.model.ExpandoRow",
664 expandoRowLocalService);
665 }
666
667 public void destroy() {
668 persistedModelLocalServiceRegistry.unregister(
669 "com.liferay.portlet.expando.model.ExpandoRow");
670 }
671
672
677 @Override
678 public String getBeanIdentifier() {
679 return _beanIdentifier;
680 }
681
682
687 @Override
688 public void setBeanIdentifier(String beanIdentifier) {
689 _beanIdentifier = beanIdentifier;
690 }
691
692 protected Class<?> getModelClass() {
693 return ExpandoRow.class;
694 }
695
696 protected String getModelClassName() {
697 return ExpandoRow.class.getName();
698 }
699
700
705 protected void runSQL(String sql) {
706 try {
707 DataSource dataSource = expandoRowPersistence.getDataSource();
708
709 DB db = DBFactoryUtil.getDB();
710
711 sql = db.buildSQL(sql);
712 sql = PortalUtil.transformSQL(sql);
713
714 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
715 sql, new int[0]);
716
717 sqlUpdate.update();
718 }
719 catch (Exception e) {
720 throw new SystemException(e);
721 }
722 }
723
724 @BeanReference(type = com.liferay.portlet.expando.service.ExpandoColumnLocalService.class)
725 protected com.liferay.portlet.expando.service.ExpandoColumnLocalService expandoColumnLocalService;
726 @BeanReference(type = com.liferay.portlet.expando.service.ExpandoColumnService.class)
727 protected com.liferay.portlet.expando.service.ExpandoColumnService expandoColumnService;
728 @BeanReference(type = ExpandoColumnPersistence.class)
729 protected ExpandoColumnPersistence expandoColumnPersistence;
730 @BeanReference(type = com.liferay.portlet.expando.service.ExpandoRowLocalService.class)
731 protected ExpandoRowLocalService expandoRowLocalService;
732 @BeanReference(type = ExpandoRowPersistence.class)
733 protected ExpandoRowPersistence expandoRowPersistence;
734 @BeanReference(type = com.liferay.portlet.expando.service.ExpandoTableLocalService.class)
735 protected com.liferay.portlet.expando.service.ExpandoTableLocalService expandoTableLocalService;
736 @BeanReference(type = ExpandoTablePersistence.class)
737 protected ExpandoTablePersistence expandoTablePersistence;
738 @BeanReference(type = com.liferay.portlet.expando.service.ExpandoValueLocalService.class)
739 protected com.liferay.portlet.expando.service.ExpandoValueLocalService expandoValueLocalService;
740 @BeanReference(type = com.liferay.portlet.expando.service.ExpandoValueService.class)
741 protected com.liferay.portlet.expando.service.ExpandoValueService expandoValueService;
742 @BeanReference(type = ExpandoValuePersistence.class)
743 protected ExpandoValuePersistence expandoValuePersistence;
744 @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
745 protected com.liferay.counter.service.CounterLocalService counterLocalService;
746 @BeanReference(type = com.liferay.portal.service.ClassNameLocalService.class)
747 protected com.liferay.portal.service.ClassNameLocalService classNameLocalService;
748 @BeanReference(type = com.liferay.portal.service.ClassNameService.class)
749 protected com.liferay.portal.service.ClassNameService classNameService;
750 @BeanReference(type = ClassNamePersistence.class)
751 protected ClassNamePersistence classNamePersistence;
752 @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
753 protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
754 @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
755 protected com.liferay.portal.service.UserLocalService userLocalService;
756 @BeanReference(type = com.liferay.portal.service.UserService.class)
757 protected com.liferay.portal.service.UserService userService;
758 @BeanReference(type = UserPersistence.class)
759 protected UserPersistence userPersistence;
760 @BeanReference(type = UserFinder.class)
761 protected UserFinder userFinder;
762 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
763 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
764 private String _beanIdentifier;
765 }