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.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.model.UserNotificationDelivery;
038 import com.liferay.portal.service.BaseLocalServiceImpl;
039 import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
040 import com.liferay.portal.service.UserNotificationDeliveryLocalService;
041 import com.liferay.portal.service.persistence.UserFinder;
042 import com.liferay.portal.service.persistence.UserNotificationDeliveryPersistence;
043 import com.liferay.portal.service.persistence.UserPersistence;
044 import com.liferay.portal.util.PortalUtil;
045
046 import java.io.Serializable;
047
048 import java.util.List;
049
050 import javax.sql.DataSource;
051
052
064 @ProviderType
065 public abstract class UserNotificationDeliveryLocalServiceBaseImpl
066 extends BaseLocalServiceImpl implements UserNotificationDeliveryLocalService,
067 IdentifiableOSGiService {
068
073
074
080 @Indexable(type = IndexableType.REINDEX)
081 @Override
082 public UserNotificationDelivery addUserNotificationDelivery(
083 UserNotificationDelivery userNotificationDelivery) {
084 userNotificationDelivery.setNew(true);
085
086 return userNotificationDeliveryPersistence.update(userNotificationDelivery);
087 }
088
089
095 @Override
096 public UserNotificationDelivery createUserNotificationDelivery(
097 long userNotificationDeliveryId) {
098 return userNotificationDeliveryPersistence.create(userNotificationDeliveryId);
099 }
100
101
108 @Indexable(type = IndexableType.DELETE)
109 @Override
110 public UserNotificationDelivery deleteUserNotificationDelivery(
111 long userNotificationDeliveryId) throws PortalException {
112 return userNotificationDeliveryPersistence.remove(userNotificationDeliveryId);
113 }
114
115
121 @Indexable(type = IndexableType.DELETE)
122 @Override
123 public UserNotificationDelivery deleteUserNotificationDelivery(
124 UserNotificationDelivery userNotificationDelivery) {
125 return userNotificationDeliveryPersistence.remove(userNotificationDelivery);
126 }
127
128 @Override
129 public DynamicQuery dynamicQuery() {
130 Class<?> clazz = getClass();
131
132 return DynamicQueryFactoryUtil.forClass(UserNotificationDelivery.class,
133 clazz.getClassLoader());
134 }
135
136
142 @Override
143 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
144 return userNotificationDeliveryPersistence.findWithDynamicQuery(dynamicQuery);
145 }
146
147
159 @Override
160 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
161 int end) {
162 return userNotificationDeliveryPersistence.findWithDynamicQuery(dynamicQuery,
163 start, end);
164 }
165
166
179 @Override
180 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
181 int end, OrderByComparator<T> orderByComparator) {
182 return userNotificationDeliveryPersistence.findWithDynamicQuery(dynamicQuery,
183 start, end, orderByComparator);
184 }
185
186
192 @Override
193 public long dynamicQueryCount(DynamicQuery dynamicQuery) {
194 return userNotificationDeliveryPersistence.countWithDynamicQuery(dynamicQuery);
195 }
196
197
204 @Override
205 public long dynamicQueryCount(DynamicQuery dynamicQuery,
206 Projection projection) {
207 return userNotificationDeliveryPersistence.countWithDynamicQuery(dynamicQuery,
208 projection);
209 }
210
211 @Override
212 public UserNotificationDelivery fetchUserNotificationDelivery(
213 long userNotificationDeliveryId) {
214 return userNotificationDeliveryPersistence.fetchByPrimaryKey(userNotificationDeliveryId);
215 }
216
217
224 @Override
225 public UserNotificationDelivery getUserNotificationDelivery(
226 long userNotificationDeliveryId) throws PortalException {
227 return userNotificationDeliveryPersistence.findByPrimaryKey(userNotificationDeliveryId);
228 }
229
230 @Override
231 public ActionableDynamicQuery getActionableDynamicQuery() {
232 ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
233
234 actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.UserNotificationDeliveryLocalServiceUtil.getService());
235 actionableDynamicQuery.setClassLoader(getClassLoader());
236 actionableDynamicQuery.setModelClass(UserNotificationDelivery.class);
237
238 actionableDynamicQuery.setPrimaryKeyPropertyName(
239 "userNotificationDeliveryId");
240
241 return actionableDynamicQuery;
242 }
243
244 @Override
245 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
246 IndexableActionableDynamicQuery indexableActionableDynamicQuery = new IndexableActionableDynamicQuery();
247
248 indexableActionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.UserNotificationDeliveryLocalServiceUtil.getService());
249 indexableActionableDynamicQuery.setClassLoader(getClassLoader());
250 indexableActionableDynamicQuery.setModelClass(UserNotificationDelivery.class);
251
252 indexableActionableDynamicQuery.setPrimaryKeyPropertyName(
253 "userNotificationDeliveryId");
254
255 return indexableActionableDynamicQuery;
256 }
257
258 protected void initActionableDynamicQuery(
259 ActionableDynamicQuery actionableDynamicQuery) {
260 actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.UserNotificationDeliveryLocalServiceUtil.getService());
261 actionableDynamicQuery.setClassLoader(getClassLoader());
262 actionableDynamicQuery.setModelClass(UserNotificationDelivery.class);
263
264 actionableDynamicQuery.setPrimaryKeyPropertyName(
265 "userNotificationDeliveryId");
266 }
267
268
271 @Override
272 public PersistedModel deletePersistedModel(PersistedModel persistedModel)
273 throws PortalException {
274 return userNotificationDeliveryLocalService.deleteUserNotificationDelivery((UserNotificationDelivery)persistedModel);
275 }
276
277 @Override
278 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
279 throws PortalException {
280 return userNotificationDeliveryPersistence.findByPrimaryKey(primaryKeyObj);
281 }
282
283
294 @Override
295 public List<UserNotificationDelivery> getUserNotificationDeliveries(
296 int start, int end) {
297 return userNotificationDeliveryPersistence.findAll(start, end);
298 }
299
300
305 @Override
306 public int getUserNotificationDeliveriesCount() {
307 return userNotificationDeliveryPersistence.countAll();
308 }
309
310
316 @Indexable(type = IndexableType.REINDEX)
317 @Override
318 public UserNotificationDelivery updateUserNotificationDelivery(
319 UserNotificationDelivery userNotificationDelivery) {
320 return userNotificationDeliveryPersistence.update(userNotificationDelivery);
321 }
322
323
328 public UserNotificationDeliveryLocalService getUserNotificationDeliveryLocalService() {
329 return userNotificationDeliveryLocalService;
330 }
331
332
337 public void setUserNotificationDeliveryLocalService(
338 UserNotificationDeliveryLocalService userNotificationDeliveryLocalService) {
339 this.userNotificationDeliveryLocalService = userNotificationDeliveryLocalService;
340 }
341
342
347 public UserNotificationDeliveryPersistence getUserNotificationDeliveryPersistence() {
348 return userNotificationDeliveryPersistence;
349 }
350
351
356 public void setUserNotificationDeliveryPersistence(
357 UserNotificationDeliveryPersistence userNotificationDeliveryPersistence) {
358 this.userNotificationDeliveryPersistence = userNotificationDeliveryPersistence;
359 }
360
361
366 public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
367 return counterLocalService;
368 }
369
370
375 public void setCounterLocalService(
376 com.liferay.counter.service.CounterLocalService counterLocalService) {
377 this.counterLocalService = counterLocalService;
378 }
379
380
385 public com.liferay.portal.service.UserLocalService getUserLocalService() {
386 return userLocalService;
387 }
388
389
394 public void setUserLocalService(
395 com.liferay.portal.service.UserLocalService userLocalService) {
396 this.userLocalService = userLocalService;
397 }
398
399
404 public UserPersistence getUserPersistence() {
405 return userPersistence;
406 }
407
408
413 public void setUserPersistence(UserPersistence userPersistence) {
414 this.userPersistence = userPersistence;
415 }
416
417
422 public UserFinder getUserFinder() {
423 return userFinder;
424 }
425
426
431 public void setUserFinder(UserFinder userFinder) {
432 this.userFinder = userFinder;
433 }
434
435 public void afterPropertiesSet() {
436 persistedModelLocalServiceRegistry.register("com.liferay.portal.model.UserNotificationDelivery",
437 userNotificationDeliveryLocalService);
438 }
439
440 public void destroy() {
441 persistedModelLocalServiceRegistry.unregister(
442 "com.liferay.portal.model.UserNotificationDelivery");
443 }
444
445
450 @Override
451 public String getOSGiServiceIdentifier() {
452 return UserNotificationDeliveryLocalService.class.getName();
453 }
454
455 protected Class<?> getModelClass() {
456 return UserNotificationDelivery.class;
457 }
458
459 protected String getModelClassName() {
460 return UserNotificationDelivery.class.getName();
461 }
462
463
468 protected void runSQL(String sql) {
469 try {
470 DataSource dataSource = userNotificationDeliveryPersistence.getDataSource();
471
472 DB db = DBManagerUtil.getDB();
473
474 sql = db.buildSQL(sql);
475 sql = PortalUtil.transformSQL(sql);
476
477 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
478 sql, new int[0]);
479
480 sqlUpdate.update();
481 }
482 catch (Exception e) {
483 throw new SystemException(e);
484 }
485 }
486
487 @BeanReference(type = com.liferay.portal.service.UserNotificationDeliveryLocalService.class)
488 protected UserNotificationDeliveryLocalService userNotificationDeliveryLocalService;
489 @BeanReference(type = UserNotificationDeliveryPersistence.class)
490 protected UserNotificationDeliveryPersistence userNotificationDeliveryPersistence;
491 @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
492 protected com.liferay.counter.service.CounterLocalService counterLocalService;
493 @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
494 protected com.liferay.portal.service.UserLocalService userLocalService;
495 @BeanReference(type = UserPersistence.class)
496 protected UserPersistence userPersistence;
497 @BeanReference(type = UserFinder.class)
498 protected UserFinder userFinder;
499 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
500 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
501 }