001
014
015 package com.liferay.portlet.expando.service.base;
016
017 import com.liferay.counter.service.CounterLocalService;
018
019 import com.liferay.portal.kernel.bean.BeanReference;
020 import com.liferay.portal.kernel.bean.IdentifiableBean;
021 import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
022 import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
023 import com.liferay.portal.kernel.dao.orm.DynamicQuery;
024 import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
025 import com.liferay.portal.kernel.exception.PortalException;
026 import com.liferay.portal.kernel.exception.SystemException;
027 import com.liferay.portal.kernel.search.Indexable;
028 import com.liferay.portal.kernel.search.IndexableType;
029 import com.liferay.portal.kernel.util.OrderByComparator;
030 import com.liferay.portal.model.PersistedModel;
031 import com.liferay.portal.service.BaseLocalServiceImpl;
032 import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
033 import com.liferay.portal.service.ResourceLocalService;
034 import com.liferay.portal.service.UserLocalService;
035 import com.liferay.portal.service.UserService;
036 import com.liferay.portal.service.persistence.UserFinder;
037 import com.liferay.portal.service.persistence.UserPersistence;
038
039 import com.liferay.portlet.expando.model.ExpandoTable;
040 import com.liferay.portlet.expando.service.ExpandoColumnLocalService;
041 import com.liferay.portlet.expando.service.ExpandoColumnService;
042 import com.liferay.portlet.expando.service.ExpandoRowLocalService;
043 import com.liferay.portlet.expando.service.ExpandoTableLocalService;
044 import com.liferay.portlet.expando.service.ExpandoValueLocalService;
045 import com.liferay.portlet.expando.service.ExpandoValueService;
046 import com.liferay.portlet.expando.service.persistence.ExpandoColumnPersistence;
047 import com.liferay.portlet.expando.service.persistence.ExpandoRowPersistence;
048 import com.liferay.portlet.expando.service.persistence.ExpandoTablePersistence;
049 import com.liferay.portlet.expando.service.persistence.ExpandoValuePersistence;
050
051 import java.io.Serializable;
052
053 import java.util.List;
054
055 import javax.sql.DataSource;
056
057
069 public abstract class ExpandoTableLocalServiceBaseImpl
070 extends BaseLocalServiceImpl implements ExpandoTableLocalService,
071 IdentifiableBean {
072
077
078
085 @Indexable(type = IndexableType.REINDEX)
086 public ExpandoTable addExpandoTable(ExpandoTable expandoTable)
087 throws SystemException {
088 expandoTable.setNew(true);
089
090 return expandoTablePersistence.update(expandoTable);
091 }
092
093
099 public ExpandoTable createExpandoTable(long tableId) {
100 return expandoTablePersistence.create(tableId);
101 }
102
103
111 @Indexable(type = IndexableType.DELETE)
112 public ExpandoTable deleteExpandoTable(long tableId)
113 throws PortalException, SystemException {
114 return expandoTablePersistence.remove(tableId);
115 }
116
117
124 @Indexable(type = IndexableType.DELETE)
125 public ExpandoTable deleteExpandoTable(ExpandoTable expandoTable)
126 throws SystemException {
127 return expandoTablePersistence.remove(expandoTable);
128 }
129
130 public DynamicQuery dynamicQuery() {
131 Class<?> clazz = getClass();
132
133 return DynamicQueryFactoryUtil.forClass(ExpandoTable.class,
134 clazz.getClassLoader());
135 }
136
137
144 @SuppressWarnings("rawtypes")
145 public List dynamicQuery(DynamicQuery dynamicQuery)
146 throws SystemException {
147 return expandoTablePersistence.findWithDynamicQuery(dynamicQuery);
148 }
149
150
163 @SuppressWarnings("rawtypes")
164 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
165 throws SystemException {
166 return expandoTablePersistence.findWithDynamicQuery(dynamicQuery,
167 start, end);
168 }
169
170
184 @SuppressWarnings("rawtypes")
185 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
186 OrderByComparator orderByComparator) throws SystemException {
187 return expandoTablePersistence.findWithDynamicQuery(dynamicQuery,
188 start, end, orderByComparator);
189 }
190
191
198 public long dynamicQueryCount(DynamicQuery dynamicQuery)
199 throws SystemException {
200 return expandoTablePersistence.countWithDynamicQuery(dynamicQuery);
201 }
202
203 public ExpandoTable fetchExpandoTable(long tableId)
204 throws SystemException {
205 return expandoTablePersistence.fetchByPrimaryKey(tableId);
206 }
207
208
216 public ExpandoTable getExpandoTable(long tableId)
217 throws PortalException, SystemException {
218 return expandoTablePersistence.findByPrimaryKey(tableId);
219 }
220
221 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
222 throws PortalException, SystemException {
223 return expandoTablePersistence.findByPrimaryKey(primaryKeyObj);
224 }
225
226
238 public List<ExpandoTable> getExpandoTables(int start, int end)
239 throws SystemException {
240 return expandoTablePersistence.findAll(start, end);
241 }
242
243
249 public int getExpandoTablesCount() throws SystemException {
250 return expandoTablePersistence.countAll();
251 }
252
253
260 @Indexable(type = IndexableType.REINDEX)
261 public ExpandoTable updateExpandoTable(ExpandoTable expandoTable)
262 throws SystemException {
263 return expandoTablePersistence.update(expandoTable);
264 }
265
266
271 public ExpandoColumnLocalService getExpandoColumnLocalService() {
272 return expandoColumnLocalService;
273 }
274
275
280 public void setExpandoColumnLocalService(
281 ExpandoColumnLocalService expandoColumnLocalService) {
282 this.expandoColumnLocalService = expandoColumnLocalService;
283 }
284
285
290 public ExpandoColumnService getExpandoColumnService() {
291 return expandoColumnService;
292 }
293
294
299 public void setExpandoColumnService(
300 ExpandoColumnService expandoColumnService) {
301 this.expandoColumnService = expandoColumnService;
302 }
303
304
309 public ExpandoColumnPersistence getExpandoColumnPersistence() {
310 return expandoColumnPersistence;
311 }
312
313
318 public void setExpandoColumnPersistence(
319 ExpandoColumnPersistence expandoColumnPersistence) {
320 this.expandoColumnPersistence = expandoColumnPersistence;
321 }
322
323
328 public ExpandoRowLocalService getExpandoRowLocalService() {
329 return expandoRowLocalService;
330 }
331
332
337 public void setExpandoRowLocalService(
338 ExpandoRowLocalService expandoRowLocalService) {
339 this.expandoRowLocalService = expandoRowLocalService;
340 }
341
342
347 public ExpandoRowPersistence getExpandoRowPersistence() {
348 return expandoRowPersistence;
349 }
350
351
356 public void setExpandoRowPersistence(
357 ExpandoRowPersistence expandoRowPersistence) {
358 this.expandoRowPersistence = expandoRowPersistence;
359 }
360
361
366 public ExpandoTableLocalService getExpandoTableLocalService() {
367 return expandoTableLocalService;
368 }
369
370
375 public void setExpandoTableLocalService(
376 ExpandoTableLocalService expandoTableLocalService) {
377 this.expandoTableLocalService = expandoTableLocalService;
378 }
379
380
385 public ExpandoTablePersistence getExpandoTablePersistence() {
386 return expandoTablePersistence;
387 }
388
389
394 public void setExpandoTablePersistence(
395 ExpandoTablePersistence expandoTablePersistence) {
396 this.expandoTablePersistence = expandoTablePersistence;
397 }
398
399
404 public ExpandoValueLocalService getExpandoValueLocalService() {
405 return expandoValueLocalService;
406 }
407
408
413 public void setExpandoValueLocalService(
414 ExpandoValueLocalService expandoValueLocalService) {
415 this.expandoValueLocalService = expandoValueLocalService;
416 }
417
418
423 public ExpandoValueService getExpandoValueService() {
424 return expandoValueService;
425 }
426
427
432 public void setExpandoValueService(ExpandoValueService expandoValueService) {
433 this.expandoValueService = expandoValueService;
434 }
435
436
441 public ExpandoValuePersistence getExpandoValuePersistence() {
442 return expandoValuePersistence;
443 }
444
445
450 public void setExpandoValuePersistence(
451 ExpandoValuePersistence expandoValuePersistence) {
452 this.expandoValuePersistence = expandoValuePersistence;
453 }
454
455
460 public CounterLocalService getCounterLocalService() {
461 return counterLocalService;
462 }
463
464
469 public void setCounterLocalService(CounterLocalService counterLocalService) {
470 this.counterLocalService = counterLocalService;
471 }
472
473
478 public ResourceLocalService getResourceLocalService() {
479 return resourceLocalService;
480 }
481
482
487 public void setResourceLocalService(
488 ResourceLocalService resourceLocalService) {
489 this.resourceLocalService = resourceLocalService;
490 }
491
492
497 public UserLocalService getUserLocalService() {
498 return userLocalService;
499 }
500
501
506 public void setUserLocalService(UserLocalService userLocalService) {
507 this.userLocalService = userLocalService;
508 }
509
510
515 public UserService getUserService() {
516 return userService;
517 }
518
519
524 public void setUserService(UserService userService) {
525 this.userService = userService;
526 }
527
528
533 public UserPersistence getUserPersistence() {
534 return userPersistence;
535 }
536
537
542 public void setUserPersistence(UserPersistence userPersistence) {
543 this.userPersistence = userPersistence;
544 }
545
546
551 public UserFinder getUserFinder() {
552 return userFinder;
553 }
554
555
560 public void setUserFinder(UserFinder userFinder) {
561 this.userFinder = userFinder;
562 }
563
564 public void afterPropertiesSet() {
565 persistedModelLocalServiceRegistry.register("com.liferay.portlet.expando.model.ExpandoTable",
566 expandoTableLocalService);
567 }
568
569 public void destroy() {
570 persistedModelLocalServiceRegistry.unregister(
571 "com.liferay.portlet.expando.model.ExpandoTable");
572 }
573
574
579 public String getBeanIdentifier() {
580 return _beanIdentifier;
581 }
582
583
588 public void setBeanIdentifier(String beanIdentifier) {
589 _beanIdentifier = beanIdentifier;
590 }
591
592 protected Class<?> getModelClass() {
593 return ExpandoTable.class;
594 }
595
596 protected String getModelClassName() {
597 return ExpandoTable.class.getName();
598 }
599
600
605 protected void runSQL(String sql) throws SystemException {
606 try {
607 DataSource dataSource = expandoTablePersistence.getDataSource();
608
609 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
610 sql, new int[0]);
611
612 sqlUpdate.update();
613 }
614 catch (Exception e) {
615 throw new SystemException(e);
616 }
617 }
618
619 @BeanReference(type = ExpandoColumnLocalService.class)
620 protected ExpandoColumnLocalService expandoColumnLocalService;
621 @BeanReference(type = ExpandoColumnService.class)
622 protected ExpandoColumnService expandoColumnService;
623 @BeanReference(type = ExpandoColumnPersistence.class)
624 protected ExpandoColumnPersistence expandoColumnPersistence;
625 @BeanReference(type = ExpandoRowLocalService.class)
626 protected ExpandoRowLocalService expandoRowLocalService;
627 @BeanReference(type = ExpandoRowPersistence.class)
628 protected ExpandoRowPersistence expandoRowPersistence;
629 @BeanReference(type = ExpandoTableLocalService.class)
630 protected ExpandoTableLocalService expandoTableLocalService;
631 @BeanReference(type = ExpandoTablePersistence.class)
632 protected ExpandoTablePersistence expandoTablePersistence;
633 @BeanReference(type = ExpandoValueLocalService.class)
634 protected ExpandoValueLocalService expandoValueLocalService;
635 @BeanReference(type = ExpandoValueService.class)
636 protected ExpandoValueService expandoValueService;
637 @BeanReference(type = ExpandoValuePersistence.class)
638 protected ExpandoValuePersistence expandoValuePersistence;
639 @BeanReference(type = CounterLocalService.class)
640 protected CounterLocalService counterLocalService;
641 @BeanReference(type = ResourceLocalService.class)
642 protected ResourceLocalService resourceLocalService;
643 @BeanReference(type = UserLocalService.class)
644 protected UserLocalService userLocalService;
645 @BeanReference(type = UserService.class)
646 protected UserService userService;
647 @BeanReference(type = UserPersistence.class)
648 protected UserPersistence userPersistence;
649 @BeanReference(type = UserFinder.class)
650 protected UserFinder userFinder;
651 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
652 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
653 private String _beanIdentifier;
654 }