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 TrashVersionPersistence getTrashVersionPersistence() {
349 return trashVersionPersistence;
350 }
351
352
357 public void setTrashVersionPersistence(
358 TrashVersionPersistence trashVersionPersistence) {
359 this.trashVersionPersistence = trashVersionPersistence;
360 }
361
362
367 public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
368 return counterLocalService;
369 }
370
371
376 public void setCounterLocalService(
377 com.liferay.counter.service.CounterLocalService counterLocalService) {
378 this.counterLocalService = counterLocalService;
379 }
380
381
386 public com.liferay.portal.service.GroupLocalService getGroupLocalService() {
387 return groupLocalService;
388 }
389
390
395 public void setGroupLocalService(
396 com.liferay.portal.service.GroupLocalService groupLocalService) {
397 this.groupLocalService = groupLocalService;
398 }
399
400
405 public com.liferay.portal.service.GroupService getGroupService() {
406 return groupService;
407 }
408
409
414 public void setGroupService(
415 com.liferay.portal.service.GroupService groupService) {
416 this.groupService = groupService;
417 }
418
419
424 public GroupPersistence getGroupPersistence() {
425 return groupPersistence;
426 }
427
428
433 public void setGroupPersistence(GroupPersistence groupPersistence) {
434 this.groupPersistence = groupPersistence;
435 }
436
437
442 public GroupFinder getGroupFinder() {
443 return groupFinder;
444 }
445
446
451 public void setGroupFinder(GroupFinder groupFinder) {
452 this.groupFinder = groupFinder;
453 }
454
455
460 public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
461 return resourceLocalService;
462 }
463
464
469 public void setResourceLocalService(
470 com.liferay.portal.service.ResourceLocalService resourceLocalService) {
471 this.resourceLocalService = resourceLocalService;
472 }
473
474
479 public com.liferay.portal.service.UserLocalService getUserLocalService() {
480 return userLocalService;
481 }
482
483
488 public void setUserLocalService(
489 com.liferay.portal.service.UserLocalService userLocalService) {
490 this.userLocalService = userLocalService;
491 }
492
493
498 public com.liferay.portal.service.UserService getUserService() {
499 return userService;
500 }
501
502
507 public void setUserService(
508 com.liferay.portal.service.UserService userService) {
509 this.userService = userService;
510 }
511
512
517 public UserPersistence getUserPersistence() {
518 return userPersistence;
519 }
520
521
526 public void setUserPersistence(UserPersistence userPersistence) {
527 this.userPersistence = userPersistence;
528 }
529
530
535 public UserFinder getUserFinder() {
536 return userFinder;
537 }
538
539
544 public void setUserFinder(UserFinder userFinder) {
545 this.userFinder = userFinder;
546 }
547
548 public void afterPropertiesSet() {
549 persistedModelLocalServiceRegistry.register("com.liferay.portlet.trash.model.TrashEntry",
550 trashEntryLocalService);
551 }
552
553 public void destroy() {
554 persistedModelLocalServiceRegistry.unregister(
555 "com.liferay.portlet.trash.model.TrashEntry");
556 }
557
558
563 @Override
564 public String getBeanIdentifier() {
565 return _beanIdentifier;
566 }
567
568
573 @Override
574 public void setBeanIdentifier(String beanIdentifier) {
575 _beanIdentifier = beanIdentifier;
576 }
577
578 protected Class<?> getModelClass() {
579 return TrashEntry.class;
580 }
581
582 protected String getModelClassName() {
583 return TrashEntry.class.getName();
584 }
585
586
591 protected void runSQL(String sql) throws SystemException {
592 try {
593 DataSource dataSource = trashEntryPersistence.getDataSource();
594
595 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
596 sql, new int[0]);
597
598 sqlUpdate.update();
599 }
600 catch (Exception e) {
601 throw new SystemException(e);
602 }
603 }
604
605 @BeanReference(type = com.liferay.portlet.trash.service.TrashEntryLocalService.class)
606 protected com.liferay.portlet.trash.service.TrashEntryLocalService trashEntryLocalService;
607 @BeanReference(type = com.liferay.portlet.trash.service.TrashEntryService.class)
608 protected com.liferay.portlet.trash.service.TrashEntryService trashEntryService;
609 @BeanReference(type = TrashEntryPersistence.class)
610 protected TrashEntryPersistence trashEntryPersistence;
611 @BeanReference(type = TrashVersionPersistence.class)
612 protected TrashVersionPersistence trashVersionPersistence;
613 @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
614 protected com.liferay.counter.service.CounterLocalService counterLocalService;
615 @BeanReference(type = com.liferay.portal.service.GroupLocalService.class)
616 protected com.liferay.portal.service.GroupLocalService groupLocalService;
617 @BeanReference(type = com.liferay.portal.service.GroupService.class)
618 protected com.liferay.portal.service.GroupService groupService;
619 @BeanReference(type = GroupPersistence.class)
620 protected GroupPersistence groupPersistence;
621 @BeanReference(type = GroupFinder.class)
622 protected GroupFinder groupFinder;
623 @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
624 protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
625 @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
626 protected com.liferay.portal.service.UserLocalService userLocalService;
627 @BeanReference(type = com.liferay.portal.service.UserService.class)
628 protected com.liferay.portal.service.UserService userService;
629 @BeanReference(type = UserPersistence.class)
630 protected UserPersistence userPersistence;
631 @BeanReference(type = UserFinder.class)
632 protected UserFinder userFinder;
633 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
634 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
635 private String _beanIdentifier;
636 }