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.ExpandoRow;
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 ExpandoRowLocalServiceBaseImpl
070 extends BaseLocalServiceImpl implements ExpandoRowLocalService,
071 IdentifiableBean {
072
077
078
085 @Indexable(type = IndexableType.REINDEX)
086 public ExpandoRow addExpandoRow(ExpandoRow expandoRow)
087 throws SystemException {
088 expandoRow.setNew(true);
089
090 return expandoRowPersistence.update(expandoRow);
091 }
092
093
099 public ExpandoRow createExpandoRow(long rowId) {
100 return expandoRowPersistence.create(rowId);
101 }
102
103
111 @Indexable(type = IndexableType.DELETE)
112 public ExpandoRow deleteExpandoRow(long rowId)
113 throws PortalException, SystemException {
114 return expandoRowPersistence.remove(rowId);
115 }
116
117
124 @Indexable(type = IndexableType.DELETE)
125 public ExpandoRow deleteExpandoRow(ExpandoRow expandoRow)
126 throws SystemException {
127 return expandoRowPersistence.remove(expandoRow);
128 }
129
130 public DynamicQuery dynamicQuery() {
131 Class<?> clazz = getClass();
132
133 return DynamicQueryFactoryUtil.forClass(ExpandoRow.class,
134 clazz.getClassLoader());
135 }
136
137
144 @SuppressWarnings("rawtypes")
145 public List dynamicQuery(DynamicQuery dynamicQuery)
146 throws SystemException {
147 return expandoRowPersistence.findWithDynamicQuery(dynamicQuery);
148 }
149
150
163 @SuppressWarnings("rawtypes")
164 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
165 throws SystemException {
166 return expandoRowPersistence.findWithDynamicQuery(dynamicQuery, start,
167 end);
168 }
169
170
184 @SuppressWarnings("rawtypes")
185 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
186 OrderByComparator orderByComparator) throws SystemException {
187 return expandoRowPersistence.findWithDynamicQuery(dynamicQuery, start,
188 end, orderByComparator);
189 }
190
191
198 public long dynamicQueryCount(DynamicQuery dynamicQuery)
199 throws SystemException {
200 return expandoRowPersistence.countWithDynamicQuery(dynamicQuery);
201 }
202
203 public ExpandoRow fetchExpandoRow(long rowId) throws SystemException {
204 return expandoRowPersistence.fetchByPrimaryKey(rowId);
205 }
206
207
215 public ExpandoRow getExpandoRow(long rowId)
216 throws PortalException, SystemException {
217 return expandoRowPersistence.findByPrimaryKey(rowId);
218 }
219
220 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
221 throws PortalException, SystemException {
222 return expandoRowPersistence.findByPrimaryKey(primaryKeyObj);
223 }
224
225
237 public List<ExpandoRow> getExpandoRows(int start, int end)
238 throws SystemException {
239 return expandoRowPersistence.findAll(start, end);
240 }
241
242
248 public int getExpandoRowsCount() throws SystemException {
249 return expandoRowPersistence.countAll();
250 }
251
252
259 @Indexable(type = IndexableType.REINDEX)
260 public ExpandoRow updateExpandoRow(ExpandoRow expandoRow)
261 throws SystemException {
262 return expandoRowPersistence.update(expandoRow);
263 }
264
265
270 public ExpandoColumnLocalService getExpandoColumnLocalService() {
271 return expandoColumnLocalService;
272 }
273
274
279 public void setExpandoColumnLocalService(
280 ExpandoColumnLocalService expandoColumnLocalService) {
281 this.expandoColumnLocalService = expandoColumnLocalService;
282 }
283
284
289 public ExpandoColumnService getExpandoColumnService() {
290 return expandoColumnService;
291 }
292
293
298 public void setExpandoColumnService(
299 ExpandoColumnService expandoColumnService) {
300 this.expandoColumnService = expandoColumnService;
301 }
302
303
308 public ExpandoColumnPersistence getExpandoColumnPersistence() {
309 return expandoColumnPersistence;
310 }
311
312
317 public void setExpandoColumnPersistence(
318 ExpandoColumnPersistence expandoColumnPersistence) {
319 this.expandoColumnPersistence = expandoColumnPersistence;
320 }
321
322
327 public ExpandoRowLocalService getExpandoRowLocalService() {
328 return expandoRowLocalService;
329 }
330
331
336 public void setExpandoRowLocalService(
337 ExpandoRowLocalService expandoRowLocalService) {
338 this.expandoRowLocalService = expandoRowLocalService;
339 }
340
341
346 public ExpandoRowPersistence getExpandoRowPersistence() {
347 return expandoRowPersistence;
348 }
349
350
355 public void setExpandoRowPersistence(
356 ExpandoRowPersistence expandoRowPersistence) {
357 this.expandoRowPersistence = expandoRowPersistence;
358 }
359
360
365 public ExpandoTableLocalService getExpandoTableLocalService() {
366 return expandoTableLocalService;
367 }
368
369
374 public void setExpandoTableLocalService(
375 ExpandoTableLocalService expandoTableLocalService) {
376 this.expandoTableLocalService = expandoTableLocalService;
377 }
378
379
384 public ExpandoTablePersistence getExpandoTablePersistence() {
385 return expandoTablePersistence;
386 }
387
388
393 public void setExpandoTablePersistence(
394 ExpandoTablePersistence expandoTablePersistence) {
395 this.expandoTablePersistence = expandoTablePersistence;
396 }
397
398
403 public ExpandoValueLocalService getExpandoValueLocalService() {
404 return expandoValueLocalService;
405 }
406
407
412 public void setExpandoValueLocalService(
413 ExpandoValueLocalService expandoValueLocalService) {
414 this.expandoValueLocalService = expandoValueLocalService;
415 }
416
417
422 public ExpandoValueService getExpandoValueService() {
423 return expandoValueService;
424 }
425
426
431 public void setExpandoValueService(ExpandoValueService expandoValueService) {
432 this.expandoValueService = expandoValueService;
433 }
434
435
440 public ExpandoValuePersistence getExpandoValuePersistence() {
441 return expandoValuePersistence;
442 }
443
444
449 public void setExpandoValuePersistence(
450 ExpandoValuePersistence expandoValuePersistence) {
451 this.expandoValuePersistence = expandoValuePersistence;
452 }
453
454
459 public CounterLocalService getCounterLocalService() {
460 return counterLocalService;
461 }
462
463
468 public void setCounterLocalService(CounterLocalService counterLocalService) {
469 this.counterLocalService = counterLocalService;
470 }
471
472
477 public ResourceLocalService getResourceLocalService() {
478 return resourceLocalService;
479 }
480
481
486 public void setResourceLocalService(
487 ResourceLocalService resourceLocalService) {
488 this.resourceLocalService = resourceLocalService;
489 }
490
491
496 public UserLocalService getUserLocalService() {
497 return userLocalService;
498 }
499
500
505 public void setUserLocalService(UserLocalService userLocalService) {
506 this.userLocalService = userLocalService;
507 }
508
509
514 public UserService getUserService() {
515 return userService;
516 }
517
518
523 public void setUserService(UserService userService) {
524 this.userService = userService;
525 }
526
527
532 public UserPersistence getUserPersistence() {
533 return userPersistence;
534 }
535
536
541 public void setUserPersistence(UserPersistence userPersistence) {
542 this.userPersistence = userPersistence;
543 }
544
545
550 public UserFinder getUserFinder() {
551 return userFinder;
552 }
553
554
559 public void setUserFinder(UserFinder userFinder) {
560 this.userFinder = userFinder;
561 }
562
563 public void afterPropertiesSet() {
564 persistedModelLocalServiceRegistry.register("com.liferay.portlet.expando.model.ExpandoRow",
565 expandoRowLocalService);
566 }
567
568 public void destroy() {
569 persistedModelLocalServiceRegistry.unregister(
570 "com.liferay.portlet.expando.model.ExpandoRow");
571 }
572
573
578 public String getBeanIdentifier() {
579 return _beanIdentifier;
580 }
581
582
587 public void setBeanIdentifier(String beanIdentifier) {
588 _beanIdentifier = beanIdentifier;
589 }
590
591 protected Class<?> getModelClass() {
592 return ExpandoRow.class;
593 }
594
595 protected String getModelClassName() {
596 return ExpandoRow.class.getName();
597 }
598
599
604 protected void runSQL(String sql) throws SystemException {
605 try {
606 DataSource dataSource = expandoRowPersistence.getDataSource();
607
608 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
609 sql, new int[0]);
610
611 sqlUpdate.update();
612 }
613 catch (Exception e) {
614 throw new SystemException(e);
615 }
616 }
617
618 @BeanReference(type = ExpandoColumnLocalService.class)
619 protected ExpandoColumnLocalService expandoColumnLocalService;
620 @BeanReference(type = ExpandoColumnService.class)
621 protected ExpandoColumnService expandoColumnService;
622 @BeanReference(type = ExpandoColumnPersistence.class)
623 protected ExpandoColumnPersistence expandoColumnPersistence;
624 @BeanReference(type = ExpandoRowLocalService.class)
625 protected ExpandoRowLocalService expandoRowLocalService;
626 @BeanReference(type = ExpandoRowPersistence.class)
627 protected ExpandoRowPersistence expandoRowPersistence;
628 @BeanReference(type = ExpandoTableLocalService.class)
629 protected ExpandoTableLocalService expandoTableLocalService;
630 @BeanReference(type = ExpandoTablePersistence.class)
631 protected ExpandoTablePersistence expandoTablePersistence;
632 @BeanReference(type = ExpandoValueLocalService.class)
633 protected ExpandoValueLocalService expandoValueLocalService;
634 @BeanReference(type = ExpandoValueService.class)
635 protected ExpandoValueService expandoValueService;
636 @BeanReference(type = ExpandoValuePersistence.class)
637 protected ExpandoValuePersistence expandoValuePersistence;
638 @BeanReference(type = CounterLocalService.class)
639 protected CounterLocalService counterLocalService;
640 @BeanReference(type = ResourceLocalService.class)
641 protected ResourceLocalService resourceLocalService;
642 @BeanReference(type = UserLocalService.class)
643 protected UserLocalService userLocalService;
644 @BeanReference(type = UserService.class)
645 protected UserService userService;
646 @BeanReference(type = UserPersistence.class)
647 protected UserPersistence userPersistence;
648 @BeanReference(type = UserFinder.class)
649 protected UserFinder userFinder;
650 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
651 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
652 private String _beanIdentifier;
653 }