001
014
015 package com.liferay.portlet.softwarecatalog.service.base;
016
017 import com.liferay.counter.service.CounterLocalService;
018
019 import com.liferay.portal.kernel.bean.BeanReference;
020 import com.liferay.portal.kernel.bean.IdentifiableBean;
021 import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
022 import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
023 import com.liferay.portal.kernel.dao.orm.DynamicQuery;
024 import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
025 import com.liferay.portal.kernel.exception.PortalException;
026 import com.liferay.portal.kernel.exception.SystemException;
027 import com.liferay.portal.kernel.search.Indexable;
028 import com.liferay.portal.kernel.search.IndexableType;
029 import com.liferay.portal.kernel.util.OrderByComparator;
030 import com.liferay.portal.model.PersistedModel;
031 import com.liferay.portal.service.BaseLocalServiceImpl;
032 import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
033 import com.liferay.portal.service.ResourceLocalService;
034 import com.liferay.portal.service.ResourceService;
035 import com.liferay.portal.service.UserLocalService;
036 import com.liferay.portal.service.UserService;
037 import com.liferay.portal.service.persistence.ResourceFinder;
038 import com.liferay.portal.service.persistence.ResourcePersistence;
039 import com.liferay.portal.service.persistence.UserFinder;
040 import com.liferay.portal.service.persistence.UserPersistence;
041
042 import com.liferay.portlet.softwarecatalog.model.SCLicense;
043 import com.liferay.portlet.softwarecatalog.service.SCFrameworkVersionLocalService;
044 import com.liferay.portlet.softwarecatalog.service.SCFrameworkVersionService;
045 import com.liferay.portlet.softwarecatalog.service.SCLicenseLocalService;
046 import com.liferay.portlet.softwarecatalog.service.SCLicenseService;
047 import com.liferay.portlet.softwarecatalog.service.SCProductEntryLocalService;
048 import com.liferay.portlet.softwarecatalog.service.SCProductEntryService;
049 import com.liferay.portlet.softwarecatalog.service.SCProductScreenshotLocalService;
050 import com.liferay.portlet.softwarecatalog.service.SCProductVersionLocalService;
051 import com.liferay.portlet.softwarecatalog.service.SCProductVersionService;
052 import com.liferay.portlet.softwarecatalog.service.persistence.SCFrameworkVersionPersistence;
053 import com.liferay.portlet.softwarecatalog.service.persistence.SCLicensePersistence;
054 import com.liferay.portlet.softwarecatalog.service.persistence.SCProductEntryPersistence;
055 import com.liferay.portlet.softwarecatalog.service.persistence.SCProductScreenshotPersistence;
056 import com.liferay.portlet.softwarecatalog.service.persistence.SCProductVersionPersistence;
057
058 import java.io.Serializable;
059
060 import java.util.List;
061
062 import javax.sql.DataSource;
063
064
076 public abstract class SCLicenseLocalServiceBaseImpl extends BaseLocalServiceImpl
077 implements SCLicenseLocalService, IdentifiableBean {
078
083
084
091 @Indexable(type = IndexableType.REINDEX)
092 public SCLicense addSCLicense(SCLicense scLicense)
093 throws SystemException {
094 scLicense.setNew(true);
095
096 return scLicensePersistence.update(scLicense, false);
097 }
098
099
105 public SCLicense createSCLicense(long licenseId) {
106 return scLicensePersistence.create(licenseId);
107 }
108
109
117 @Indexable(type = IndexableType.DELETE)
118 public SCLicense deleteSCLicense(long licenseId)
119 throws PortalException, SystemException {
120 return scLicensePersistence.remove(licenseId);
121 }
122
123
130 @Indexable(type = IndexableType.DELETE)
131 public SCLicense deleteSCLicense(SCLicense scLicense)
132 throws SystemException {
133 return scLicensePersistence.remove(scLicense);
134 }
135
136 public DynamicQuery dynamicQuery() {
137 Class<?> clazz = getClass();
138
139 return DynamicQueryFactoryUtil.forClass(SCLicense.class,
140 clazz.getClassLoader());
141 }
142
143
150 @SuppressWarnings("rawtypes")
151 public List dynamicQuery(DynamicQuery dynamicQuery)
152 throws SystemException {
153 return scLicensePersistence.findWithDynamicQuery(dynamicQuery);
154 }
155
156
169 @SuppressWarnings("rawtypes")
170 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
171 throws SystemException {
172 return scLicensePersistence.findWithDynamicQuery(dynamicQuery, start,
173 end);
174 }
175
176
190 @SuppressWarnings("rawtypes")
191 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
192 OrderByComparator orderByComparator) throws SystemException {
193 return scLicensePersistence.findWithDynamicQuery(dynamicQuery, start,
194 end, orderByComparator);
195 }
196
197
204 public long dynamicQueryCount(DynamicQuery dynamicQuery)
205 throws SystemException {
206 return scLicensePersistence.countWithDynamicQuery(dynamicQuery);
207 }
208
209 public SCLicense fetchSCLicense(long licenseId) throws SystemException {
210 return scLicensePersistence.fetchByPrimaryKey(licenseId);
211 }
212
213
221 public SCLicense getSCLicense(long licenseId)
222 throws PortalException, SystemException {
223 return scLicensePersistence.findByPrimaryKey(licenseId);
224 }
225
226 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
227 throws PortalException, SystemException {
228 return scLicensePersistence.findByPrimaryKey(primaryKeyObj);
229 }
230
231
243 public List<SCLicense> getSCLicenses(int start, int end)
244 throws SystemException {
245 return scLicensePersistence.findAll(start, end);
246 }
247
248
254 public int getSCLicensesCount() throws SystemException {
255 return scLicensePersistence.countAll();
256 }
257
258
265 @Indexable(type = IndexableType.REINDEX)
266 public SCLicense updateSCLicense(SCLicense scLicense)
267 throws SystemException {
268 return updateSCLicense(scLicense, true);
269 }
270
271
279 @Indexable(type = IndexableType.REINDEX)
280 public SCLicense updateSCLicense(SCLicense scLicense, boolean merge)
281 throws SystemException {
282 scLicense.setNew(false);
283
284 return scLicensePersistence.update(scLicense, merge);
285 }
286
287
292 public SCFrameworkVersionLocalService getSCFrameworkVersionLocalService() {
293 return scFrameworkVersionLocalService;
294 }
295
296
301 public void setSCFrameworkVersionLocalService(
302 SCFrameworkVersionLocalService scFrameworkVersionLocalService) {
303 this.scFrameworkVersionLocalService = scFrameworkVersionLocalService;
304 }
305
306
311 public SCFrameworkVersionService getSCFrameworkVersionService() {
312 return scFrameworkVersionService;
313 }
314
315
320 public void setSCFrameworkVersionService(
321 SCFrameworkVersionService scFrameworkVersionService) {
322 this.scFrameworkVersionService = scFrameworkVersionService;
323 }
324
325
330 public SCFrameworkVersionPersistence getSCFrameworkVersionPersistence() {
331 return scFrameworkVersionPersistence;
332 }
333
334
339 public void setSCFrameworkVersionPersistence(
340 SCFrameworkVersionPersistence scFrameworkVersionPersistence) {
341 this.scFrameworkVersionPersistence = scFrameworkVersionPersistence;
342 }
343
344
349 public SCLicenseLocalService getSCLicenseLocalService() {
350 return scLicenseLocalService;
351 }
352
353
358 public void setSCLicenseLocalService(
359 SCLicenseLocalService scLicenseLocalService) {
360 this.scLicenseLocalService = scLicenseLocalService;
361 }
362
363
368 public SCLicenseService getSCLicenseService() {
369 return scLicenseService;
370 }
371
372
377 public void setSCLicenseService(SCLicenseService scLicenseService) {
378 this.scLicenseService = scLicenseService;
379 }
380
381
386 public SCLicensePersistence getSCLicensePersistence() {
387 return scLicensePersistence;
388 }
389
390
395 public void setSCLicensePersistence(
396 SCLicensePersistence scLicensePersistence) {
397 this.scLicensePersistence = scLicensePersistence;
398 }
399
400
405 public SCProductEntryLocalService getSCProductEntryLocalService() {
406 return scProductEntryLocalService;
407 }
408
409
414 public void setSCProductEntryLocalService(
415 SCProductEntryLocalService scProductEntryLocalService) {
416 this.scProductEntryLocalService = scProductEntryLocalService;
417 }
418
419
424 public SCProductEntryService getSCProductEntryService() {
425 return scProductEntryService;
426 }
427
428
433 public void setSCProductEntryService(
434 SCProductEntryService scProductEntryService) {
435 this.scProductEntryService = scProductEntryService;
436 }
437
438
443 public SCProductEntryPersistence getSCProductEntryPersistence() {
444 return scProductEntryPersistence;
445 }
446
447
452 public void setSCProductEntryPersistence(
453 SCProductEntryPersistence scProductEntryPersistence) {
454 this.scProductEntryPersistence = scProductEntryPersistence;
455 }
456
457
462 public SCProductScreenshotLocalService getSCProductScreenshotLocalService() {
463 return scProductScreenshotLocalService;
464 }
465
466
471 public void setSCProductScreenshotLocalService(
472 SCProductScreenshotLocalService scProductScreenshotLocalService) {
473 this.scProductScreenshotLocalService = scProductScreenshotLocalService;
474 }
475
476
481 public SCProductScreenshotPersistence getSCProductScreenshotPersistence() {
482 return scProductScreenshotPersistence;
483 }
484
485
490 public void setSCProductScreenshotPersistence(
491 SCProductScreenshotPersistence scProductScreenshotPersistence) {
492 this.scProductScreenshotPersistence = scProductScreenshotPersistence;
493 }
494
495
500 public SCProductVersionLocalService getSCProductVersionLocalService() {
501 return scProductVersionLocalService;
502 }
503
504
509 public void setSCProductVersionLocalService(
510 SCProductVersionLocalService scProductVersionLocalService) {
511 this.scProductVersionLocalService = scProductVersionLocalService;
512 }
513
514
519 public SCProductVersionService getSCProductVersionService() {
520 return scProductVersionService;
521 }
522
523
528 public void setSCProductVersionService(
529 SCProductVersionService scProductVersionService) {
530 this.scProductVersionService = scProductVersionService;
531 }
532
533
538 public SCProductVersionPersistence getSCProductVersionPersistence() {
539 return scProductVersionPersistence;
540 }
541
542
547 public void setSCProductVersionPersistence(
548 SCProductVersionPersistence scProductVersionPersistence) {
549 this.scProductVersionPersistence = scProductVersionPersistence;
550 }
551
552
557 public CounterLocalService getCounterLocalService() {
558 return counterLocalService;
559 }
560
561
566 public void setCounterLocalService(CounterLocalService counterLocalService) {
567 this.counterLocalService = counterLocalService;
568 }
569
570
575 public ResourceLocalService getResourceLocalService() {
576 return resourceLocalService;
577 }
578
579
584 public void setResourceLocalService(
585 ResourceLocalService resourceLocalService) {
586 this.resourceLocalService = resourceLocalService;
587 }
588
589
594 public ResourceService getResourceService() {
595 return resourceService;
596 }
597
598
603 public void setResourceService(ResourceService resourceService) {
604 this.resourceService = resourceService;
605 }
606
607
612 public ResourcePersistence getResourcePersistence() {
613 return resourcePersistence;
614 }
615
616
621 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
622 this.resourcePersistence = resourcePersistence;
623 }
624
625
630 public ResourceFinder getResourceFinder() {
631 return resourceFinder;
632 }
633
634
639 public void setResourceFinder(ResourceFinder resourceFinder) {
640 this.resourceFinder = resourceFinder;
641 }
642
643
648 public UserLocalService getUserLocalService() {
649 return userLocalService;
650 }
651
652
657 public void setUserLocalService(UserLocalService userLocalService) {
658 this.userLocalService = userLocalService;
659 }
660
661
666 public UserService getUserService() {
667 return userService;
668 }
669
670
675 public void setUserService(UserService userService) {
676 this.userService = userService;
677 }
678
679
684 public UserPersistence getUserPersistence() {
685 return userPersistence;
686 }
687
688
693 public void setUserPersistence(UserPersistence userPersistence) {
694 this.userPersistence = userPersistence;
695 }
696
697
702 public UserFinder getUserFinder() {
703 return userFinder;
704 }
705
706
711 public void setUserFinder(UserFinder userFinder) {
712 this.userFinder = userFinder;
713 }
714
715 public void afterPropertiesSet() {
716 persistedModelLocalServiceRegistry.register("com.liferay.portlet.softwarecatalog.model.SCLicense",
717 scLicenseLocalService);
718 }
719
720 public void destroy() {
721 persistedModelLocalServiceRegistry.unregister(
722 "com.liferay.portlet.softwarecatalog.model.SCLicense");
723 }
724
725
730 public String getBeanIdentifier() {
731 return _beanIdentifier;
732 }
733
734
739 public void setBeanIdentifier(String beanIdentifier) {
740 _beanIdentifier = beanIdentifier;
741 }
742
743 protected Class<?> getModelClass() {
744 return SCLicense.class;
745 }
746
747 protected String getModelClassName() {
748 return SCLicense.class.getName();
749 }
750
751
756 protected void runSQL(String sql) throws SystemException {
757 try {
758 DataSource dataSource = scLicensePersistence.getDataSource();
759
760 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
761 sql, new int[0]);
762
763 sqlUpdate.update();
764 }
765 catch (Exception e) {
766 throw new SystemException(e);
767 }
768 }
769
770 @BeanReference(type = SCFrameworkVersionLocalService.class)
771 protected SCFrameworkVersionLocalService scFrameworkVersionLocalService;
772 @BeanReference(type = SCFrameworkVersionService.class)
773 protected SCFrameworkVersionService scFrameworkVersionService;
774 @BeanReference(type = SCFrameworkVersionPersistence.class)
775 protected SCFrameworkVersionPersistence scFrameworkVersionPersistence;
776 @BeanReference(type = SCLicenseLocalService.class)
777 protected SCLicenseLocalService scLicenseLocalService;
778 @BeanReference(type = SCLicenseService.class)
779 protected SCLicenseService scLicenseService;
780 @BeanReference(type = SCLicensePersistence.class)
781 protected SCLicensePersistence scLicensePersistence;
782 @BeanReference(type = SCProductEntryLocalService.class)
783 protected SCProductEntryLocalService scProductEntryLocalService;
784 @BeanReference(type = SCProductEntryService.class)
785 protected SCProductEntryService scProductEntryService;
786 @BeanReference(type = SCProductEntryPersistence.class)
787 protected SCProductEntryPersistence scProductEntryPersistence;
788 @BeanReference(type = SCProductScreenshotLocalService.class)
789 protected SCProductScreenshotLocalService scProductScreenshotLocalService;
790 @BeanReference(type = SCProductScreenshotPersistence.class)
791 protected SCProductScreenshotPersistence scProductScreenshotPersistence;
792 @BeanReference(type = SCProductVersionLocalService.class)
793 protected SCProductVersionLocalService scProductVersionLocalService;
794 @BeanReference(type = SCProductVersionService.class)
795 protected SCProductVersionService scProductVersionService;
796 @BeanReference(type = SCProductVersionPersistence.class)
797 protected SCProductVersionPersistence scProductVersionPersistence;
798 @BeanReference(type = CounterLocalService.class)
799 protected CounterLocalService counterLocalService;
800 @BeanReference(type = ResourceLocalService.class)
801 protected ResourceLocalService resourceLocalService;
802 @BeanReference(type = ResourceService.class)
803 protected ResourceService resourceService;
804 @BeanReference(type = ResourcePersistence.class)
805 protected ResourcePersistence resourcePersistence;
806 @BeanReference(type = ResourceFinder.class)
807 protected ResourceFinder resourceFinder;
808 @BeanReference(type = UserLocalService.class)
809 protected UserLocalService userLocalService;
810 @BeanReference(type = UserService.class)
811 protected UserService userService;
812 @BeanReference(type = UserPersistence.class)
813 protected UserPersistence userPersistence;
814 @BeanReference(type = UserFinder.class)
815 protected UserFinder userFinder;
816 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
817 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
818 private String _beanIdentifier;
819 }