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.WorkflowDefinitionLink;
037 import com.liferay.portal.service.BaseLocalServiceImpl;
038 import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
039 import com.liferay.portal.service.WorkflowDefinitionLinkLocalService;
040 import com.liferay.portal.service.persistence.ClassNamePersistence;
041 import com.liferay.portal.service.persistence.SubscriptionPersistence;
042 import com.liferay.portal.service.persistence.UserFinder;
043 import com.liferay.portal.service.persistence.UserPersistence;
044 import com.liferay.portal.service.persistence.WorkflowDefinitionLinkPersistence;
045 import com.liferay.portal.util.PortalUtil;
046
047 import java.io.Serializable;
048
049 import java.util.List;
050
051 import javax.sql.DataSource;
052
053
065 @ProviderType
066 public abstract class WorkflowDefinitionLinkLocalServiceBaseImpl
067 extends BaseLocalServiceImpl implements WorkflowDefinitionLinkLocalService,
068 IdentifiableBean {
069
074
075
081 @Indexable(type = IndexableType.REINDEX)
082 @Override
083 public WorkflowDefinitionLink addWorkflowDefinitionLink(
084 WorkflowDefinitionLink workflowDefinitionLink) {
085 workflowDefinitionLink.setNew(true);
086
087 return workflowDefinitionLinkPersistence.update(workflowDefinitionLink);
088 }
089
090
096 @Override
097 public WorkflowDefinitionLink createWorkflowDefinitionLink(
098 long workflowDefinitionLinkId) {
099 return workflowDefinitionLinkPersistence.create(workflowDefinitionLinkId);
100 }
101
102
109 @Indexable(type = IndexableType.DELETE)
110 @Override
111 public WorkflowDefinitionLink deleteWorkflowDefinitionLink(
112 long workflowDefinitionLinkId) throws PortalException {
113 return workflowDefinitionLinkPersistence.remove(workflowDefinitionLinkId);
114 }
115
116
122 @Indexable(type = IndexableType.DELETE)
123 @Override
124 public WorkflowDefinitionLink deleteWorkflowDefinitionLink(
125 WorkflowDefinitionLink workflowDefinitionLink) {
126 return workflowDefinitionLinkPersistence.remove(workflowDefinitionLink);
127 }
128
129 @Override
130 public DynamicQuery dynamicQuery() {
131 Class<?> clazz = getClass();
132
133 return DynamicQueryFactoryUtil.forClass(WorkflowDefinitionLink.class,
134 clazz.getClassLoader());
135 }
136
137
143 @Override
144 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
145 return workflowDefinitionLinkPersistence.findWithDynamicQuery(dynamicQuery);
146 }
147
148
160 @Override
161 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
162 int end) {
163 return workflowDefinitionLinkPersistence.findWithDynamicQuery(dynamicQuery,
164 start, end);
165 }
166
167
180 @Override
181 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
182 int end, OrderByComparator<T> orderByComparator) {
183 return workflowDefinitionLinkPersistence.findWithDynamicQuery(dynamicQuery,
184 start, end, orderByComparator);
185 }
186
187
193 @Override
194 public long dynamicQueryCount(DynamicQuery dynamicQuery) {
195 return workflowDefinitionLinkPersistence.countWithDynamicQuery(dynamicQuery);
196 }
197
198
205 @Override
206 public long dynamicQueryCount(DynamicQuery dynamicQuery,
207 Projection projection) {
208 return workflowDefinitionLinkPersistence.countWithDynamicQuery(dynamicQuery,
209 projection);
210 }
211
212 @Override
213 public WorkflowDefinitionLink fetchWorkflowDefinitionLink(
214 long workflowDefinitionLinkId) {
215 return workflowDefinitionLinkPersistence.fetchByPrimaryKey(workflowDefinitionLinkId);
216 }
217
218
225 @Override
226 public WorkflowDefinitionLink getWorkflowDefinitionLink(
227 long workflowDefinitionLinkId) throws PortalException {
228 return workflowDefinitionLinkPersistence.findByPrimaryKey(workflowDefinitionLinkId);
229 }
230
231 @Override
232 public ActionableDynamicQuery getActionableDynamicQuery() {
233 ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
234
235 actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.WorkflowDefinitionLinkLocalServiceUtil.getService());
236 actionableDynamicQuery.setClass(WorkflowDefinitionLink.class);
237 actionableDynamicQuery.setClassLoader(getClassLoader());
238
239 actionableDynamicQuery.setPrimaryKeyPropertyName(
240 "workflowDefinitionLinkId");
241
242 return actionableDynamicQuery;
243 }
244
245 protected void initActionableDynamicQuery(
246 ActionableDynamicQuery actionableDynamicQuery) {
247 actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.WorkflowDefinitionLinkLocalServiceUtil.getService());
248 actionableDynamicQuery.setClass(WorkflowDefinitionLink.class);
249 actionableDynamicQuery.setClassLoader(getClassLoader());
250
251 actionableDynamicQuery.setPrimaryKeyPropertyName(
252 "workflowDefinitionLinkId");
253 }
254
255
258 @Override
259 public PersistedModel deletePersistedModel(PersistedModel persistedModel)
260 throws PortalException {
261 return workflowDefinitionLinkLocalService.deleteWorkflowDefinitionLink((WorkflowDefinitionLink)persistedModel);
262 }
263
264 @Override
265 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
266 throws PortalException {
267 return workflowDefinitionLinkPersistence.findByPrimaryKey(primaryKeyObj);
268 }
269
270
281 @Override
282 public List<WorkflowDefinitionLink> getWorkflowDefinitionLinks(int start,
283 int end) {
284 return workflowDefinitionLinkPersistence.findAll(start, end);
285 }
286
287
292 @Override
293 public int getWorkflowDefinitionLinksCount() {
294 return workflowDefinitionLinkPersistence.countAll();
295 }
296
297
303 @Indexable(type = IndexableType.REINDEX)
304 @Override
305 public WorkflowDefinitionLink updateWorkflowDefinitionLink(
306 WorkflowDefinitionLink workflowDefinitionLink) {
307 return workflowDefinitionLinkPersistence.update(workflowDefinitionLink);
308 }
309
310
315 public WorkflowDefinitionLinkLocalService getWorkflowDefinitionLinkLocalService() {
316 return workflowDefinitionLinkLocalService;
317 }
318
319
324 public void setWorkflowDefinitionLinkLocalService(
325 WorkflowDefinitionLinkLocalService workflowDefinitionLinkLocalService) {
326 this.workflowDefinitionLinkLocalService = workflowDefinitionLinkLocalService;
327 }
328
329
334 public WorkflowDefinitionLinkPersistence getWorkflowDefinitionLinkPersistence() {
335 return workflowDefinitionLinkPersistence;
336 }
337
338
343 public void setWorkflowDefinitionLinkPersistence(
344 WorkflowDefinitionLinkPersistence workflowDefinitionLinkPersistence) {
345 this.workflowDefinitionLinkPersistence = workflowDefinitionLinkPersistence;
346 }
347
348
353 public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
354 return counterLocalService;
355 }
356
357
362 public void setCounterLocalService(
363 com.liferay.counter.service.CounterLocalService counterLocalService) {
364 this.counterLocalService = counterLocalService;
365 }
366
367
372 public com.liferay.portal.service.ClassNameLocalService getClassNameLocalService() {
373 return classNameLocalService;
374 }
375
376
381 public void setClassNameLocalService(
382 com.liferay.portal.service.ClassNameLocalService classNameLocalService) {
383 this.classNameLocalService = classNameLocalService;
384 }
385
386
391 public com.liferay.portal.service.ClassNameService getClassNameService() {
392 return classNameService;
393 }
394
395
400 public void setClassNameService(
401 com.liferay.portal.service.ClassNameService classNameService) {
402 this.classNameService = classNameService;
403 }
404
405
410 public ClassNamePersistence getClassNamePersistence() {
411 return classNamePersistence;
412 }
413
414
419 public void setClassNamePersistence(
420 ClassNamePersistence classNamePersistence) {
421 this.classNamePersistence = classNamePersistence;
422 }
423
424
429 public com.liferay.portal.service.SubscriptionLocalService getSubscriptionLocalService() {
430 return subscriptionLocalService;
431 }
432
433
438 public void setSubscriptionLocalService(
439 com.liferay.portal.service.SubscriptionLocalService subscriptionLocalService) {
440 this.subscriptionLocalService = subscriptionLocalService;
441 }
442
443
448 public SubscriptionPersistence getSubscriptionPersistence() {
449 return subscriptionPersistence;
450 }
451
452
457 public void setSubscriptionPersistence(
458 SubscriptionPersistence subscriptionPersistence) {
459 this.subscriptionPersistence = subscriptionPersistence;
460 }
461
462
467 public com.liferay.portal.service.UserLocalService getUserLocalService() {
468 return userLocalService;
469 }
470
471
476 public void setUserLocalService(
477 com.liferay.portal.service.UserLocalService userLocalService) {
478 this.userLocalService = userLocalService;
479 }
480
481
486 public com.liferay.portal.service.UserService getUserService() {
487 return userService;
488 }
489
490
495 public void setUserService(
496 com.liferay.portal.service.UserService userService) {
497 this.userService = userService;
498 }
499
500
505 public UserPersistence getUserPersistence() {
506 return userPersistence;
507 }
508
509
514 public void setUserPersistence(UserPersistence userPersistence) {
515 this.userPersistence = userPersistence;
516 }
517
518
523 public UserFinder getUserFinder() {
524 return userFinder;
525 }
526
527
532 public void setUserFinder(UserFinder userFinder) {
533 this.userFinder = userFinder;
534 }
535
536 public void afterPropertiesSet() {
537 persistedModelLocalServiceRegistry.register("com.liferay.portal.model.WorkflowDefinitionLink",
538 workflowDefinitionLinkLocalService);
539 }
540
541 public void destroy() {
542 persistedModelLocalServiceRegistry.unregister(
543 "com.liferay.portal.model.WorkflowDefinitionLink");
544 }
545
546
551 @Override
552 public String getBeanIdentifier() {
553 return _beanIdentifier;
554 }
555
556
561 @Override
562 public void setBeanIdentifier(String beanIdentifier) {
563 _beanIdentifier = beanIdentifier;
564 }
565
566 protected Class<?> getModelClass() {
567 return WorkflowDefinitionLink.class;
568 }
569
570 protected String getModelClassName() {
571 return WorkflowDefinitionLink.class.getName();
572 }
573
574
579 protected void runSQL(String sql) {
580 try {
581 DataSource dataSource = workflowDefinitionLinkPersistence.getDataSource();
582
583 DB db = DBFactoryUtil.getDB();
584
585 sql = db.buildSQL(sql);
586 sql = PortalUtil.transformSQL(sql);
587
588 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
589 sql, new int[0]);
590
591 sqlUpdate.update();
592 }
593 catch (Exception e) {
594 throw new SystemException(e);
595 }
596 }
597
598 @BeanReference(type = com.liferay.portal.service.WorkflowDefinitionLinkLocalService.class)
599 protected WorkflowDefinitionLinkLocalService workflowDefinitionLinkLocalService;
600 @BeanReference(type = WorkflowDefinitionLinkPersistence.class)
601 protected WorkflowDefinitionLinkPersistence workflowDefinitionLinkPersistence;
602 @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
603 protected com.liferay.counter.service.CounterLocalService counterLocalService;
604 @BeanReference(type = com.liferay.portal.service.ClassNameLocalService.class)
605 protected com.liferay.portal.service.ClassNameLocalService classNameLocalService;
606 @BeanReference(type = com.liferay.portal.service.ClassNameService.class)
607 protected com.liferay.portal.service.ClassNameService classNameService;
608 @BeanReference(type = ClassNamePersistence.class)
609 protected ClassNamePersistence classNamePersistence;
610 @BeanReference(type = com.liferay.portal.service.SubscriptionLocalService.class)
611 protected com.liferay.portal.service.SubscriptionLocalService subscriptionLocalService;
612 @BeanReference(type = SubscriptionPersistence.class)
613 protected SubscriptionPersistence subscriptionPersistence;
614 @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
615 protected com.liferay.portal.service.UserLocalService userLocalService;
616 @BeanReference(type = com.liferay.portal.service.UserService.class)
617 protected com.liferay.portal.service.UserService userService;
618 @BeanReference(type = UserPersistence.class)
619 protected UserPersistence userPersistence;
620 @BeanReference(type = UserFinder.class)
621 protected UserFinder userFinder;
622 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
623 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
624 private String _beanIdentifier;
625 }