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.SCProductVersion;
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 SCProductVersionLocalServiceBaseImpl
077 extends BaseLocalServiceImpl implements SCProductVersionLocalService,
078 IdentifiableBean {
079
084
085
092 @Indexable(type = IndexableType.REINDEX)
093 public SCProductVersion addSCProductVersion(
094 SCProductVersion scProductVersion) throws SystemException {
095 scProductVersion.setNew(true);
096
097 return scProductVersionPersistence.update(scProductVersion, false);
098 }
099
100
106 public SCProductVersion createSCProductVersion(long productVersionId) {
107 return scProductVersionPersistence.create(productVersionId);
108 }
109
110
118 @Indexable(type = IndexableType.DELETE)
119 public SCProductVersion deleteSCProductVersion(long productVersionId)
120 throws PortalException, SystemException {
121 return scProductVersionPersistence.remove(productVersionId);
122 }
123
124
131 @Indexable(type = IndexableType.DELETE)
132 public SCProductVersion deleteSCProductVersion(
133 SCProductVersion scProductVersion) throws SystemException {
134 return scProductVersionPersistence.remove(scProductVersion);
135 }
136
137 public DynamicQuery dynamicQuery() {
138 Class<?> clazz = getClass();
139
140 return DynamicQueryFactoryUtil.forClass(SCProductVersion.class,
141 clazz.getClassLoader());
142 }
143
144
151 @SuppressWarnings("rawtypes")
152 public List dynamicQuery(DynamicQuery dynamicQuery)
153 throws SystemException {
154 return scProductVersionPersistence.findWithDynamicQuery(dynamicQuery);
155 }
156
157
170 @SuppressWarnings("rawtypes")
171 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
172 throws SystemException {
173 return scProductVersionPersistence.findWithDynamicQuery(dynamicQuery,
174 start, end);
175 }
176
177
191 @SuppressWarnings("rawtypes")
192 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
193 OrderByComparator orderByComparator) throws SystemException {
194 return scProductVersionPersistence.findWithDynamicQuery(dynamicQuery,
195 start, end, orderByComparator);
196 }
197
198
205 public long dynamicQueryCount(DynamicQuery dynamicQuery)
206 throws SystemException {
207 return scProductVersionPersistence.countWithDynamicQuery(dynamicQuery);
208 }
209
210 public SCProductVersion fetchSCProductVersion(long productVersionId)
211 throws SystemException {
212 return scProductVersionPersistence.fetchByPrimaryKey(productVersionId);
213 }
214
215
223 public SCProductVersion getSCProductVersion(long productVersionId)
224 throws PortalException, SystemException {
225 return scProductVersionPersistence.findByPrimaryKey(productVersionId);
226 }
227
228 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
229 throws PortalException, SystemException {
230 return scProductVersionPersistence.findByPrimaryKey(primaryKeyObj);
231 }
232
233
245 public List<SCProductVersion> getSCProductVersions(int start, int end)
246 throws SystemException {
247 return scProductVersionPersistence.findAll(start, end);
248 }
249
250
256 public int getSCProductVersionsCount() throws SystemException {
257 return scProductVersionPersistence.countAll();
258 }
259
260
267 @Indexable(type = IndexableType.REINDEX)
268 public SCProductVersion updateSCProductVersion(
269 SCProductVersion scProductVersion) throws SystemException {
270 return updateSCProductVersion(scProductVersion, true);
271 }
272
273
281 @Indexable(type = IndexableType.REINDEX)
282 public SCProductVersion updateSCProductVersion(
283 SCProductVersion scProductVersion, boolean merge)
284 throws SystemException {
285 scProductVersion.setNew(false);
286
287 return scProductVersionPersistence.update(scProductVersion, merge);
288 }
289
290
295 public SCFrameworkVersionLocalService getSCFrameworkVersionLocalService() {
296 return scFrameworkVersionLocalService;
297 }
298
299
304 public void setSCFrameworkVersionLocalService(
305 SCFrameworkVersionLocalService scFrameworkVersionLocalService) {
306 this.scFrameworkVersionLocalService = scFrameworkVersionLocalService;
307 }
308
309
314 public SCFrameworkVersionService getSCFrameworkVersionService() {
315 return scFrameworkVersionService;
316 }
317
318
323 public void setSCFrameworkVersionService(
324 SCFrameworkVersionService scFrameworkVersionService) {
325 this.scFrameworkVersionService = scFrameworkVersionService;
326 }
327
328
333 public SCFrameworkVersionPersistence getSCFrameworkVersionPersistence() {
334 return scFrameworkVersionPersistence;
335 }
336
337
342 public void setSCFrameworkVersionPersistence(
343 SCFrameworkVersionPersistence scFrameworkVersionPersistence) {
344 this.scFrameworkVersionPersistence = scFrameworkVersionPersistence;
345 }
346
347
352 public SCLicenseLocalService getSCLicenseLocalService() {
353 return scLicenseLocalService;
354 }
355
356
361 public void setSCLicenseLocalService(
362 SCLicenseLocalService scLicenseLocalService) {
363 this.scLicenseLocalService = scLicenseLocalService;
364 }
365
366
371 public SCLicenseService getSCLicenseService() {
372 return scLicenseService;
373 }
374
375
380 public void setSCLicenseService(SCLicenseService scLicenseService) {
381 this.scLicenseService = scLicenseService;
382 }
383
384
389 public SCLicensePersistence getSCLicensePersistence() {
390 return scLicensePersistence;
391 }
392
393
398 public void setSCLicensePersistence(
399 SCLicensePersistence scLicensePersistence) {
400 this.scLicensePersistence = scLicensePersistence;
401 }
402
403
408 public SCProductEntryLocalService getSCProductEntryLocalService() {
409 return scProductEntryLocalService;
410 }
411
412
417 public void setSCProductEntryLocalService(
418 SCProductEntryLocalService scProductEntryLocalService) {
419 this.scProductEntryLocalService = scProductEntryLocalService;
420 }
421
422
427 public SCProductEntryService getSCProductEntryService() {
428 return scProductEntryService;
429 }
430
431
436 public void setSCProductEntryService(
437 SCProductEntryService scProductEntryService) {
438 this.scProductEntryService = scProductEntryService;
439 }
440
441
446 public SCProductEntryPersistence getSCProductEntryPersistence() {
447 return scProductEntryPersistence;
448 }
449
450
455 public void setSCProductEntryPersistence(
456 SCProductEntryPersistence scProductEntryPersistence) {
457 this.scProductEntryPersistence = scProductEntryPersistence;
458 }
459
460
465 public SCProductScreenshotLocalService getSCProductScreenshotLocalService() {
466 return scProductScreenshotLocalService;
467 }
468
469
474 public void setSCProductScreenshotLocalService(
475 SCProductScreenshotLocalService scProductScreenshotLocalService) {
476 this.scProductScreenshotLocalService = scProductScreenshotLocalService;
477 }
478
479
484 public SCProductScreenshotPersistence getSCProductScreenshotPersistence() {
485 return scProductScreenshotPersistence;
486 }
487
488
493 public void setSCProductScreenshotPersistence(
494 SCProductScreenshotPersistence scProductScreenshotPersistence) {
495 this.scProductScreenshotPersistence = scProductScreenshotPersistence;
496 }
497
498
503 public SCProductVersionLocalService getSCProductVersionLocalService() {
504 return scProductVersionLocalService;
505 }
506
507
512 public void setSCProductVersionLocalService(
513 SCProductVersionLocalService scProductVersionLocalService) {
514 this.scProductVersionLocalService = scProductVersionLocalService;
515 }
516
517
522 public SCProductVersionService getSCProductVersionService() {
523 return scProductVersionService;
524 }
525
526
531 public void setSCProductVersionService(
532 SCProductVersionService scProductVersionService) {
533 this.scProductVersionService = scProductVersionService;
534 }
535
536
541 public SCProductVersionPersistence getSCProductVersionPersistence() {
542 return scProductVersionPersistence;
543 }
544
545
550 public void setSCProductVersionPersistence(
551 SCProductVersionPersistence scProductVersionPersistence) {
552 this.scProductVersionPersistence = scProductVersionPersistence;
553 }
554
555
560 public CounterLocalService getCounterLocalService() {
561 return counterLocalService;
562 }
563
564
569 public void setCounterLocalService(CounterLocalService counterLocalService) {
570 this.counterLocalService = counterLocalService;
571 }
572
573
578 public ResourceLocalService getResourceLocalService() {
579 return resourceLocalService;
580 }
581
582
587 public void setResourceLocalService(
588 ResourceLocalService resourceLocalService) {
589 this.resourceLocalService = resourceLocalService;
590 }
591
592
597 public ResourceService getResourceService() {
598 return resourceService;
599 }
600
601
606 public void setResourceService(ResourceService resourceService) {
607 this.resourceService = resourceService;
608 }
609
610
615 public ResourcePersistence getResourcePersistence() {
616 return resourcePersistence;
617 }
618
619
624 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
625 this.resourcePersistence = resourcePersistence;
626 }
627
628
633 public ResourceFinder getResourceFinder() {
634 return resourceFinder;
635 }
636
637
642 public void setResourceFinder(ResourceFinder resourceFinder) {
643 this.resourceFinder = resourceFinder;
644 }
645
646
651 public UserLocalService getUserLocalService() {
652 return userLocalService;
653 }
654
655
660 public void setUserLocalService(UserLocalService userLocalService) {
661 this.userLocalService = userLocalService;
662 }
663
664
669 public UserService getUserService() {
670 return userService;
671 }
672
673
678 public void setUserService(UserService userService) {
679 this.userService = userService;
680 }
681
682
687 public UserPersistence getUserPersistence() {
688 return userPersistence;
689 }
690
691
696 public void setUserPersistence(UserPersistence userPersistence) {
697 this.userPersistence = userPersistence;
698 }
699
700
705 public UserFinder getUserFinder() {
706 return userFinder;
707 }
708
709
714 public void setUserFinder(UserFinder userFinder) {
715 this.userFinder = userFinder;
716 }
717
718 public void afterPropertiesSet() {
719 persistedModelLocalServiceRegistry.register("com.liferay.portlet.softwarecatalog.model.SCProductVersion",
720 scProductVersionLocalService);
721 }
722
723 public void destroy() {
724 persistedModelLocalServiceRegistry.unregister(
725 "com.liferay.portlet.softwarecatalog.model.SCProductVersion");
726 }
727
728
733 public String getBeanIdentifier() {
734 return _beanIdentifier;
735 }
736
737
742 public void setBeanIdentifier(String beanIdentifier) {
743 _beanIdentifier = beanIdentifier;
744 }
745
746 protected Class<?> getModelClass() {
747 return SCProductVersion.class;
748 }
749
750 protected String getModelClassName() {
751 return SCProductVersion.class.getName();
752 }
753
754
759 protected void runSQL(String sql) throws SystemException {
760 try {
761 DataSource dataSource = scProductVersionPersistence.getDataSource();
762
763 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
764 sql, new int[0]);
765
766 sqlUpdate.update();
767 }
768 catch (Exception e) {
769 throw new SystemException(e);
770 }
771 }
772
773 @BeanReference(type = SCFrameworkVersionLocalService.class)
774 protected SCFrameworkVersionLocalService scFrameworkVersionLocalService;
775 @BeanReference(type = SCFrameworkVersionService.class)
776 protected SCFrameworkVersionService scFrameworkVersionService;
777 @BeanReference(type = SCFrameworkVersionPersistence.class)
778 protected SCFrameworkVersionPersistence scFrameworkVersionPersistence;
779 @BeanReference(type = SCLicenseLocalService.class)
780 protected SCLicenseLocalService scLicenseLocalService;
781 @BeanReference(type = SCLicenseService.class)
782 protected SCLicenseService scLicenseService;
783 @BeanReference(type = SCLicensePersistence.class)
784 protected SCLicensePersistence scLicensePersistence;
785 @BeanReference(type = SCProductEntryLocalService.class)
786 protected SCProductEntryLocalService scProductEntryLocalService;
787 @BeanReference(type = SCProductEntryService.class)
788 protected SCProductEntryService scProductEntryService;
789 @BeanReference(type = SCProductEntryPersistence.class)
790 protected SCProductEntryPersistence scProductEntryPersistence;
791 @BeanReference(type = SCProductScreenshotLocalService.class)
792 protected SCProductScreenshotLocalService scProductScreenshotLocalService;
793 @BeanReference(type = SCProductScreenshotPersistence.class)
794 protected SCProductScreenshotPersistence scProductScreenshotPersistence;
795 @BeanReference(type = SCProductVersionLocalService.class)
796 protected SCProductVersionLocalService scProductVersionLocalService;
797 @BeanReference(type = SCProductVersionService.class)
798 protected SCProductVersionService scProductVersionService;
799 @BeanReference(type = SCProductVersionPersistence.class)
800 protected SCProductVersionPersistence scProductVersionPersistence;
801 @BeanReference(type = CounterLocalService.class)
802 protected CounterLocalService counterLocalService;
803 @BeanReference(type = ResourceLocalService.class)
804 protected ResourceLocalService resourceLocalService;
805 @BeanReference(type = ResourceService.class)
806 protected ResourceService resourceService;
807 @BeanReference(type = ResourcePersistence.class)
808 protected ResourcePersistence resourcePersistence;
809 @BeanReference(type = ResourceFinder.class)
810 protected ResourceFinder resourceFinder;
811 @BeanReference(type = UserLocalService.class)
812 protected UserLocalService userLocalService;
813 @BeanReference(type = UserService.class)
814 protected UserService userService;
815 @BeanReference(type = UserPersistence.class)
816 protected UserPersistence userPersistence;
817 @BeanReference(type = UserFinder.class)
818 protected UserFinder userFinder;
819 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
820 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
821 private String _beanIdentifier;
822 }