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.dao.db.DB;
021 import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
022 import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
023 import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
024 import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
025 import com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery;
026 import com.liferay.portal.kernel.dao.orm.DynamicQuery;
027 import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
028 import com.liferay.portal.kernel.dao.orm.Projection;
029 import com.liferay.portal.kernel.exception.PortalException;
030 import com.liferay.portal.kernel.exception.SystemException;
031 import com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService;
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 IdentifiableOSGiService {
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 getOSGiServiceIdentifier() {
553 return WorkflowDefinitionLinkLocalService.class.getName();
554 }
555
556 protected Class<?> getModelClass() {
557 return WorkflowDefinitionLink.class;
558 }
559
560 protected String getModelClassName() {
561 return WorkflowDefinitionLink.class.getName();
562 }
563
564
569 protected void runSQL(String sql) {
570 try {
571 DataSource dataSource = workflowDefinitionLinkPersistence.getDataSource();
572
573 DB db = DBFactoryUtil.getDB();
574
575 sql = db.buildSQL(sql);
576 sql = PortalUtil.transformSQL(sql);
577
578 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
579 sql, new int[0]);
580
581 sqlUpdate.update();
582 }
583 catch (Exception e) {
584 throw new SystemException(e);
585 }
586 }
587
588 @BeanReference(type = com.liferay.portal.service.WorkflowDefinitionLinkLocalService.class)
589 protected WorkflowDefinitionLinkLocalService workflowDefinitionLinkLocalService;
590 @BeanReference(type = WorkflowDefinitionLinkPersistence.class)
591 protected WorkflowDefinitionLinkPersistence workflowDefinitionLinkPersistence;
592 @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
593 protected com.liferay.counter.service.CounterLocalService counterLocalService;
594 @BeanReference(type = com.liferay.portal.service.ClassNameLocalService.class)
595 protected com.liferay.portal.service.ClassNameLocalService classNameLocalService;
596 @BeanReference(type = com.liferay.portal.service.ClassNameService.class)
597 protected com.liferay.portal.service.ClassNameService classNameService;
598 @BeanReference(type = ClassNamePersistence.class)
599 protected ClassNamePersistence classNamePersistence;
600 @BeanReference(type = com.liferay.portal.service.SubscriptionLocalService.class)
601 protected com.liferay.portal.service.SubscriptionLocalService subscriptionLocalService;
602 @BeanReference(type = SubscriptionPersistence.class)
603 protected SubscriptionPersistence subscriptionPersistence;
604 @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
605 protected com.liferay.portal.service.UserLocalService userLocalService;
606 @BeanReference(type = com.liferay.portal.service.UserService.class)
607 protected com.liferay.portal.service.UserService userService;
608 @BeanReference(type = UserPersistence.class)
609 protected UserPersistence userPersistence;
610 @BeanReference(type = UserFinder.class)
611 protected UserFinder userFinder;
612 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
613 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
614 }