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.dao.db.DB;
021 import com.liferay.portal.kernel.dao.db.DBManagerUtil;
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.IndexableActionableDynamicQuery;
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.module.framework.service.IdentifiableOSGiService;
033 import com.liferay.portal.kernel.search.Indexable;
034 import com.liferay.portal.kernel.search.IndexableType;
035 import com.liferay.portal.kernel.util.OrderByComparator;
036 import com.liferay.portal.model.PersistedModel;
037 import com.liferay.portal.service.BaseLocalServiceImpl;
038 import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
039 import com.liferay.portal.service.persistence.UserFinder;
040 import com.liferay.portal.service.persistence.UserPersistence;
041 import com.liferay.portal.util.PortalUtil;
042
043 import com.liferay.portlet.asset.model.AssetCategoryProperty;
044 import com.liferay.portlet.asset.service.AssetCategoryPropertyLocalService;
045 import com.liferay.portlet.asset.service.persistence.AssetCategoryPropertyFinder;
046 import com.liferay.portlet.asset.service.persistence.AssetCategoryPropertyPersistence;
047
048 import java.io.Serializable;
049
050 import java.util.List;
051
052 import javax.sql.DataSource;
053
054
066 @ProviderType
067 public abstract class AssetCategoryPropertyLocalServiceBaseImpl
068 extends BaseLocalServiceImpl implements AssetCategoryPropertyLocalService,
069 IdentifiableOSGiService {
070
075
076
082 @Indexable(type = IndexableType.REINDEX)
083 @Override
084 public AssetCategoryProperty addAssetCategoryProperty(
085 AssetCategoryProperty assetCategoryProperty) {
086 assetCategoryProperty.setNew(true);
087
088 return assetCategoryPropertyPersistence.update(assetCategoryProperty);
089 }
090
091
097 @Override
098 public AssetCategoryProperty createAssetCategoryProperty(
099 long categoryPropertyId) {
100 return assetCategoryPropertyPersistence.create(categoryPropertyId);
101 }
102
103
110 @Indexable(type = IndexableType.DELETE)
111 @Override
112 public AssetCategoryProperty deleteAssetCategoryProperty(
113 long categoryPropertyId) throws PortalException {
114 return assetCategoryPropertyPersistence.remove(categoryPropertyId);
115 }
116
117
123 @Indexable(type = IndexableType.DELETE)
124 @Override
125 public AssetCategoryProperty deleteAssetCategoryProperty(
126 AssetCategoryProperty assetCategoryProperty) {
127 return assetCategoryPropertyPersistence.remove(assetCategoryProperty);
128 }
129
130 @Override
131 public DynamicQuery dynamicQuery() {
132 Class<?> clazz = getClass();
133
134 return DynamicQueryFactoryUtil.forClass(AssetCategoryProperty.class,
135 clazz.getClassLoader());
136 }
137
138
144 @Override
145 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
146 return assetCategoryPropertyPersistence.findWithDynamicQuery(dynamicQuery);
147 }
148
149
161 @Override
162 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
163 int end) {
164 return assetCategoryPropertyPersistence.findWithDynamicQuery(dynamicQuery,
165 start, end);
166 }
167
168
181 @Override
182 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
183 int end, OrderByComparator<T> orderByComparator) {
184 return assetCategoryPropertyPersistence.findWithDynamicQuery(dynamicQuery,
185 start, end, orderByComparator);
186 }
187
188
194 @Override
195 public long dynamicQueryCount(DynamicQuery dynamicQuery) {
196 return assetCategoryPropertyPersistence.countWithDynamicQuery(dynamicQuery);
197 }
198
199
206 @Override
207 public long dynamicQueryCount(DynamicQuery dynamicQuery,
208 Projection projection) {
209 return assetCategoryPropertyPersistence.countWithDynamicQuery(dynamicQuery,
210 projection);
211 }
212
213 @Override
214 public AssetCategoryProperty fetchAssetCategoryProperty(
215 long categoryPropertyId) {
216 return assetCategoryPropertyPersistence.fetchByPrimaryKey(categoryPropertyId);
217 }
218
219
226 @Override
227 public AssetCategoryProperty getAssetCategoryProperty(
228 long categoryPropertyId) throws PortalException {
229 return assetCategoryPropertyPersistence.findByPrimaryKey(categoryPropertyId);
230 }
231
232 @Override
233 public ActionableDynamicQuery getActionableDynamicQuery() {
234 ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
235
236 actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.asset.service.AssetCategoryPropertyLocalServiceUtil.getService());
237 actionableDynamicQuery.setClassLoader(getClassLoader());
238 actionableDynamicQuery.setModelClass(AssetCategoryProperty.class);
239
240 actionableDynamicQuery.setPrimaryKeyPropertyName("categoryPropertyId");
241
242 return actionableDynamicQuery;
243 }
244
245 @Override
246 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
247 IndexableActionableDynamicQuery indexableActionableDynamicQuery = new IndexableActionableDynamicQuery();
248
249 indexableActionableDynamicQuery.setBaseLocalService(com.liferay.portlet.asset.service.AssetCategoryPropertyLocalServiceUtil.getService());
250 indexableActionableDynamicQuery.setClassLoader(getClassLoader());
251 indexableActionableDynamicQuery.setModelClass(AssetCategoryProperty.class);
252
253 indexableActionableDynamicQuery.setPrimaryKeyPropertyName(
254 "categoryPropertyId");
255
256 return indexableActionableDynamicQuery;
257 }
258
259 protected void initActionableDynamicQuery(
260 ActionableDynamicQuery actionableDynamicQuery) {
261 actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.asset.service.AssetCategoryPropertyLocalServiceUtil.getService());
262 actionableDynamicQuery.setClassLoader(getClassLoader());
263 actionableDynamicQuery.setModelClass(AssetCategoryProperty.class);
264
265 actionableDynamicQuery.setPrimaryKeyPropertyName("categoryPropertyId");
266 }
267
268
271 @Override
272 public PersistedModel deletePersistedModel(PersistedModel persistedModel)
273 throws PortalException {
274 return assetCategoryPropertyLocalService.deleteAssetCategoryProperty((AssetCategoryProperty)persistedModel);
275 }
276
277 @Override
278 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
279 throws PortalException {
280 return assetCategoryPropertyPersistence.findByPrimaryKey(primaryKeyObj);
281 }
282
283
294 @Override
295 public List<AssetCategoryProperty> getAssetCategoryProperties(int start,
296 int end) {
297 return assetCategoryPropertyPersistence.findAll(start, end);
298 }
299
300
305 @Override
306 public int getAssetCategoryPropertiesCount() {
307 return assetCategoryPropertyPersistence.countAll();
308 }
309
310
316 @Indexable(type = IndexableType.REINDEX)
317 @Override
318 public AssetCategoryProperty updateAssetCategoryProperty(
319 AssetCategoryProperty assetCategoryProperty) {
320 return assetCategoryPropertyPersistence.update(assetCategoryProperty);
321 }
322
323
328 public AssetCategoryPropertyLocalService getAssetCategoryPropertyLocalService() {
329 return assetCategoryPropertyLocalService;
330 }
331
332
337 public void setAssetCategoryPropertyLocalService(
338 AssetCategoryPropertyLocalService assetCategoryPropertyLocalService) {
339 this.assetCategoryPropertyLocalService = assetCategoryPropertyLocalService;
340 }
341
342
347 public AssetCategoryPropertyPersistence getAssetCategoryPropertyPersistence() {
348 return assetCategoryPropertyPersistence;
349 }
350
351
356 public void setAssetCategoryPropertyPersistence(
357 AssetCategoryPropertyPersistence assetCategoryPropertyPersistence) {
358 this.assetCategoryPropertyPersistence = assetCategoryPropertyPersistence;
359 }
360
361
366 public AssetCategoryPropertyFinder getAssetCategoryPropertyFinder() {
367 return assetCategoryPropertyFinder;
368 }
369
370
375 public void setAssetCategoryPropertyFinder(
376 AssetCategoryPropertyFinder assetCategoryPropertyFinder) {
377 this.assetCategoryPropertyFinder = assetCategoryPropertyFinder;
378 }
379
380
385 public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
386 return counterLocalService;
387 }
388
389
394 public void setCounterLocalService(
395 com.liferay.counter.service.CounterLocalService counterLocalService) {
396 this.counterLocalService = counterLocalService;
397 }
398
399
404 public com.liferay.portal.service.UserLocalService getUserLocalService() {
405 return userLocalService;
406 }
407
408
413 public void setUserLocalService(
414 com.liferay.portal.service.UserLocalService userLocalService) {
415 this.userLocalService = userLocalService;
416 }
417
418
423 public UserPersistence getUserPersistence() {
424 return userPersistence;
425 }
426
427
432 public void setUserPersistence(UserPersistence userPersistence) {
433 this.userPersistence = userPersistence;
434 }
435
436
441 public UserFinder getUserFinder() {
442 return userFinder;
443 }
444
445
450 public void setUserFinder(UserFinder userFinder) {
451 this.userFinder = userFinder;
452 }
453
454 public void afterPropertiesSet() {
455 persistedModelLocalServiceRegistry.register("com.liferay.portlet.asset.model.AssetCategoryProperty",
456 assetCategoryPropertyLocalService);
457 }
458
459 public void destroy() {
460 persistedModelLocalServiceRegistry.unregister(
461 "com.liferay.portlet.asset.model.AssetCategoryProperty");
462 }
463
464
469 @Override
470 public String getOSGiServiceIdentifier() {
471 return AssetCategoryPropertyLocalService.class.getName();
472 }
473
474 protected Class<?> getModelClass() {
475 return AssetCategoryProperty.class;
476 }
477
478 protected String getModelClassName() {
479 return AssetCategoryProperty.class.getName();
480 }
481
482
487 protected void runSQL(String sql) {
488 try {
489 DataSource dataSource = assetCategoryPropertyPersistence.getDataSource();
490
491 DB db = DBManagerUtil.getDB();
492
493 sql = db.buildSQL(sql);
494 sql = PortalUtil.transformSQL(sql);
495
496 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
497 sql, new int[0]);
498
499 sqlUpdate.update();
500 }
501 catch (Exception e) {
502 throw new SystemException(e);
503 }
504 }
505
506 @BeanReference(type = com.liferay.portlet.asset.service.AssetCategoryPropertyLocalService.class)
507 protected AssetCategoryPropertyLocalService assetCategoryPropertyLocalService;
508 @BeanReference(type = AssetCategoryPropertyPersistence.class)
509 protected AssetCategoryPropertyPersistence assetCategoryPropertyPersistence;
510 @BeanReference(type = AssetCategoryPropertyFinder.class)
511 protected AssetCategoryPropertyFinder assetCategoryPropertyFinder;
512 @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
513 protected com.liferay.counter.service.CounterLocalService counterLocalService;
514 @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
515 protected com.liferay.portal.service.UserLocalService userLocalService;
516 @BeanReference(type = UserPersistence.class)
517 protected UserPersistence userPersistence;
518 @BeanReference(type = UserFinder.class)
519 protected UserFinder userFinder;
520 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
521 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
522 }