001
014
015 package com.liferay.portlet.expando.service.base;
016
017 import com.liferay.portal.kernel.bean.BeanReference;
018 import com.liferay.portal.kernel.bean.IdentifiableBean;
019 import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
020 import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
021 import com.liferay.portal.kernel.dao.orm.DynamicQuery;
022 import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
023 import com.liferay.portal.kernel.dao.orm.Projection;
024 import com.liferay.portal.kernel.exception.PortalException;
025 import com.liferay.portal.kernel.exception.SystemException;
026 import com.liferay.portal.kernel.search.Indexable;
027 import com.liferay.portal.kernel.search.IndexableType;
028 import com.liferay.portal.kernel.util.OrderByComparator;
029 import com.liferay.portal.model.PersistedModel;
030 import com.liferay.portal.service.BaseLocalServiceImpl;
031 import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
032 import com.liferay.portal.service.persistence.UserFinder;
033 import com.liferay.portal.service.persistence.UserPersistence;
034
035 import com.liferay.portlet.expando.model.ExpandoRow;
036 import com.liferay.portlet.expando.service.ExpandoRowLocalService;
037 import com.liferay.portlet.expando.service.persistence.ExpandoColumnPersistence;
038 import com.liferay.portlet.expando.service.persistence.ExpandoRowPersistence;
039 import com.liferay.portlet.expando.service.persistence.ExpandoTablePersistence;
040 import com.liferay.portlet.expando.service.persistence.ExpandoValuePersistence;
041
042 import java.io.Serializable;
043
044 import java.util.List;
045
046 import javax.sql.DataSource;
047
048
060 public abstract class ExpandoRowLocalServiceBaseImpl
061 extends BaseLocalServiceImpl implements ExpandoRowLocalService,
062 IdentifiableBean {
063
068
069
076 @Indexable(type = IndexableType.REINDEX)
077 @Override
078 public ExpandoRow addExpandoRow(ExpandoRow expandoRow)
079 throws SystemException {
080 expandoRow.setNew(true);
081
082 return expandoRowPersistence.update(expandoRow);
083 }
084
085
091 @Override
092 public ExpandoRow createExpandoRow(long rowId) {
093 return expandoRowPersistence.create(rowId);
094 }
095
096
104 @Indexable(type = IndexableType.DELETE)
105 @Override
106 public ExpandoRow deleteExpandoRow(long rowId)
107 throws PortalException, SystemException {
108 return expandoRowPersistence.remove(rowId);
109 }
110
111
118 @Indexable(type = IndexableType.DELETE)
119 @Override
120 public ExpandoRow deleteExpandoRow(ExpandoRow expandoRow)
121 throws SystemException {
122 return expandoRowPersistence.remove(expandoRow);
123 }
124
125 @Override
126 public DynamicQuery dynamicQuery() {
127 Class<?> clazz = getClass();
128
129 return DynamicQueryFactoryUtil.forClass(ExpandoRow.class,
130 clazz.getClassLoader());
131 }
132
133
140 @Override
141 @SuppressWarnings("rawtypes")
142 public List dynamicQuery(DynamicQuery dynamicQuery)
143 throws SystemException {
144 return expandoRowPersistence.findWithDynamicQuery(dynamicQuery);
145 }
146
147
160 @Override
161 @SuppressWarnings("rawtypes")
162 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
163 throws SystemException {
164 return expandoRowPersistence.findWithDynamicQuery(dynamicQuery, start,
165 end);
166 }
167
168
182 @Override
183 @SuppressWarnings("rawtypes")
184 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
185 OrderByComparator orderByComparator) throws SystemException {
186 return expandoRowPersistence.findWithDynamicQuery(dynamicQuery, start,
187 end, orderByComparator);
188 }
189
190
197 @Override
198 public long dynamicQueryCount(DynamicQuery dynamicQuery)
199 throws SystemException {
200 return expandoRowPersistence.countWithDynamicQuery(dynamicQuery);
201 }
202
203
211 @Override
212 public long dynamicQueryCount(DynamicQuery dynamicQuery,
213 Projection projection) throws SystemException {
214 return expandoRowPersistence.countWithDynamicQuery(dynamicQuery,
215 projection);
216 }
217
218 @Override
219 public ExpandoRow fetchExpandoRow(long rowId) throws SystemException {
220 return expandoRowPersistence.fetchByPrimaryKey(rowId);
221 }
222
223
231 @Override
232 public ExpandoRow getExpandoRow(long rowId)
233 throws PortalException, SystemException {
234 return expandoRowPersistence.findByPrimaryKey(rowId);
235 }
236
237 @Override
238 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
239 throws PortalException, SystemException {
240 return expandoRowPersistence.findByPrimaryKey(primaryKeyObj);
241 }
242
243
255 @Override
256 public List<ExpandoRow> getExpandoRows(int start, int end)
257 throws SystemException {
258 return expandoRowPersistence.findAll(start, end);
259 }
260
261
267 @Override
268 public int getExpandoRowsCount() throws SystemException {
269 return expandoRowPersistence.countAll();
270 }
271
272
279 @Indexable(type = IndexableType.REINDEX)
280 @Override
281 public ExpandoRow updateExpandoRow(ExpandoRow expandoRow)
282 throws SystemException {
283 return expandoRowPersistence.update(expandoRow);
284 }
285
286
291 public com.liferay.portlet.expando.service.ExpandoColumnLocalService getExpandoColumnLocalService() {
292 return expandoColumnLocalService;
293 }
294
295
300 public void setExpandoColumnLocalService(
301 com.liferay.portlet.expando.service.ExpandoColumnLocalService expandoColumnLocalService) {
302 this.expandoColumnLocalService = expandoColumnLocalService;
303 }
304
305
310 public com.liferay.portlet.expando.service.ExpandoColumnService getExpandoColumnService() {
311 return expandoColumnService;
312 }
313
314
319 public void setExpandoColumnService(
320 com.liferay.portlet.expando.service.ExpandoColumnService expandoColumnService) {
321 this.expandoColumnService = expandoColumnService;
322 }
323
324
329 public ExpandoColumnPersistence getExpandoColumnPersistence() {
330 return expandoColumnPersistence;
331 }
332
333
338 public void setExpandoColumnPersistence(
339 ExpandoColumnPersistence expandoColumnPersistence) {
340 this.expandoColumnPersistence = expandoColumnPersistence;
341 }
342
343
348 public com.liferay.portlet.expando.service.ExpandoRowLocalService getExpandoRowLocalService() {
349 return expandoRowLocalService;
350 }
351
352
357 public void setExpandoRowLocalService(
358 com.liferay.portlet.expando.service.ExpandoRowLocalService expandoRowLocalService) {
359 this.expandoRowLocalService = expandoRowLocalService;
360 }
361
362
367 public ExpandoRowPersistence getExpandoRowPersistence() {
368 return expandoRowPersistence;
369 }
370
371
376 public void setExpandoRowPersistence(
377 ExpandoRowPersistence expandoRowPersistence) {
378 this.expandoRowPersistence = expandoRowPersistence;
379 }
380
381
386 public com.liferay.portlet.expando.service.ExpandoTableLocalService getExpandoTableLocalService() {
387 return expandoTableLocalService;
388 }
389
390
395 public void setExpandoTableLocalService(
396 com.liferay.portlet.expando.service.ExpandoTableLocalService expandoTableLocalService) {
397 this.expandoTableLocalService = expandoTableLocalService;
398 }
399
400
405 public ExpandoTablePersistence getExpandoTablePersistence() {
406 return expandoTablePersistence;
407 }
408
409
414 public void setExpandoTablePersistence(
415 ExpandoTablePersistence expandoTablePersistence) {
416 this.expandoTablePersistence = expandoTablePersistence;
417 }
418
419
424 public com.liferay.portlet.expando.service.ExpandoValueLocalService getExpandoValueLocalService() {
425 return expandoValueLocalService;
426 }
427
428
433 public void setExpandoValueLocalService(
434 com.liferay.portlet.expando.service.ExpandoValueLocalService expandoValueLocalService) {
435 this.expandoValueLocalService = expandoValueLocalService;
436 }
437
438
443 public com.liferay.portlet.expando.service.ExpandoValueService getExpandoValueService() {
444 return expandoValueService;
445 }
446
447
452 public void setExpandoValueService(
453 com.liferay.portlet.expando.service.ExpandoValueService expandoValueService) {
454 this.expandoValueService = expandoValueService;
455 }
456
457
462 public ExpandoValuePersistence getExpandoValuePersistence() {
463 return expandoValuePersistence;
464 }
465
466
471 public void setExpandoValuePersistence(
472 ExpandoValuePersistence expandoValuePersistence) {
473 this.expandoValuePersistence = expandoValuePersistence;
474 }
475
476
481 public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
482 return counterLocalService;
483 }
484
485
490 public void setCounterLocalService(
491 com.liferay.counter.service.CounterLocalService counterLocalService) {
492 this.counterLocalService = counterLocalService;
493 }
494
495
500 public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
501 return resourceLocalService;
502 }
503
504
509 public void setResourceLocalService(
510 com.liferay.portal.service.ResourceLocalService resourceLocalService) {
511 this.resourceLocalService = resourceLocalService;
512 }
513
514
519 public com.liferay.portal.service.UserLocalService getUserLocalService() {
520 return userLocalService;
521 }
522
523
528 public void setUserLocalService(
529 com.liferay.portal.service.UserLocalService userLocalService) {
530 this.userLocalService = userLocalService;
531 }
532
533
538 public com.liferay.portal.service.UserService getUserService() {
539 return userService;
540 }
541
542
547 public void setUserService(
548 com.liferay.portal.service.UserService userService) {
549 this.userService = userService;
550 }
551
552
557 public UserPersistence getUserPersistence() {
558 return userPersistence;
559 }
560
561
566 public void setUserPersistence(UserPersistence userPersistence) {
567 this.userPersistence = userPersistence;
568 }
569
570
575 public UserFinder getUserFinder() {
576 return userFinder;
577 }
578
579
584 public void setUserFinder(UserFinder userFinder) {
585 this.userFinder = userFinder;
586 }
587
588 public void afterPropertiesSet() {
589 persistedModelLocalServiceRegistry.register("com.liferay.portlet.expando.model.ExpandoRow",
590 expandoRowLocalService);
591 }
592
593 public void destroy() {
594 persistedModelLocalServiceRegistry.unregister(
595 "com.liferay.portlet.expando.model.ExpandoRow");
596 }
597
598
603 @Override
604 public String getBeanIdentifier() {
605 return _beanIdentifier;
606 }
607
608
613 @Override
614 public void setBeanIdentifier(String beanIdentifier) {
615 _beanIdentifier = beanIdentifier;
616 }
617
618 protected Class<?> getModelClass() {
619 return ExpandoRow.class;
620 }
621
622 protected String getModelClassName() {
623 return ExpandoRow.class.getName();
624 }
625
626
631 protected void runSQL(String sql) throws SystemException {
632 try {
633 DataSource dataSource = expandoRowPersistence.getDataSource();
634
635 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
636 sql, new int[0]);
637
638 sqlUpdate.update();
639 }
640 catch (Exception e) {
641 throw new SystemException(e);
642 }
643 }
644
645 @BeanReference(type = com.liferay.portlet.expando.service.ExpandoColumnLocalService.class)
646 protected com.liferay.portlet.expando.service.ExpandoColumnLocalService expandoColumnLocalService;
647 @BeanReference(type = com.liferay.portlet.expando.service.ExpandoColumnService.class)
648 protected com.liferay.portlet.expando.service.ExpandoColumnService expandoColumnService;
649 @BeanReference(type = ExpandoColumnPersistence.class)
650 protected ExpandoColumnPersistence expandoColumnPersistence;
651 @BeanReference(type = com.liferay.portlet.expando.service.ExpandoRowLocalService.class)
652 protected com.liferay.portlet.expando.service.ExpandoRowLocalService expandoRowLocalService;
653 @BeanReference(type = ExpandoRowPersistence.class)
654 protected ExpandoRowPersistence expandoRowPersistence;
655 @BeanReference(type = com.liferay.portlet.expando.service.ExpandoTableLocalService.class)
656 protected com.liferay.portlet.expando.service.ExpandoTableLocalService expandoTableLocalService;
657 @BeanReference(type = ExpandoTablePersistence.class)
658 protected ExpandoTablePersistence expandoTablePersistence;
659 @BeanReference(type = com.liferay.portlet.expando.service.ExpandoValueLocalService.class)
660 protected com.liferay.portlet.expando.service.ExpandoValueLocalService expandoValueLocalService;
661 @BeanReference(type = com.liferay.portlet.expando.service.ExpandoValueService.class)
662 protected com.liferay.portlet.expando.service.ExpandoValueService expandoValueService;
663 @BeanReference(type = ExpandoValuePersistence.class)
664 protected ExpandoValuePersistence expandoValuePersistence;
665 @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
666 protected com.liferay.counter.service.CounterLocalService counterLocalService;
667 @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
668 protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
669 @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
670 protected com.liferay.portal.service.UserLocalService userLocalService;
671 @BeanReference(type = com.liferay.portal.service.UserService.class)
672 protected com.liferay.portal.service.UserService userService;
673 @BeanReference(type = UserPersistence.class)
674 protected UserPersistence userPersistence;
675 @BeanReference(type = UserFinder.class)
676 protected UserFinder userFinder;
677 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
678 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
679 private String _beanIdentifier;
680 }