001
014
015 package com.liferay.portal.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.model.UserNotificationDelivery;
037 import com.liferay.portal.service.BaseLocalServiceImpl;
038 import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
039 import com.liferay.portal.service.UserNotificationDeliveryLocalService;
040 import com.liferay.portal.service.persistence.UserFinder;
041 import com.liferay.portal.service.persistence.UserNotificationDeliveryPersistence;
042 import com.liferay.portal.service.persistence.UserPersistence;
043 import com.liferay.portal.util.PortalUtil;
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 UserNotificationDeliveryLocalServiceBaseImpl
065 extends BaseLocalServiceImpl implements UserNotificationDeliveryLocalService,
066 IdentifiableBean {
067
072
073
079 @Indexable(type = IndexableType.REINDEX)
080 @Override
081 public UserNotificationDelivery addUserNotificationDelivery(
082 UserNotificationDelivery userNotificationDelivery) {
083 userNotificationDelivery.setNew(true);
084
085 return userNotificationDeliveryPersistence.update(userNotificationDelivery);
086 }
087
088
094 @Override
095 public UserNotificationDelivery createUserNotificationDelivery(
096 long userNotificationDeliveryId) {
097 return userNotificationDeliveryPersistence.create(userNotificationDeliveryId);
098 }
099
100
107 @Indexable(type = IndexableType.DELETE)
108 @Override
109 public UserNotificationDelivery deleteUserNotificationDelivery(
110 long userNotificationDeliveryId) throws PortalException {
111 return userNotificationDeliveryPersistence.remove(userNotificationDeliveryId);
112 }
113
114
120 @Indexable(type = IndexableType.DELETE)
121 @Override
122 public UserNotificationDelivery deleteUserNotificationDelivery(
123 UserNotificationDelivery userNotificationDelivery) {
124 return userNotificationDeliveryPersistence.remove(userNotificationDelivery);
125 }
126
127 @Override
128 public DynamicQuery dynamicQuery() {
129 Class<?> clazz = getClass();
130
131 return DynamicQueryFactoryUtil.forClass(UserNotificationDelivery.class,
132 clazz.getClassLoader());
133 }
134
135
141 @Override
142 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
143 return userNotificationDeliveryPersistence.findWithDynamicQuery(dynamicQuery);
144 }
145
146
158 @Override
159 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
160 int end) {
161 return userNotificationDeliveryPersistence.findWithDynamicQuery(dynamicQuery,
162 start, end);
163 }
164
165
178 @Override
179 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
180 int end, OrderByComparator<T> orderByComparator) {
181 return userNotificationDeliveryPersistence.findWithDynamicQuery(dynamicQuery,
182 start, end, orderByComparator);
183 }
184
185
191 @Override
192 public long dynamicQueryCount(DynamicQuery dynamicQuery) {
193 return userNotificationDeliveryPersistence.countWithDynamicQuery(dynamicQuery);
194 }
195
196
203 @Override
204 public long dynamicQueryCount(DynamicQuery dynamicQuery,
205 Projection projection) {
206 return userNotificationDeliveryPersistence.countWithDynamicQuery(dynamicQuery,
207 projection);
208 }
209
210 @Override
211 public UserNotificationDelivery fetchUserNotificationDelivery(
212 long userNotificationDeliveryId) {
213 return userNotificationDeliveryPersistence.fetchByPrimaryKey(userNotificationDeliveryId);
214 }
215
216
223 @Override
224 public UserNotificationDelivery getUserNotificationDelivery(
225 long userNotificationDeliveryId) throws PortalException {
226 return userNotificationDeliveryPersistence.findByPrimaryKey(userNotificationDeliveryId);
227 }
228
229 @Override
230 public ActionableDynamicQuery getActionableDynamicQuery() {
231 ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
232
233 actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.UserNotificationDeliveryLocalServiceUtil.getService());
234 actionableDynamicQuery.setClass(UserNotificationDelivery.class);
235 actionableDynamicQuery.setClassLoader(getClassLoader());
236
237 actionableDynamicQuery.setPrimaryKeyPropertyName(
238 "userNotificationDeliveryId");
239
240 return actionableDynamicQuery;
241 }
242
243 protected void initActionableDynamicQuery(
244 ActionableDynamicQuery actionableDynamicQuery) {
245 actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.UserNotificationDeliveryLocalServiceUtil.getService());
246 actionableDynamicQuery.setClass(UserNotificationDelivery.class);
247 actionableDynamicQuery.setClassLoader(getClassLoader());
248
249 actionableDynamicQuery.setPrimaryKeyPropertyName(
250 "userNotificationDeliveryId");
251 }
252
253
256 @Override
257 public PersistedModel deletePersistedModel(PersistedModel persistedModel)
258 throws PortalException {
259 return userNotificationDeliveryLocalService.deleteUserNotificationDelivery((UserNotificationDelivery)persistedModel);
260 }
261
262 @Override
263 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
264 throws PortalException {
265 return userNotificationDeliveryPersistence.findByPrimaryKey(primaryKeyObj);
266 }
267
268
279 @Override
280 public List<UserNotificationDelivery> getUserNotificationDeliveries(
281 int start, int end) {
282 return userNotificationDeliveryPersistence.findAll(start, end);
283 }
284
285
290 @Override
291 public int getUserNotificationDeliveriesCount() {
292 return userNotificationDeliveryPersistence.countAll();
293 }
294
295
301 @Indexable(type = IndexableType.REINDEX)
302 @Override
303 public UserNotificationDelivery updateUserNotificationDelivery(
304 UserNotificationDelivery userNotificationDelivery) {
305 return userNotificationDeliveryPersistence.update(userNotificationDelivery);
306 }
307
308
313 public com.liferay.portal.service.UserNotificationDeliveryLocalService getUserNotificationDeliveryLocalService() {
314 return userNotificationDeliveryLocalService;
315 }
316
317
322 public void setUserNotificationDeliveryLocalService(
323 com.liferay.portal.service.UserNotificationDeliveryLocalService userNotificationDeliveryLocalService) {
324 this.userNotificationDeliveryLocalService = userNotificationDeliveryLocalService;
325 }
326
327
332 public UserNotificationDeliveryPersistence getUserNotificationDeliveryPersistence() {
333 return userNotificationDeliveryPersistence;
334 }
335
336
341 public void setUserNotificationDeliveryPersistence(
342 UserNotificationDeliveryPersistence userNotificationDeliveryPersistence) {
343 this.userNotificationDeliveryPersistence = userNotificationDeliveryPersistence;
344 }
345
346
351 public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
352 return counterLocalService;
353 }
354
355
360 public void setCounterLocalService(
361 com.liferay.counter.service.CounterLocalService counterLocalService) {
362 this.counterLocalService = counterLocalService;
363 }
364
365
370 public com.liferay.portal.service.UserLocalService getUserLocalService() {
371 return userLocalService;
372 }
373
374
379 public void setUserLocalService(
380 com.liferay.portal.service.UserLocalService userLocalService) {
381 this.userLocalService = userLocalService;
382 }
383
384
389 public com.liferay.portal.service.UserService getUserService() {
390 return userService;
391 }
392
393
398 public void setUserService(
399 com.liferay.portal.service.UserService userService) {
400 this.userService = userService;
401 }
402
403
408 public UserPersistence getUserPersistence() {
409 return userPersistence;
410 }
411
412
417 public void setUserPersistence(UserPersistence userPersistence) {
418 this.userPersistence = userPersistence;
419 }
420
421
426 public UserFinder getUserFinder() {
427 return userFinder;
428 }
429
430
435 public void setUserFinder(UserFinder userFinder) {
436 this.userFinder = userFinder;
437 }
438
439 public void afterPropertiesSet() {
440 persistedModelLocalServiceRegistry.register("com.liferay.portal.model.UserNotificationDelivery",
441 userNotificationDeliveryLocalService);
442 }
443
444 public void destroy() {
445 persistedModelLocalServiceRegistry.unregister(
446 "com.liferay.portal.model.UserNotificationDelivery");
447 }
448
449
454 @Override
455 public String getBeanIdentifier() {
456 return _beanIdentifier;
457 }
458
459
464 @Override
465 public void setBeanIdentifier(String beanIdentifier) {
466 _beanIdentifier = beanIdentifier;
467 }
468
469 protected Class<?> getModelClass() {
470 return UserNotificationDelivery.class;
471 }
472
473 protected String getModelClassName() {
474 return UserNotificationDelivery.class.getName();
475 }
476
477
482 protected void runSQL(String sql) {
483 try {
484 DataSource dataSource = userNotificationDeliveryPersistence.getDataSource();
485
486 DB db = DBFactoryUtil.getDB();
487
488 sql = db.buildSQL(sql);
489 sql = PortalUtil.transformSQL(sql);
490
491 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
492 sql, new int[0]);
493
494 sqlUpdate.update();
495 }
496 catch (Exception e) {
497 throw new SystemException(e);
498 }
499 }
500
501 @BeanReference(type = com.liferay.portal.service.UserNotificationDeliveryLocalService.class)
502 protected com.liferay.portal.service.UserNotificationDeliveryLocalService userNotificationDeliveryLocalService;
503 @BeanReference(type = UserNotificationDeliveryPersistence.class)
504 protected UserNotificationDeliveryPersistence userNotificationDeliveryPersistence;
505 @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
506 protected com.liferay.counter.service.CounterLocalService counterLocalService;
507 @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
508 protected com.liferay.portal.service.UserLocalService userLocalService;
509 @BeanReference(type = com.liferay.portal.service.UserService.class)
510 protected com.liferay.portal.service.UserService userService;
511 @BeanReference(type = UserPersistence.class)
512 protected UserPersistence userPersistence;
513 @BeanReference(type = UserFinder.class)
514 protected UserFinder userFinder;
515 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
516 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
517 private String _beanIdentifier;
518 }