001
014
015 package com.liferay.portal.service.base;
016
017 import aQute.bnd.annotation.ProviderType;
018
019 import com.liferay.portal.kernel.bean.BeanReference;
020 import com.liferay.portal.kernel.bean.IdentifiableBean;
021 import com.liferay.portal.kernel.dao.db.DB;
022 import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
023 import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
024 import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
025 import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
026 import com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery;
027 import com.liferay.portal.kernel.dao.orm.DynamicQuery;
028 import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
029 import com.liferay.portal.kernel.dao.orm.Projection;
030 import com.liferay.portal.kernel.exception.PortalException;
031 import com.liferay.portal.kernel.exception.SystemException;
032 import com.liferay.portal.kernel.search.Indexable;
033 import com.liferay.portal.kernel.search.IndexableType;
034 import com.liferay.portal.kernel.util.OrderByComparator;
035 import com.liferay.portal.model.PersistedModel;
036 import com.liferay.portal.model.SystemEvent;
037 import com.liferay.portal.service.BaseLocalServiceImpl;
038 import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
039 import com.liferay.portal.service.SystemEventLocalService;
040 import com.liferay.portal.service.persistence.CompanyPersistence;
041 import com.liferay.portal.service.persistence.GroupFinder;
042 import com.liferay.portal.service.persistence.GroupPersistence;
043 import com.liferay.portal.service.persistence.SystemEventPersistence;
044 import com.liferay.portal.service.persistence.UserFinder;
045 import com.liferay.portal.service.persistence.UserPersistence;
046 import com.liferay.portal.util.PortalUtil;
047
048 import java.io.Serializable;
049
050 import java.util.List;
051
052 import javax.sql.DataSource;
053
054
066 @ProviderType
067 public abstract class SystemEventLocalServiceBaseImpl
068 extends BaseLocalServiceImpl implements SystemEventLocalService,
069 IdentifiableBean {
070
075
076
082 @Indexable(type = IndexableType.REINDEX)
083 @Override
084 public SystemEvent addSystemEvent(SystemEvent systemEvent) {
085 systemEvent.setNew(true);
086
087 return systemEventPersistence.update(systemEvent);
088 }
089
090
096 @Override
097 public SystemEvent createSystemEvent(long systemEventId) {
098 return systemEventPersistence.create(systemEventId);
099 }
100
101
108 @Indexable(type = IndexableType.DELETE)
109 @Override
110 public SystemEvent deleteSystemEvent(long systemEventId)
111 throws PortalException {
112 return systemEventPersistence.remove(systemEventId);
113 }
114
115
121 @Indexable(type = IndexableType.DELETE)
122 @Override
123 public SystemEvent deleteSystemEvent(SystemEvent systemEvent) {
124 return systemEventPersistence.remove(systemEvent);
125 }
126
127 @Override
128 public DynamicQuery dynamicQuery() {
129 Class<?> clazz = getClass();
130
131 return DynamicQueryFactoryUtil.forClass(SystemEvent.class,
132 clazz.getClassLoader());
133 }
134
135
141 @Override
142 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
143 return systemEventPersistence.findWithDynamicQuery(dynamicQuery);
144 }
145
146
158 @Override
159 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
160 int end) {
161 return systemEventPersistence.findWithDynamicQuery(dynamicQuery, start,
162 end);
163 }
164
165
178 @Override
179 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
180 int end, OrderByComparator<T> orderByComparator) {
181 return systemEventPersistence.findWithDynamicQuery(dynamicQuery, start,
182 end, orderByComparator);
183 }
184
185
191 @Override
192 public long dynamicQueryCount(DynamicQuery dynamicQuery) {
193 return systemEventPersistence.countWithDynamicQuery(dynamicQuery);
194 }
195
196
203 @Override
204 public long dynamicQueryCount(DynamicQuery dynamicQuery,
205 Projection projection) {
206 return systemEventPersistence.countWithDynamicQuery(dynamicQuery,
207 projection);
208 }
209
210 @Override
211 public SystemEvent fetchSystemEvent(long systemEventId) {
212 return systemEventPersistence.fetchByPrimaryKey(systemEventId);
213 }
214
215
222 @Override
223 public SystemEvent getSystemEvent(long systemEventId)
224 throws PortalException {
225 return systemEventPersistence.findByPrimaryKey(systemEventId);
226 }
227
228 @Override
229 public ActionableDynamicQuery getActionableDynamicQuery() {
230 ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
231
232 actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.SystemEventLocalServiceUtil.getService());
233 actionableDynamicQuery.setClass(SystemEvent.class);
234 actionableDynamicQuery.setClassLoader(getClassLoader());
235
236 actionableDynamicQuery.setPrimaryKeyPropertyName("systemEventId");
237
238 return actionableDynamicQuery;
239 }
240
241 protected void initActionableDynamicQuery(
242 ActionableDynamicQuery actionableDynamicQuery) {
243 actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.SystemEventLocalServiceUtil.getService());
244 actionableDynamicQuery.setClass(SystemEvent.class);
245 actionableDynamicQuery.setClassLoader(getClassLoader());
246
247 actionableDynamicQuery.setPrimaryKeyPropertyName("systemEventId");
248 }
249
250
253 @Override
254 public PersistedModel deletePersistedModel(PersistedModel persistedModel)
255 throws PortalException {
256 return systemEventLocalService.deleteSystemEvent((SystemEvent)persistedModel);
257 }
258
259 @Override
260 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
261 throws PortalException {
262 return systemEventPersistence.findByPrimaryKey(primaryKeyObj);
263 }
264
265
276 @Override
277 public List<SystemEvent> getSystemEvents(int start, int end) {
278 return systemEventPersistence.findAll(start, end);
279 }
280
281
286 @Override
287 public int getSystemEventsCount() {
288 return systemEventPersistence.countAll();
289 }
290
291
297 @Indexable(type = IndexableType.REINDEX)
298 @Override
299 public SystemEvent updateSystemEvent(SystemEvent systemEvent) {
300 return systemEventPersistence.update(systemEvent);
301 }
302
303
308 public SystemEventLocalService getSystemEventLocalService() {
309 return systemEventLocalService;
310 }
311
312
317 public void setSystemEventLocalService(
318 SystemEventLocalService systemEventLocalService) {
319 this.systemEventLocalService = systemEventLocalService;
320 }
321
322
327 public SystemEventPersistence getSystemEventPersistence() {
328 return systemEventPersistence;
329 }
330
331
336 public void setSystemEventPersistence(
337 SystemEventPersistence systemEventPersistence) {
338 this.systemEventPersistence = systemEventPersistence;
339 }
340
341
346 public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
347 return counterLocalService;
348 }
349
350
355 public void setCounterLocalService(
356 com.liferay.counter.service.CounterLocalService counterLocalService) {
357 this.counterLocalService = counterLocalService;
358 }
359
360
365 public com.liferay.portal.service.CompanyLocalService getCompanyLocalService() {
366 return companyLocalService;
367 }
368
369
374 public void setCompanyLocalService(
375 com.liferay.portal.service.CompanyLocalService companyLocalService) {
376 this.companyLocalService = companyLocalService;
377 }
378
379
384 public com.liferay.portal.service.CompanyService getCompanyService() {
385 return companyService;
386 }
387
388
393 public void setCompanyService(
394 com.liferay.portal.service.CompanyService companyService) {
395 this.companyService = companyService;
396 }
397
398
403 public CompanyPersistence getCompanyPersistence() {
404 return companyPersistence;
405 }
406
407
412 public void setCompanyPersistence(CompanyPersistence companyPersistence) {
413 this.companyPersistence = companyPersistence;
414 }
415
416
421 public com.liferay.portal.service.GroupLocalService getGroupLocalService() {
422 return groupLocalService;
423 }
424
425
430 public void setGroupLocalService(
431 com.liferay.portal.service.GroupLocalService groupLocalService) {
432 this.groupLocalService = groupLocalService;
433 }
434
435
440 public com.liferay.portal.service.GroupService getGroupService() {
441 return groupService;
442 }
443
444
449 public void setGroupService(
450 com.liferay.portal.service.GroupService groupService) {
451 this.groupService = groupService;
452 }
453
454
459 public GroupPersistence getGroupPersistence() {
460 return groupPersistence;
461 }
462
463
468 public void setGroupPersistence(GroupPersistence groupPersistence) {
469 this.groupPersistence = groupPersistence;
470 }
471
472
477 public GroupFinder getGroupFinder() {
478 return groupFinder;
479 }
480
481
486 public void setGroupFinder(GroupFinder groupFinder) {
487 this.groupFinder = groupFinder;
488 }
489
490
495 public com.liferay.portal.service.UserLocalService getUserLocalService() {
496 return userLocalService;
497 }
498
499
504 public void setUserLocalService(
505 com.liferay.portal.service.UserLocalService userLocalService) {
506 this.userLocalService = userLocalService;
507 }
508
509
514 public com.liferay.portal.service.UserService getUserService() {
515 return userService;
516 }
517
518
523 public void setUserService(
524 com.liferay.portal.service.UserService userService) {
525 this.userService = userService;
526 }
527
528
533 public UserPersistence getUserPersistence() {
534 return userPersistence;
535 }
536
537
542 public void setUserPersistence(UserPersistence userPersistence) {
543 this.userPersistence = userPersistence;
544 }
545
546
551 public UserFinder getUserFinder() {
552 return userFinder;
553 }
554
555
560 public void setUserFinder(UserFinder userFinder) {
561 this.userFinder = userFinder;
562 }
563
564 public void afterPropertiesSet() {
565 persistedModelLocalServiceRegistry.register("com.liferay.portal.model.SystemEvent",
566 systemEventLocalService);
567 }
568
569 public void destroy() {
570 persistedModelLocalServiceRegistry.unregister(
571 "com.liferay.portal.model.SystemEvent");
572 }
573
574
579 @Override
580 public String getBeanIdentifier() {
581 return _beanIdentifier;
582 }
583
584
589 @Override
590 public void setBeanIdentifier(String beanIdentifier) {
591 _beanIdentifier = beanIdentifier;
592 }
593
594 protected Class<?> getModelClass() {
595 return SystemEvent.class;
596 }
597
598 protected String getModelClassName() {
599 return SystemEvent.class.getName();
600 }
601
602
607 protected void runSQL(String sql) {
608 try {
609 DataSource dataSource = systemEventPersistence.getDataSource();
610
611 DB db = DBFactoryUtil.getDB();
612
613 sql = db.buildSQL(sql);
614 sql = PortalUtil.transformSQL(sql);
615
616 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
617 sql, new int[0]);
618
619 sqlUpdate.update();
620 }
621 catch (Exception e) {
622 throw new SystemException(e);
623 }
624 }
625
626 @BeanReference(type = SystemEventLocalService.class)
627 protected SystemEventLocalService systemEventLocalService;
628 @BeanReference(type = SystemEventPersistence.class)
629 protected SystemEventPersistence systemEventPersistence;
630 @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
631 protected com.liferay.counter.service.CounterLocalService counterLocalService;
632 @BeanReference(type = com.liferay.portal.service.CompanyLocalService.class)
633 protected com.liferay.portal.service.CompanyLocalService companyLocalService;
634 @BeanReference(type = com.liferay.portal.service.CompanyService.class)
635 protected com.liferay.portal.service.CompanyService companyService;
636 @BeanReference(type = CompanyPersistence.class)
637 protected CompanyPersistence companyPersistence;
638 @BeanReference(type = com.liferay.portal.service.GroupLocalService.class)
639 protected com.liferay.portal.service.GroupLocalService groupLocalService;
640 @BeanReference(type = com.liferay.portal.service.GroupService.class)
641 protected com.liferay.portal.service.GroupService groupService;
642 @BeanReference(type = GroupPersistence.class)
643 protected GroupPersistence groupPersistence;
644 @BeanReference(type = GroupFinder.class)
645 protected GroupFinder groupFinder;
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 }