001
014
015 package com.liferay.portlet.asset.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.service.persistence.UserFinder;
039 import com.liferay.portal.service.persistence.UserPersistence;
040 import com.liferay.portal.util.PortalUtil;
041
042 import com.liferay.portlet.asset.model.AssetCategoryProperty;
043 import com.liferay.portlet.asset.service.AssetCategoryPropertyLocalService;
044 import com.liferay.portlet.asset.service.persistence.AssetCategoryPropertyFinder;
045 import com.liferay.portlet.asset.service.persistence.AssetCategoryPropertyPersistence;
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 AssetCategoryPropertyLocalServiceBaseImpl
067 extends BaseLocalServiceImpl implements AssetCategoryPropertyLocalService,
068 IdentifiableBean {
069
074
075
081 @Indexable(type = IndexableType.REINDEX)
082 @Override
083 public AssetCategoryProperty addAssetCategoryProperty(
084 AssetCategoryProperty assetCategoryProperty) {
085 assetCategoryProperty.setNew(true);
086
087 return assetCategoryPropertyPersistence.update(assetCategoryProperty);
088 }
089
090
096 @Override
097 public AssetCategoryProperty createAssetCategoryProperty(
098 long categoryPropertyId) {
099 return assetCategoryPropertyPersistence.create(categoryPropertyId);
100 }
101
102
109 @Indexable(type = IndexableType.DELETE)
110 @Override
111 public AssetCategoryProperty deleteAssetCategoryProperty(
112 long categoryPropertyId) throws PortalException {
113 return assetCategoryPropertyPersistence.remove(categoryPropertyId);
114 }
115
116
122 @Indexable(type = IndexableType.DELETE)
123 @Override
124 public AssetCategoryProperty deleteAssetCategoryProperty(
125 AssetCategoryProperty assetCategoryProperty) {
126 return assetCategoryPropertyPersistence.remove(assetCategoryProperty);
127 }
128
129 @Override
130 public DynamicQuery dynamicQuery() {
131 Class<?> clazz = getClass();
132
133 return DynamicQueryFactoryUtil.forClass(AssetCategoryProperty.class,
134 clazz.getClassLoader());
135 }
136
137
143 @Override
144 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
145 return assetCategoryPropertyPersistence.findWithDynamicQuery(dynamicQuery);
146 }
147
148
160 @Override
161 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
162 int end) {
163 return assetCategoryPropertyPersistence.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 assetCategoryPropertyPersistence.findWithDynamicQuery(dynamicQuery,
184 start, end, orderByComparator);
185 }
186
187
193 @Override
194 public long dynamicQueryCount(DynamicQuery dynamicQuery) {
195 return assetCategoryPropertyPersistence.countWithDynamicQuery(dynamicQuery);
196 }
197
198
205 @Override
206 public long dynamicQueryCount(DynamicQuery dynamicQuery,
207 Projection projection) {
208 return assetCategoryPropertyPersistence.countWithDynamicQuery(dynamicQuery,
209 projection);
210 }
211
212 @Override
213 public AssetCategoryProperty fetchAssetCategoryProperty(
214 long categoryPropertyId) {
215 return assetCategoryPropertyPersistence.fetchByPrimaryKey(categoryPropertyId);
216 }
217
218
225 @Override
226 public AssetCategoryProperty getAssetCategoryProperty(
227 long categoryPropertyId) throws PortalException {
228 return assetCategoryPropertyPersistence.findByPrimaryKey(categoryPropertyId);
229 }
230
231 @Override
232 public ActionableDynamicQuery getActionableDynamicQuery() {
233 ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
234
235 actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.asset.service.AssetCategoryPropertyLocalServiceUtil.getService());
236 actionableDynamicQuery.setClass(AssetCategoryProperty.class);
237 actionableDynamicQuery.setClassLoader(getClassLoader());
238
239 actionableDynamicQuery.setPrimaryKeyPropertyName("categoryPropertyId");
240
241 return actionableDynamicQuery;
242 }
243
244 protected void initActionableDynamicQuery(
245 ActionableDynamicQuery actionableDynamicQuery) {
246 actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.asset.service.AssetCategoryPropertyLocalServiceUtil.getService());
247 actionableDynamicQuery.setClass(AssetCategoryProperty.class);
248 actionableDynamicQuery.setClassLoader(getClassLoader());
249
250 actionableDynamicQuery.setPrimaryKeyPropertyName("categoryPropertyId");
251 }
252
253
256 @Override
257 public PersistedModel deletePersistedModel(PersistedModel persistedModel)
258 throws PortalException {
259 return assetCategoryPropertyLocalService.deleteAssetCategoryProperty((AssetCategoryProperty)persistedModel);
260 }
261
262 @Override
263 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
264 throws PortalException {
265 return assetCategoryPropertyPersistence.findByPrimaryKey(primaryKeyObj);
266 }
267
268
279 @Override
280 public List<AssetCategoryProperty> getAssetCategoryProperties(int start,
281 int end) {
282 return assetCategoryPropertyPersistence.findAll(start, end);
283 }
284
285
290 @Override
291 public int getAssetCategoryPropertiesCount() {
292 return assetCategoryPropertyPersistence.countAll();
293 }
294
295
301 @Indexable(type = IndexableType.REINDEX)
302 @Override
303 public AssetCategoryProperty updateAssetCategoryProperty(
304 AssetCategoryProperty assetCategoryProperty) {
305 return assetCategoryPropertyPersistence.update(assetCategoryProperty);
306 }
307
308
313 public com.liferay.portlet.asset.service.AssetCategoryPropertyLocalService getAssetCategoryPropertyLocalService() {
314 return assetCategoryPropertyLocalService;
315 }
316
317
322 public void setAssetCategoryPropertyLocalService(
323 com.liferay.portlet.asset.service.AssetCategoryPropertyLocalService assetCategoryPropertyLocalService) {
324 this.assetCategoryPropertyLocalService = assetCategoryPropertyLocalService;
325 }
326
327
332 public com.liferay.portlet.asset.service.AssetCategoryPropertyService getAssetCategoryPropertyService() {
333 return assetCategoryPropertyService;
334 }
335
336
341 public void setAssetCategoryPropertyService(
342 com.liferay.portlet.asset.service.AssetCategoryPropertyService assetCategoryPropertyService) {
343 this.assetCategoryPropertyService = assetCategoryPropertyService;
344 }
345
346
351 public AssetCategoryPropertyPersistence getAssetCategoryPropertyPersistence() {
352 return assetCategoryPropertyPersistence;
353 }
354
355
360 public void setAssetCategoryPropertyPersistence(
361 AssetCategoryPropertyPersistence assetCategoryPropertyPersistence) {
362 this.assetCategoryPropertyPersistence = assetCategoryPropertyPersistence;
363 }
364
365
370 public AssetCategoryPropertyFinder getAssetCategoryPropertyFinder() {
371 return assetCategoryPropertyFinder;
372 }
373
374
379 public void setAssetCategoryPropertyFinder(
380 AssetCategoryPropertyFinder assetCategoryPropertyFinder) {
381 this.assetCategoryPropertyFinder = assetCategoryPropertyFinder;
382 }
383
384
389 public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
390 return counterLocalService;
391 }
392
393
398 public void setCounterLocalService(
399 com.liferay.counter.service.CounterLocalService counterLocalService) {
400 this.counterLocalService = counterLocalService;
401 }
402
403
408 public com.liferay.portal.service.UserLocalService getUserLocalService() {
409 return userLocalService;
410 }
411
412
417 public void setUserLocalService(
418 com.liferay.portal.service.UserLocalService userLocalService) {
419 this.userLocalService = userLocalService;
420 }
421
422
427 public com.liferay.portal.service.UserService getUserService() {
428 return userService;
429 }
430
431
436 public void setUserService(
437 com.liferay.portal.service.UserService userService) {
438 this.userService = userService;
439 }
440
441
446 public UserPersistence getUserPersistence() {
447 return userPersistence;
448 }
449
450
455 public void setUserPersistence(UserPersistence userPersistence) {
456 this.userPersistence = userPersistence;
457 }
458
459
464 public UserFinder getUserFinder() {
465 return userFinder;
466 }
467
468
473 public void setUserFinder(UserFinder userFinder) {
474 this.userFinder = userFinder;
475 }
476
477 public void afterPropertiesSet() {
478 persistedModelLocalServiceRegistry.register("com.liferay.portlet.asset.model.AssetCategoryProperty",
479 assetCategoryPropertyLocalService);
480 }
481
482 public void destroy() {
483 persistedModelLocalServiceRegistry.unregister(
484 "com.liferay.portlet.asset.model.AssetCategoryProperty");
485 }
486
487
492 @Override
493 public String getBeanIdentifier() {
494 return _beanIdentifier;
495 }
496
497
502 @Override
503 public void setBeanIdentifier(String beanIdentifier) {
504 _beanIdentifier = beanIdentifier;
505 }
506
507 protected Class<?> getModelClass() {
508 return AssetCategoryProperty.class;
509 }
510
511 protected String getModelClassName() {
512 return AssetCategoryProperty.class.getName();
513 }
514
515
520 protected void runSQL(String sql) {
521 try {
522 DataSource dataSource = assetCategoryPropertyPersistence.getDataSource();
523
524 DB db = DBFactoryUtil.getDB();
525
526 sql = db.buildSQL(sql);
527 sql = PortalUtil.transformSQL(sql);
528
529 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
530 sql, new int[0]);
531
532 sqlUpdate.update();
533 }
534 catch (Exception e) {
535 throw new SystemException(e);
536 }
537 }
538
539 @BeanReference(type = com.liferay.portlet.asset.service.AssetCategoryPropertyLocalService.class)
540 protected com.liferay.portlet.asset.service.AssetCategoryPropertyLocalService assetCategoryPropertyLocalService;
541 @BeanReference(type = com.liferay.portlet.asset.service.AssetCategoryPropertyService.class)
542 protected com.liferay.portlet.asset.service.AssetCategoryPropertyService assetCategoryPropertyService;
543 @BeanReference(type = AssetCategoryPropertyPersistence.class)
544 protected AssetCategoryPropertyPersistence assetCategoryPropertyPersistence;
545 @BeanReference(type = AssetCategoryPropertyFinder.class)
546 protected AssetCategoryPropertyFinder assetCategoryPropertyFinder;
547 @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
548 protected com.liferay.counter.service.CounterLocalService counterLocalService;
549 @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
550 protected com.liferay.portal.service.UserLocalService userLocalService;
551 @BeanReference(type = com.liferay.portal.service.UserService.class)
552 protected com.liferay.portal.service.UserService userService;
553 @BeanReference(type = UserPersistence.class)
554 protected UserPersistence userPersistence;
555 @BeanReference(type = UserFinder.class)
556 protected UserFinder userFinder;
557 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
558 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
559 private String _beanIdentifier;
560 }