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.ExpandoColumn;
036 import com.liferay.portlet.expando.service.ExpandoColumnLocalService;
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 ExpandoColumnLocalServiceBaseImpl
061 extends BaseLocalServiceImpl implements ExpandoColumnLocalService,
062 IdentifiableBean {
063
068
069
076 @Indexable(type = IndexableType.REINDEX)
077 @Override
078 public ExpandoColumn addExpandoColumn(ExpandoColumn expandoColumn)
079 throws SystemException {
080 expandoColumn.setNew(true);
081
082 return expandoColumnPersistence.update(expandoColumn);
083 }
084
085
091 @Override
092 public ExpandoColumn createExpandoColumn(long columnId) {
093 return expandoColumnPersistence.create(columnId);
094 }
095
096
104 @Indexable(type = IndexableType.DELETE)
105 @Override
106 public ExpandoColumn deleteExpandoColumn(long columnId)
107 throws PortalException, SystemException {
108 return expandoColumnPersistence.remove(columnId);
109 }
110
111
118 @Indexable(type = IndexableType.DELETE)
119 @Override
120 public ExpandoColumn deleteExpandoColumn(ExpandoColumn expandoColumn)
121 throws SystemException {
122 return expandoColumnPersistence.remove(expandoColumn);
123 }
124
125 @Override
126 public DynamicQuery dynamicQuery() {
127 Class<?> clazz = getClass();
128
129 return DynamicQueryFactoryUtil.forClass(ExpandoColumn.class,
130 clazz.getClassLoader());
131 }
132
133
140 @Override
141 @SuppressWarnings("rawtypes")
142 public List dynamicQuery(DynamicQuery dynamicQuery)
143 throws SystemException {
144 return expandoColumnPersistence.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 expandoColumnPersistence.findWithDynamicQuery(dynamicQuery,
165 start, 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 expandoColumnPersistence.findWithDynamicQuery(dynamicQuery,
187 start, end, orderByComparator);
188 }
189
190
197 @Override
198 public long dynamicQueryCount(DynamicQuery dynamicQuery)
199 throws SystemException {
200 return expandoColumnPersistence.countWithDynamicQuery(dynamicQuery);
201 }
202
203
211 @Override
212 public long dynamicQueryCount(DynamicQuery dynamicQuery,
213 Projection projection) throws SystemException {
214 return expandoColumnPersistence.countWithDynamicQuery(dynamicQuery,
215 projection);
216 }
217
218 @Override
219 public ExpandoColumn fetchExpandoColumn(long columnId)
220 throws SystemException {
221 return expandoColumnPersistence.fetchByPrimaryKey(columnId);
222 }
223
224
232 @Override
233 public ExpandoColumn getExpandoColumn(long columnId)
234 throws PortalException, SystemException {
235 return expandoColumnPersistence.findByPrimaryKey(columnId);
236 }
237
238 @Override
239 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
240 throws PortalException, SystemException {
241 return expandoColumnPersistence.findByPrimaryKey(primaryKeyObj);
242 }
243
244
256 @Override
257 public List<ExpandoColumn> getExpandoColumns(int start, int end)
258 throws SystemException {
259 return expandoColumnPersistence.findAll(start, end);
260 }
261
262
268 @Override
269 public int getExpandoColumnsCount() throws SystemException {
270 return expandoColumnPersistence.countAll();
271 }
272
273
280 @Indexable(type = IndexableType.REINDEX)
281 @Override
282 public ExpandoColumn updateExpandoColumn(ExpandoColumn expandoColumn)
283 throws SystemException {
284 return expandoColumnPersistence.update(expandoColumn);
285 }
286
287
292 public com.liferay.portlet.expando.service.ExpandoColumnLocalService getExpandoColumnLocalService() {
293 return expandoColumnLocalService;
294 }
295
296
301 public void setExpandoColumnLocalService(
302 com.liferay.portlet.expando.service.ExpandoColumnLocalService expandoColumnLocalService) {
303 this.expandoColumnLocalService = expandoColumnLocalService;
304 }
305
306
311 public com.liferay.portlet.expando.service.ExpandoColumnService getExpandoColumnService() {
312 return expandoColumnService;
313 }
314
315
320 public void setExpandoColumnService(
321 com.liferay.portlet.expando.service.ExpandoColumnService expandoColumnService) {
322 this.expandoColumnService = expandoColumnService;
323 }
324
325
330 public ExpandoColumnPersistence getExpandoColumnPersistence() {
331 return expandoColumnPersistence;
332 }
333
334
339 public void setExpandoColumnPersistence(
340 ExpandoColumnPersistence expandoColumnPersistence) {
341 this.expandoColumnPersistence = expandoColumnPersistence;
342 }
343
344
349 public com.liferay.portlet.expando.service.ExpandoRowLocalService getExpandoRowLocalService() {
350 return expandoRowLocalService;
351 }
352
353
358 public void setExpandoRowLocalService(
359 com.liferay.portlet.expando.service.ExpandoRowLocalService expandoRowLocalService) {
360 this.expandoRowLocalService = expandoRowLocalService;
361 }
362
363
368 public ExpandoRowPersistence getExpandoRowPersistence() {
369 return expandoRowPersistence;
370 }
371
372
377 public void setExpandoRowPersistence(
378 ExpandoRowPersistence expandoRowPersistence) {
379 this.expandoRowPersistence = expandoRowPersistence;
380 }
381
382
387 public com.liferay.portlet.expando.service.ExpandoTableLocalService getExpandoTableLocalService() {
388 return expandoTableLocalService;
389 }
390
391
396 public void setExpandoTableLocalService(
397 com.liferay.portlet.expando.service.ExpandoTableLocalService expandoTableLocalService) {
398 this.expandoTableLocalService = expandoTableLocalService;
399 }
400
401
406 public ExpandoTablePersistence getExpandoTablePersistence() {
407 return expandoTablePersistence;
408 }
409
410
415 public void setExpandoTablePersistence(
416 ExpandoTablePersistence expandoTablePersistence) {
417 this.expandoTablePersistence = expandoTablePersistence;
418 }
419
420
425 public com.liferay.portlet.expando.service.ExpandoValueLocalService getExpandoValueLocalService() {
426 return expandoValueLocalService;
427 }
428
429
434 public void setExpandoValueLocalService(
435 com.liferay.portlet.expando.service.ExpandoValueLocalService expandoValueLocalService) {
436 this.expandoValueLocalService = expandoValueLocalService;
437 }
438
439
444 public com.liferay.portlet.expando.service.ExpandoValueService getExpandoValueService() {
445 return expandoValueService;
446 }
447
448
453 public void setExpandoValueService(
454 com.liferay.portlet.expando.service.ExpandoValueService expandoValueService) {
455 this.expandoValueService = expandoValueService;
456 }
457
458
463 public ExpandoValuePersistence getExpandoValuePersistence() {
464 return expandoValuePersistence;
465 }
466
467
472 public void setExpandoValuePersistence(
473 ExpandoValuePersistence expandoValuePersistence) {
474 this.expandoValuePersistence = expandoValuePersistence;
475 }
476
477
482 public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
483 return counterLocalService;
484 }
485
486
491 public void setCounterLocalService(
492 com.liferay.counter.service.CounterLocalService counterLocalService) {
493 this.counterLocalService = counterLocalService;
494 }
495
496
501 public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
502 return resourceLocalService;
503 }
504
505
510 public void setResourceLocalService(
511 com.liferay.portal.service.ResourceLocalService resourceLocalService) {
512 this.resourceLocalService = resourceLocalService;
513 }
514
515
520 public com.liferay.portal.service.UserLocalService getUserLocalService() {
521 return userLocalService;
522 }
523
524
529 public void setUserLocalService(
530 com.liferay.portal.service.UserLocalService userLocalService) {
531 this.userLocalService = userLocalService;
532 }
533
534
539 public com.liferay.portal.service.UserService getUserService() {
540 return userService;
541 }
542
543
548 public void setUserService(
549 com.liferay.portal.service.UserService userService) {
550 this.userService = userService;
551 }
552
553
558 public UserPersistence getUserPersistence() {
559 return userPersistence;
560 }
561
562
567 public void setUserPersistence(UserPersistence userPersistence) {
568 this.userPersistence = userPersistence;
569 }
570
571
576 public UserFinder getUserFinder() {
577 return userFinder;
578 }
579
580
585 public void setUserFinder(UserFinder userFinder) {
586 this.userFinder = userFinder;
587 }
588
589 public void afterPropertiesSet() {
590 persistedModelLocalServiceRegistry.register("com.liferay.portlet.expando.model.ExpandoColumn",
591 expandoColumnLocalService);
592 }
593
594 public void destroy() {
595 persistedModelLocalServiceRegistry.unregister(
596 "com.liferay.portlet.expando.model.ExpandoColumn");
597 }
598
599
604 @Override
605 public String getBeanIdentifier() {
606 return _beanIdentifier;
607 }
608
609
614 @Override
615 public void setBeanIdentifier(String beanIdentifier) {
616 _beanIdentifier = beanIdentifier;
617 }
618
619 protected Class<?> getModelClass() {
620 return ExpandoColumn.class;
621 }
622
623 protected String getModelClassName() {
624 return ExpandoColumn.class.getName();
625 }
626
627
632 protected void runSQL(String sql) throws SystemException {
633 try {
634 DataSource dataSource = expandoColumnPersistence.getDataSource();
635
636 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
637 sql, new int[0]);
638
639 sqlUpdate.update();
640 }
641 catch (Exception e) {
642 throw new SystemException(e);
643 }
644 }
645
646 @BeanReference(type = com.liferay.portlet.expando.service.ExpandoColumnLocalService.class)
647 protected com.liferay.portlet.expando.service.ExpandoColumnLocalService expandoColumnLocalService;
648 @BeanReference(type = com.liferay.portlet.expando.service.ExpandoColumnService.class)
649 protected com.liferay.portlet.expando.service.ExpandoColumnService expandoColumnService;
650 @BeanReference(type = ExpandoColumnPersistence.class)
651 protected ExpandoColumnPersistence expandoColumnPersistence;
652 @BeanReference(type = com.liferay.portlet.expando.service.ExpandoRowLocalService.class)
653 protected com.liferay.portlet.expando.service.ExpandoRowLocalService expandoRowLocalService;
654 @BeanReference(type = ExpandoRowPersistence.class)
655 protected ExpandoRowPersistence expandoRowPersistence;
656 @BeanReference(type = com.liferay.portlet.expando.service.ExpandoTableLocalService.class)
657 protected com.liferay.portlet.expando.service.ExpandoTableLocalService expandoTableLocalService;
658 @BeanReference(type = ExpandoTablePersistence.class)
659 protected ExpandoTablePersistence expandoTablePersistence;
660 @BeanReference(type = com.liferay.portlet.expando.service.ExpandoValueLocalService.class)
661 protected com.liferay.portlet.expando.service.ExpandoValueLocalService expandoValueLocalService;
662 @BeanReference(type = com.liferay.portlet.expando.service.ExpandoValueService.class)
663 protected com.liferay.portlet.expando.service.ExpandoValueService expandoValueService;
664 @BeanReference(type = ExpandoValuePersistence.class)
665 protected ExpandoValuePersistence expandoValuePersistence;
666 @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
667 protected com.liferay.counter.service.CounterLocalService counterLocalService;
668 @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
669 protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
670 @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
671 protected com.liferay.portal.service.UserLocalService userLocalService;
672 @BeanReference(type = com.liferay.portal.service.UserService.class)
673 protected com.liferay.portal.service.UserService userService;
674 @BeanReference(type = UserPersistence.class)
675 protected UserPersistence userPersistence;
676 @BeanReference(type = UserFinder.class)
677 protected UserFinder userFinder;
678 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
679 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
680 private String _beanIdentifier;
681 }