001
014
015 package com.liferay.portlet.trash.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.GroupFinder;
033 import com.liferay.portal.service.persistence.GroupPersistence;
034 import com.liferay.portal.service.persistence.SystemEventPersistence;
035 import com.liferay.portal.service.persistence.UserFinder;
036 import com.liferay.portal.service.persistence.UserPersistence;
037
038 import com.liferay.portlet.trash.model.TrashEntry;
039 import com.liferay.portlet.trash.service.TrashEntryLocalService;
040 import com.liferay.portlet.trash.service.persistence.TrashEntryPersistence;
041 import com.liferay.portlet.trash.service.persistence.TrashVersionPersistence;
042
043 import java.io.Serializable;
044
045 import java.util.List;
046
047 import javax.sql.DataSource;
048
049
061 public abstract class TrashEntryLocalServiceBaseImpl
062 extends BaseLocalServiceImpl implements TrashEntryLocalService,
063 IdentifiableBean {
064
069
070
077 @Indexable(type = IndexableType.REINDEX)
078 @Override
079 public TrashEntry addTrashEntry(TrashEntry trashEntry)
080 throws SystemException {
081 trashEntry.setNew(true);
082
083 return trashEntryPersistence.update(trashEntry);
084 }
085
086
092 @Override
093 public TrashEntry createTrashEntry(long entryId) {
094 return trashEntryPersistence.create(entryId);
095 }
096
097
105 @Indexable(type = IndexableType.DELETE)
106 @Override
107 public TrashEntry deleteTrashEntry(long entryId)
108 throws PortalException, SystemException {
109 return trashEntryPersistence.remove(entryId);
110 }
111
112
119 @Indexable(type = IndexableType.DELETE)
120 @Override
121 public TrashEntry deleteTrashEntry(TrashEntry trashEntry)
122 throws SystemException {
123 return trashEntryPersistence.remove(trashEntry);
124 }
125
126 @Override
127 public DynamicQuery dynamicQuery() {
128 Class<?> clazz = getClass();
129
130 return DynamicQueryFactoryUtil.forClass(TrashEntry.class,
131 clazz.getClassLoader());
132 }
133
134
141 @Override
142 @SuppressWarnings("rawtypes")
143 public List dynamicQuery(DynamicQuery dynamicQuery)
144 throws SystemException {
145 return trashEntryPersistence.findWithDynamicQuery(dynamicQuery);
146 }
147
148
161 @Override
162 @SuppressWarnings("rawtypes")
163 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
164 throws SystemException {
165 return trashEntryPersistence.findWithDynamicQuery(dynamicQuery, start,
166 end);
167 }
168
169
183 @Override
184 @SuppressWarnings("rawtypes")
185 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
186 OrderByComparator orderByComparator) throws SystemException {
187 return trashEntryPersistence.findWithDynamicQuery(dynamicQuery, start,
188 end, orderByComparator);
189 }
190
191
198 @Override
199 public long dynamicQueryCount(DynamicQuery dynamicQuery)
200 throws SystemException {
201 return trashEntryPersistence.countWithDynamicQuery(dynamicQuery);
202 }
203
204
212 @Override
213 public long dynamicQueryCount(DynamicQuery dynamicQuery,
214 Projection projection) throws SystemException {
215 return trashEntryPersistence.countWithDynamicQuery(dynamicQuery,
216 projection);
217 }
218
219 @Override
220 public TrashEntry fetchTrashEntry(long entryId) throws SystemException {
221 return trashEntryPersistence.fetchByPrimaryKey(entryId);
222 }
223
224
232 @Override
233 public TrashEntry getTrashEntry(long entryId)
234 throws PortalException, SystemException {
235 return trashEntryPersistence.findByPrimaryKey(entryId);
236 }
237
238 @Override
239 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
240 throws PortalException, SystemException {
241 return trashEntryPersistence.findByPrimaryKey(primaryKeyObj);
242 }
243
244
256 @Override
257 public List<TrashEntry> getTrashEntries(int start, int end)
258 throws SystemException {
259 return trashEntryPersistence.findAll(start, end);
260 }
261
262
268 @Override
269 public int getTrashEntriesCount() throws SystemException {
270 return trashEntryPersistence.countAll();
271 }
272
273
280 @Indexable(type = IndexableType.REINDEX)
281 @Override
282 public TrashEntry updateTrashEntry(TrashEntry trashEntry)
283 throws SystemException {
284 return trashEntryPersistence.update(trashEntry);
285 }
286
287
292 public com.liferay.portlet.trash.service.TrashEntryLocalService getTrashEntryLocalService() {
293 return trashEntryLocalService;
294 }
295
296
301 public void setTrashEntryLocalService(
302 com.liferay.portlet.trash.service.TrashEntryLocalService trashEntryLocalService) {
303 this.trashEntryLocalService = trashEntryLocalService;
304 }
305
306
311 public com.liferay.portlet.trash.service.TrashEntryService getTrashEntryService() {
312 return trashEntryService;
313 }
314
315
320 public void setTrashEntryService(
321 com.liferay.portlet.trash.service.TrashEntryService trashEntryService) {
322 this.trashEntryService = trashEntryService;
323 }
324
325
330 public TrashEntryPersistence getTrashEntryPersistence() {
331 return trashEntryPersistence;
332 }
333
334
339 public void setTrashEntryPersistence(
340 TrashEntryPersistence trashEntryPersistence) {
341 this.trashEntryPersistence = trashEntryPersistence;
342 }
343
344
349 public com.liferay.portlet.trash.service.TrashVersionLocalService getTrashVersionLocalService() {
350 return trashVersionLocalService;
351 }
352
353
358 public void setTrashVersionLocalService(
359 com.liferay.portlet.trash.service.TrashVersionLocalService trashVersionLocalService) {
360 this.trashVersionLocalService = trashVersionLocalService;
361 }
362
363
368 public TrashVersionPersistence getTrashVersionPersistence() {
369 return trashVersionPersistence;
370 }
371
372
377 public void setTrashVersionPersistence(
378 TrashVersionPersistence trashVersionPersistence) {
379 this.trashVersionPersistence = trashVersionPersistence;
380 }
381
382
387 public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
388 return counterLocalService;
389 }
390
391
396 public void setCounterLocalService(
397 com.liferay.counter.service.CounterLocalService counterLocalService) {
398 this.counterLocalService = counterLocalService;
399 }
400
401
406 public com.liferay.portal.service.GroupLocalService getGroupLocalService() {
407 return groupLocalService;
408 }
409
410
415 public void setGroupLocalService(
416 com.liferay.portal.service.GroupLocalService groupLocalService) {
417 this.groupLocalService = groupLocalService;
418 }
419
420
425 public com.liferay.portal.service.GroupService getGroupService() {
426 return groupService;
427 }
428
429
434 public void setGroupService(
435 com.liferay.portal.service.GroupService groupService) {
436 this.groupService = groupService;
437 }
438
439
444 public GroupPersistence getGroupPersistence() {
445 return groupPersistence;
446 }
447
448
453 public void setGroupPersistence(GroupPersistence groupPersistence) {
454 this.groupPersistence = groupPersistence;
455 }
456
457
462 public GroupFinder getGroupFinder() {
463 return groupFinder;
464 }
465
466
471 public void setGroupFinder(GroupFinder groupFinder) {
472 this.groupFinder = groupFinder;
473 }
474
475
480 public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
481 return resourceLocalService;
482 }
483
484
489 public void setResourceLocalService(
490 com.liferay.portal.service.ResourceLocalService resourceLocalService) {
491 this.resourceLocalService = resourceLocalService;
492 }
493
494
499 public com.liferay.portal.service.SystemEventLocalService getSystemEventLocalService() {
500 return systemEventLocalService;
501 }
502
503
508 public void setSystemEventLocalService(
509 com.liferay.portal.service.SystemEventLocalService systemEventLocalService) {
510 this.systemEventLocalService = systemEventLocalService;
511 }
512
513
518 public SystemEventPersistence getSystemEventPersistence() {
519 return systemEventPersistence;
520 }
521
522
527 public void setSystemEventPersistence(
528 SystemEventPersistence systemEventPersistence) {
529 this.systemEventPersistence = systemEventPersistence;
530 }
531
532
537 public com.liferay.portal.service.UserLocalService getUserLocalService() {
538 return userLocalService;
539 }
540
541
546 public void setUserLocalService(
547 com.liferay.portal.service.UserLocalService userLocalService) {
548 this.userLocalService = userLocalService;
549 }
550
551
556 public com.liferay.portal.service.UserService getUserService() {
557 return userService;
558 }
559
560
565 public void setUserService(
566 com.liferay.portal.service.UserService userService) {
567 this.userService = userService;
568 }
569
570
575 public UserPersistence getUserPersistence() {
576 return userPersistence;
577 }
578
579
584 public void setUserPersistence(UserPersistence userPersistence) {
585 this.userPersistence = userPersistence;
586 }
587
588
593 public UserFinder getUserFinder() {
594 return userFinder;
595 }
596
597
602 public void setUserFinder(UserFinder userFinder) {
603 this.userFinder = userFinder;
604 }
605
606 public void afterPropertiesSet() {
607 persistedModelLocalServiceRegistry.register("com.liferay.portlet.trash.model.TrashEntry",
608 trashEntryLocalService);
609 }
610
611 public void destroy() {
612 persistedModelLocalServiceRegistry.unregister(
613 "com.liferay.portlet.trash.model.TrashEntry");
614 }
615
616
621 @Override
622 public String getBeanIdentifier() {
623 return _beanIdentifier;
624 }
625
626
631 @Override
632 public void setBeanIdentifier(String beanIdentifier) {
633 _beanIdentifier = beanIdentifier;
634 }
635
636 protected Class<?> getModelClass() {
637 return TrashEntry.class;
638 }
639
640 protected String getModelClassName() {
641 return TrashEntry.class.getName();
642 }
643
644
649 protected void runSQL(String sql) throws SystemException {
650 try {
651 DataSource dataSource = trashEntryPersistence.getDataSource();
652
653 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
654 sql, new int[0]);
655
656 sqlUpdate.update();
657 }
658 catch (Exception e) {
659 throw new SystemException(e);
660 }
661 }
662
663 @BeanReference(type = com.liferay.portlet.trash.service.TrashEntryLocalService.class)
664 protected com.liferay.portlet.trash.service.TrashEntryLocalService trashEntryLocalService;
665 @BeanReference(type = com.liferay.portlet.trash.service.TrashEntryService.class)
666 protected com.liferay.portlet.trash.service.TrashEntryService trashEntryService;
667 @BeanReference(type = TrashEntryPersistence.class)
668 protected TrashEntryPersistence trashEntryPersistence;
669 @BeanReference(type = com.liferay.portlet.trash.service.TrashVersionLocalService.class)
670 protected com.liferay.portlet.trash.service.TrashVersionLocalService trashVersionLocalService;
671 @BeanReference(type = TrashVersionPersistence.class)
672 protected TrashVersionPersistence trashVersionPersistence;
673 @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
674 protected com.liferay.counter.service.CounterLocalService counterLocalService;
675 @BeanReference(type = com.liferay.portal.service.GroupLocalService.class)
676 protected com.liferay.portal.service.GroupLocalService groupLocalService;
677 @BeanReference(type = com.liferay.portal.service.GroupService.class)
678 protected com.liferay.portal.service.GroupService groupService;
679 @BeanReference(type = GroupPersistence.class)
680 protected GroupPersistence groupPersistence;
681 @BeanReference(type = GroupFinder.class)
682 protected GroupFinder groupFinder;
683 @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
684 protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
685 @BeanReference(type = com.liferay.portal.service.SystemEventLocalService.class)
686 protected com.liferay.portal.service.SystemEventLocalService systemEventLocalService;
687 @BeanReference(type = SystemEventPersistence.class)
688 protected SystemEventPersistence systemEventPersistence;
689 @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
690 protected com.liferay.portal.service.UserLocalService userLocalService;
691 @BeanReference(type = com.liferay.portal.service.UserService.class)
692 protected com.liferay.portal.service.UserService userService;
693 @BeanReference(type = UserPersistence.class)
694 protected UserPersistence userPersistence;
695 @BeanReference(type = UserFinder.class)
696 protected UserFinder userFinder;
697 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
698 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
699 private String _beanIdentifier;
700 }