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