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.UserFinder;
035 import com.liferay.portal.service.persistence.UserPersistence;
036
037 import com.liferay.portlet.trash.model.TrashEntry;
038 import com.liferay.portlet.trash.service.TrashEntryLocalService;
039 import com.liferay.portlet.trash.service.persistence.TrashEntryPersistence;
040 import com.liferay.portlet.trash.service.persistence.TrashVersionPersistence;
041
042 import java.io.Serializable;
043
044 import java.util.List;
045
046 import javax.sql.DataSource;
047
048
060 public abstract class TrashEntryLocalServiceBaseImpl
061 extends BaseLocalServiceImpl implements TrashEntryLocalService,
062 IdentifiableBean {
063
068
069
076 @Indexable(type = IndexableType.REINDEX)
077 @Override
078 public TrashEntry addTrashEntry(TrashEntry trashEntry)
079 throws SystemException {
080 trashEntry.setNew(true);
081
082 return trashEntryPersistence.update(trashEntry);
083 }
084
085
091 @Override
092 public TrashEntry createTrashEntry(long entryId) {
093 return trashEntryPersistence.create(entryId);
094 }
095
096
104 @Indexable(type = IndexableType.DELETE)
105 @Override
106 public TrashEntry deleteTrashEntry(long entryId)
107 throws PortalException, SystemException {
108 return trashEntryPersistence.remove(entryId);
109 }
110
111
118 @Indexable(type = IndexableType.DELETE)
119 @Override
120 public TrashEntry deleteTrashEntry(TrashEntry trashEntry)
121 throws SystemException {
122 return trashEntryPersistence.remove(trashEntry);
123 }
124
125 @Override
126 public DynamicQuery dynamicQuery() {
127 Class<?> clazz = getClass();
128
129 return DynamicQueryFactoryUtil.forClass(TrashEntry.class,
130 clazz.getClassLoader());
131 }
132
133
140 @Override
141 @SuppressWarnings("rawtypes")
142 public List dynamicQuery(DynamicQuery dynamicQuery)
143 throws SystemException {
144 return trashEntryPersistence.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 trashEntryPersistence.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 trashEntryPersistence.findWithDynamicQuery(dynamicQuery, start,
187 end, orderByComparator);
188 }
189
190
197 @Override
198 public long dynamicQueryCount(DynamicQuery dynamicQuery)
199 throws SystemException {
200 return trashEntryPersistence.countWithDynamicQuery(dynamicQuery);
201 }
202
203
211 @Override
212 public long dynamicQueryCount(DynamicQuery dynamicQuery,
213 Projection projection) throws SystemException {
214 return trashEntryPersistence.countWithDynamicQuery(dynamicQuery,
215 projection);
216 }
217
218 @Override
219 public TrashEntry fetchTrashEntry(long entryId) throws SystemException {
220 return trashEntryPersistence.fetchByPrimaryKey(entryId);
221 }
222
223
231 @Override
232 public TrashEntry getTrashEntry(long entryId)
233 throws PortalException, SystemException {
234 return trashEntryPersistence.findByPrimaryKey(entryId);
235 }
236
237 @Override
238 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
239 throws PortalException, SystemException {
240 return trashEntryPersistence.findByPrimaryKey(primaryKeyObj);
241 }
242
243
255 @Override
256 public List<TrashEntry> getTrashEntries(int start, int end)
257 throws SystemException {
258 return trashEntryPersistence.findAll(start, end);
259 }
260
261
267 @Override
268 public int getTrashEntriesCount() throws SystemException {
269 return trashEntryPersistence.countAll();
270 }
271
272
279 @Indexable(type = IndexableType.REINDEX)
280 @Override
281 public TrashEntry updateTrashEntry(TrashEntry trashEntry)
282 throws SystemException {
283 return trashEntryPersistence.update(trashEntry);
284 }
285
286
291 public com.liferay.portlet.trash.service.TrashEntryLocalService getTrashEntryLocalService() {
292 return trashEntryLocalService;
293 }
294
295
300 public void setTrashEntryLocalService(
301 com.liferay.portlet.trash.service.TrashEntryLocalService trashEntryLocalService) {
302 this.trashEntryLocalService = trashEntryLocalService;
303 }
304
305
310 public com.liferay.portlet.trash.service.TrashEntryService getTrashEntryService() {
311 return trashEntryService;
312 }
313
314
319 public void setTrashEntryService(
320 com.liferay.portlet.trash.service.TrashEntryService trashEntryService) {
321 this.trashEntryService = trashEntryService;
322 }
323
324
329 public TrashEntryPersistence getTrashEntryPersistence() {
330 return trashEntryPersistence;
331 }
332
333
338 public void setTrashEntryPersistence(
339 TrashEntryPersistence trashEntryPersistence) {
340 this.trashEntryPersistence = trashEntryPersistence;
341 }
342
343
348 public com.liferay.portlet.trash.service.TrashVersionLocalService getTrashVersionLocalService() {
349 return trashVersionLocalService;
350 }
351
352
357 public void setTrashVersionLocalService(
358 com.liferay.portlet.trash.service.TrashVersionLocalService trashVersionLocalService) {
359 this.trashVersionLocalService = trashVersionLocalService;
360 }
361
362
367 public TrashVersionPersistence getTrashVersionPersistence() {
368 return trashVersionPersistence;
369 }
370
371
376 public void setTrashVersionPersistence(
377 TrashVersionPersistence trashVersionPersistence) {
378 this.trashVersionPersistence = trashVersionPersistence;
379 }
380
381
386 public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
387 return counterLocalService;
388 }
389
390
395 public void setCounterLocalService(
396 com.liferay.counter.service.CounterLocalService counterLocalService) {
397 this.counterLocalService = counterLocalService;
398 }
399
400
405 public com.liferay.portal.service.GroupLocalService getGroupLocalService() {
406 return groupLocalService;
407 }
408
409
414 public void setGroupLocalService(
415 com.liferay.portal.service.GroupLocalService groupLocalService) {
416 this.groupLocalService = groupLocalService;
417 }
418
419
424 public com.liferay.portal.service.GroupService getGroupService() {
425 return groupService;
426 }
427
428
433 public void setGroupService(
434 com.liferay.portal.service.GroupService groupService) {
435 this.groupService = groupService;
436 }
437
438
443 public GroupPersistence getGroupPersistence() {
444 return groupPersistence;
445 }
446
447
452 public void setGroupPersistence(GroupPersistence groupPersistence) {
453 this.groupPersistence = groupPersistence;
454 }
455
456
461 public GroupFinder getGroupFinder() {
462 return groupFinder;
463 }
464
465
470 public void setGroupFinder(GroupFinder groupFinder) {
471 this.groupFinder = groupFinder;
472 }
473
474
479 public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
480 return resourceLocalService;
481 }
482
483
488 public void setResourceLocalService(
489 com.liferay.portal.service.ResourceLocalService resourceLocalService) {
490 this.resourceLocalService = resourceLocalService;
491 }
492
493
498 public com.liferay.portal.service.UserLocalService getUserLocalService() {
499 return userLocalService;
500 }
501
502
507 public void setUserLocalService(
508 com.liferay.portal.service.UserLocalService userLocalService) {
509 this.userLocalService = userLocalService;
510 }
511
512
517 public com.liferay.portal.service.UserService getUserService() {
518 return userService;
519 }
520
521
526 public void setUserService(
527 com.liferay.portal.service.UserService userService) {
528 this.userService = userService;
529 }
530
531
536 public UserPersistence getUserPersistence() {
537 return userPersistence;
538 }
539
540
545 public void setUserPersistence(UserPersistence userPersistence) {
546 this.userPersistence = userPersistence;
547 }
548
549
554 public UserFinder getUserFinder() {
555 return userFinder;
556 }
557
558
563 public void setUserFinder(UserFinder userFinder) {
564 this.userFinder = userFinder;
565 }
566
567 public void afterPropertiesSet() {
568 persistedModelLocalServiceRegistry.register("com.liferay.portlet.trash.model.TrashEntry",
569 trashEntryLocalService);
570 }
571
572 public void destroy() {
573 persistedModelLocalServiceRegistry.unregister(
574 "com.liferay.portlet.trash.model.TrashEntry");
575 }
576
577
582 @Override
583 public String getBeanIdentifier() {
584 return _beanIdentifier;
585 }
586
587
592 @Override
593 public void setBeanIdentifier(String beanIdentifier) {
594 _beanIdentifier = beanIdentifier;
595 }
596
597 protected Class<?> getModelClass() {
598 return TrashEntry.class;
599 }
600
601 protected String getModelClassName() {
602 return TrashEntry.class.getName();
603 }
604
605
610 protected void runSQL(String sql) throws SystemException {
611 try {
612 DataSource dataSource = trashEntryPersistence.getDataSource();
613
614 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
615 sql, new int[0]);
616
617 sqlUpdate.update();
618 }
619 catch (Exception e) {
620 throw new SystemException(e);
621 }
622 }
623
624 @BeanReference(type = com.liferay.portlet.trash.service.TrashEntryLocalService.class)
625 protected com.liferay.portlet.trash.service.TrashEntryLocalService trashEntryLocalService;
626 @BeanReference(type = com.liferay.portlet.trash.service.TrashEntryService.class)
627 protected com.liferay.portlet.trash.service.TrashEntryService trashEntryService;
628 @BeanReference(type = TrashEntryPersistence.class)
629 protected TrashEntryPersistence trashEntryPersistence;
630 @BeanReference(type = com.liferay.portlet.trash.service.TrashVersionLocalService.class)
631 protected com.liferay.portlet.trash.service.TrashVersionLocalService trashVersionLocalService;
632 @BeanReference(type = TrashVersionPersistence.class)
633 protected TrashVersionPersistence trashVersionPersistence;
634 @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
635 protected com.liferay.counter.service.CounterLocalService counterLocalService;
636 @BeanReference(type = com.liferay.portal.service.GroupLocalService.class)
637 protected com.liferay.portal.service.GroupLocalService groupLocalService;
638 @BeanReference(type = com.liferay.portal.service.GroupService.class)
639 protected com.liferay.portal.service.GroupService groupService;
640 @BeanReference(type = GroupPersistence.class)
641 protected GroupPersistence groupPersistence;
642 @BeanReference(type = GroupFinder.class)
643 protected GroupFinder groupFinder;
644 @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
645 protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
646 @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
647 protected com.liferay.portal.service.UserLocalService userLocalService;
648 @BeanReference(type = com.liferay.portal.service.UserService.class)
649 protected com.liferay.portal.service.UserService userService;
650 @BeanReference(type = UserPersistence.class)
651 protected UserPersistence userPersistence;
652 @BeanReference(type = UserFinder.class)
653 protected UserFinder userFinder;
654 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
655 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
656 private String _beanIdentifier;
657 }