001
014
015 package com.liferay.portlet.softwarecatalog.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.service.BaseLocalServiceImpl;
037 import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
038 import com.liferay.portal.util.PortalUtil;
039
040 import com.liferay.portlet.softwarecatalog.model.SCLicense;
041 import com.liferay.portlet.softwarecatalog.service.SCLicenseLocalService;
042 import com.liferay.portlet.softwarecatalog.service.persistence.SCLicensePersistence;
043 import com.liferay.portlet.softwarecatalog.service.persistence.SCProductEntryPersistence;
044
045 import java.io.Serializable;
046
047 import java.util.List;
048
049 import javax.sql.DataSource;
050
051
063 @ProviderType
064 public abstract class SCLicenseLocalServiceBaseImpl extends BaseLocalServiceImpl
065 implements SCLicenseLocalService, IdentifiableBean {
066
071
072
078 @Indexable(type = IndexableType.REINDEX)
079 @Override
080 public SCLicense addSCLicense(SCLicense scLicense) {
081 scLicense.setNew(true);
082
083 return scLicensePersistence.update(scLicense);
084 }
085
086
092 @Override
093 public SCLicense createSCLicense(long licenseId) {
094 return scLicensePersistence.create(licenseId);
095 }
096
097
104 @Indexable(type = IndexableType.DELETE)
105 @Override
106 public SCLicense deleteSCLicense(long licenseId) throws PortalException {
107 return scLicensePersistence.remove(licenseId);
108 }
109
110
116 @Indexable(type = IndexableType.DELETE)
117 @Override
118 public SCLicense deleteSCLicense(SCLicense scLicense) {
119 return scLicensePersistence.remove(scLicense);
120 }
121
122 @Override
123 public DynamicQuery dynamicQuery() {
124 Class<?> clazz = getClass();
125
126 return DynamicQueryFactoryUtil.forClass(SCLicense.class,
127 clazz.getClassLoader());
128 }
129
130
136 @Override
137 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
138 return scLicensePersistence.findWithDynamicQuery(dynamicQuery);
139 }
140
141
153 @Override
154 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
155 int end) {
156 return scLicensePersistence.findWithDynamicQuery(dynamicQuery, start,
157 end);
158 }
159
160
173 @Override
174 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
175 int end, OrderByComparator<T> orderByComparator) {
176 return scLicensePersistence.findWithDynamicQuery(dynamicQuery, start,
177 end, orderByComparator);
178 }
179
180
186 @Override
187 public long dynamicQueryCount(DynamicQuery dynamicQuery) {
188 return scLicensePersistence.countWithDynamicQuery(dynamicQuery);
189 }
190
191
198 @Override
199 public long dynamicQueryCount(DynamicQuery dynamicQuery,
200 Projection projection) {
201 return scLicensePersistence.countWithDynamicQuery(dynamicQuery,
202 projection);
203 }
204
205 @Override
206 public SCLicense fetchSCLicense(long licenseId) {
207 return scLicensePersistence.fetchByPrimaryKey(licenseId);
208 }
209
210
217 @Override
218 public SCLicense getSCLicense(long licenseId) throws PortalException {
219 return scLicensePersistence.findByPrimaryKey(licenseId);
220 }
221
222 @Override
223 public ActionableDynamicQuery getActionableDynamicQuery() {
224 ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
225
226 actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.softwarecatalog.service.SCLicenseLocalServiceUtil.getService());
227 actionableDynamicQuery.setClass(SCLicense.class);
228 actionableDynamicQuery.setClassLoader(getClassLoader());
229
230 actionableDynamicQuery.setPrimaryKeyPropertyName("licenseId");
231
232 return actionableDynamicQuery;
233 }
234
235 protected void initActionableDynamicQuery(
236 ActionableDynamicQuery actionableDynamicQuery) {
237 actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.softwarecatalog.service.SCLicenseLocalServiceUtil.getService());
238 actionableDynamicQuery.setClass(SCLicense.class);
239 actionableDynamicQuery.setClassLoader(getClassLoader());
240
241 actionableDynamicQuery.setPrimaryKeyPropertyName("licenseId");
242 }
243
244
247 @Override
248 public PersistedModel deletePersistedModel(PersistedModel persistedModel)
249 throws PortalException {
250 return scLicenseLocalService.deleteSCLicense((SCLicense)persistedModel);
251 }
252
253 @Override
254 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
255 throws PortalException {
256 return scLicensePersistence.findByPrimaryKey(primaryKeyObj);
257 }
258
259
270 @Override
271 public List<SCLicense> getSCLicenses(int start, int end) {
272 return scLicensePersistence.findAll(start, end);
273 }
274
275
280 @Override
281 public int getSCLicensesCount() {
282 return scLicensePersistence.countAll();
283 }
284
285
291 @Indexable(type = IndexableType.REINDEX)
292 @Override
293 public SCLicense updateSCLicense(SCLicense scLicense) {
294 return scLicensePersistence.update(scLicense);
295 }
296
297
299 @Override
300 public void addSCProductEntrySCLicense(long productEntryId, long licenseId) {
301 scProductEntryPersistence.addSCLicense(productEntryId, licenseId);
302 }
303
304
306 @Override
307 public void addSCProductEntrySCLicense(long productEntryId,
308 SCLicense scLicense) {
309 scProductEntryPersistence.addSCLicense(productEntryId, scLicense);
310 }
311
312
314 @Override
315 public void addSCProductEntrySCLicenses(long productEntryId,
316 long[] licenseIds) {
317 scProductEntryPersistence.addSCLicenses(productEntryId, licenseIds);
318 }
319
320
322 @Override
323 public void addSCProductEntrySCLicenses(long productEntryId,
324 List<SCLicense> SCLicenses) {
325 scProductEntryPersistence.addSCLicenses(productEntryId, SCLicenses);
326 }
327
328
330 @Override
331 public void clearSCProductEntrySCLicenses(long productEntryId) {
332 scProductEntryPersistence.clearSCLicenses(productEntryId);
333 }
334
335
337 @Override
338 public void deleteSCProductEntrySCLicense(long productEntryId,
339 long licenseId) {
340 scProductEntryPersistence.removeSCLicense(productEntryId, licenseId);
341 }
342
343
345 @Override
346 public void deleteSCProductEntrySCLicense(long productEntryId,
347 SCLicense scLicense) {
348 scProductEntryPersistence.removeSCLicense(productEntryId, scLicense);
349 }
350
351
353 @Override
354 public void deleteSCProductEntrySCLicenses(long productEntryId,
355 long[] licenseIds) {
356 scProductEntryPersistence.removeSCLicenses(productEntryId, licenseIds);
357 }
358
359
361 @Override
362 public void deleteSCProductEntrySCLicenses(long productEntryId,
363 List<SCLicense> SCLicenses) {
364 scProductEntryPersistence.removeSCLicenses(productEntryId, SCLicenses);
365 }
366
367
373 @Override
374 public long[] getSCProductEntryPrimaryKeys(long licenseId) {
375 return scLicensePersistence.getSCProductEntryPrimaryKeys(licenseId);
376 }
377
378
380 @Override
381 public List<SCLicense> getSCProductEntrySCLicenses(long productEntryId) {
382 return scProductEntryPersistence.getSCLicenses(productEntryId);
383 }
384
385
387 @Override
388 public List<SCLicense> getSCProductEntrySCLicenses(long productEntryId,
389 int start, int end) {
390 return scProductEntryPersistence.getSCLicenses(productEntryId, start,
391 end);
392 }
393
394
396 @Override
397 public List<SCLicense> getSCProductEntrySCLicenses(long productEntryId,
398 int start, int end, OrderByComparator<SCLicense> orderByComparator) {
399 return scProductEntryPersistence.getSCLicenses(productEntryId, start,
400 end, orderByComparator);
401 }
402
403
405 @Override
406 public int getSCProductEntrySCLicensesCount(long productEntryId) {
407 return scProductEntryPersistence.getSCLicensesSize(productEntryId);
408 }
409
410
412 @Override
413 public boolean hasSCProductEntrySCLicense(long productEntryId,
414 long licenseId) {
415 return scProductEntryPersistence.containsSCLicense(productEntryId,
416 licenseId);
417 }
418
419
421 @Override
422 public boolean hasSCProductEntrySCLicenses(long productEntryId) {
423 return scProductEntryPersistence.containsSCLicenses(productEntryId);
424 }
425
426
428 @Override
429 public void setSCProductEntrySCLicenses(long productEntryId,
430 long[] licenseIds) {
431 scProductEntryPersistence.setSCLicenses(productEntryId, licenseIds);
432 }
433
434
439 public SCLicenseLocalService getSCLicenseLocalService() {
440 return scLicenseLocalService;
441 }
442
443
448 public void setSCLicenseLocalService(
449 SCLicenseLocalService scLicenseLocalService) {
450 this.scLicenseLocalService = scLicenseLocalService;
451 }
452
453
458 public com.liferay.portlet.softwarecatalog.service.SCLicenseService getSCLicenseService() {
459 return scLicenseService;
460 }
461
462
467 public void setSCLicenseService(
468 com.liferay.portlet.softwarecatalog.service.SCLicenseService scLicenseService) {
469 this.scLicenseService = scLicenseService;
470 }
471
472
477 public SCLicensePersistence getSCLicensePersistence() {
478 return scLicensePersistence;
479 }
480
481
486 public void setSCLicensePersistence(
487 SCLicensePersistence scLicensePersistence) {
488 this.scLicensePersistence = scLicensePersistence;
489 }
490
491
496 public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
497 return counterLocalService;
498 }
499
500
505 public void setCounterLocalService(
506 com.liferay.counter.service.CounterLocalService counterLocalService) {
507 this.counterLocalService = counterLocalService;
508 }
509
510
515 public com.liferay.portlet.softwarecatalog.service.SCProductEntryLocalService getSCProductEntryLocalService() {
516 return scProductEntryLocalService;
517 }
518
519
524 public void setSCProductEntryLocalService(
525 com.liferay.portlet.softwarecatalog.service.SCProductEntryLocalService scProductEntryLocalService) {
526 this.scProductEntryLocalService = scProductEntryLocalService;
527 }
528
529
534 public com.liferay.portlet.softwarecatalog.service.SCProductEntryService getSCProductEntryService() {
535 return scProductEntryService;
536 }
537
538
543 public void setSCProductEntryService(
544 com.liferay.portlet.softwarecatalog.service.SCProductEntryService scProductEntryService) {
545 this.scProductEntryService = scProductEntryService;
546 }
547
548
553 public SCProductEntryPersistence getSCProductEntryPersistence() {
554 return scProductEntryPersistence;
555 }
556
557
562 public void setSCProductEntryPersistence(
563 SCProductEntryPersistence scProductEntryPersistence) {
564 this.scProductEntryPersistence = scProductEntryPersistence;
565 }
566
567 public void afterPropertiesSet() {
568 persistedModelLocalServiceRegistry.register("com.liferay.portlet.softwarecatalog.model.SCLicense",
569 scLicenseLocalService);
570 }
571
572 public void destroy() {
573 persistedModelLocalServiceRegistry.unregister(
574 "com.liferay.portlet.softwarecatalog.model.SCLicense");
575 }
576
577
582 @Override
583 public String getBeanIdentifier() {
584 return _beanIdentifier;
585 }
586
587
592 @Override
593 public void setBeanIdentifier(String beanIdentifier) {
594 _beanIdentifier = beanIdentifier;
595 }
596
597 protected Class<?> getModelClass() {
598 return SCLicense.class;
599 }
600
601 protected String getModelClassName() {
602 return SCLicense.class.getName();
603 }
604
605
610 protected void runSQL(String sql) {
611 try {
612 DataSource dataSource = scLicensePersistence.getDataSource();
613
614 DB db = DBFactoryUtil.getDB();
615
616 sql = db.buildSQL(sql);
617 sql = PortalUtil.transformSQL(sql);
618
619 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
620 sql, new int[0]);
621
622 sqlUpdate.update();
623 }
624 catch (Exception e) {
625 throw new SystemException(e);
626 }
627 }
628
629 @BeanReference(type = com.liferay.portlet.softwarecatalog.service.SCLicenseLocalService.class)
630 protected SCLicenseLocalService scLicenseLocalService;
631 @BeanReference(type = com.liferay.portlet.softwarecatalog.service.SCLicenseService.class)
632 protected com.liferay.portlet.softwarecatalog.service.SCLicenseService scLicenseService;
633 @BeanReference(type = SCLicensePersistence.class)
634 protected SCLicensePersistence scLicensePersistence;
635 @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
636 protected com.liferay.counter.service.CounterLocalService counterLocalService;
637 @BeanReference(type = com.liferay.portlet.softwarecatalog.service.SCProductEntryLocalService.class)
638 protected com.liferay.portlet.softwarecatalog.service.SCProductEntryLocalService scProductEntryLocalService;
639 @BeanReference(type = com.liferay.portlet.softwarecatalog.service.SCProductEntryService.class)
640 protected com.liferay.portlet.softwarecatalog.service.SCProductEntryService scProductEntryService;
641 @BeanReference(type = SCProductEntryPersistence.class)
642 protected SCProductEntryPersistence scProductEntryPersistence;
643 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
644 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
645 private String _beanIdentifier;
646 }