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.UserNotificationEvent;
038 import com.liferay.portal.service.BaseLocalServiceImpl;
039 import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
040 import com.liferay.portal.service.UserNotificationEventLocalService;
041 import com.liferay.portal.service.persistence.UserFinder;
042 import com.liferay.portal.service.persistence.UserNotificationEventPersistence;
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 UserNotificationEventLocalServiceBaseImpl
066 extends BaseLocalServiceImpl implements UserNotificationEventLocalService,
067 IdentifiableOSGiService {
068
073
074
080 @Indexable(type = IndexableType.REINDEX)
081 @Override
082 public UserNotificationEvent addUserNotificationEvent(
083 UserNotificationEvent userNotificationEvent) {
084 userNotificationEvent.setNew(true);
085
086 return userNotificationEventPersistence.update(userNotificationEvent);
087 }
088
089
095 @Override
096 public UserNotificationEvent createUserNotificationEvent(
097 long userNotificationEventId) {
098 return userNotificationEventPersistence.create(userNotificationEventId);
099 }
100
101
108 @Indexable(type = IndexableType.DELETE)
109 @Override
110 public UserNotificationEvent deleteUserNotificationEvent(
111 long userNotificationEventId) throws PortalException {
112 return userNotificationEventPersistence.remove(userNotificationEventId);
113 }
114
115
121 @Indexable(type = IndexableType.DELETE)
122 @Override
123 public UserNotificationEvent deleteUserNotificationEvent(
124 UserNotificationEvent userNotificationEvent) {
125 return userNotificationEventPersistence.remove(userNotificationEvent);
126 }
127
128 @Override
129 public DynamicQuery dynamicQuery() {
130 Class<?> clazz = getClass();
131
132 return DynamicQueryFactoryUtil.forClass(UserNotificationEvent.class,
133 clazz.getClassLoader());
134 }
135
136
142 @Override
143 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
144 return userNotificationEventPersistence.findWithDynamicQuery(dynamicQuery);
145 }
146
147
159 @Override
160 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
161 int end) {
162 return userNotificationEventPersistence.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 userNotificationEventPersistence.findWithDynamicQuery(dynamicQuery,
183 start, end, orderByComparator);
184 }
185
186
192 @Override
193 public long dynamicQueryCount(DynamicQuery dynamicQuery) {
194 return userNotificationEventPersistence.countWithDynamicQuery(dynamicQuery);
195 }
196
197
204 @Override
205 public long dynamicQueryCount(DynamicQuery dynamicQuery,
206 Projection projection) {
207 return userNotificationEventPersistence.countWithDynamicQuery(dynamicQuery,
208 projection);
209 }
210
211 @Override
212 public UserNotificationEvent fetchUserNotificationEvent(
213 long userNotificationEventId) {
214 return userNotificationEventPersistence.fetchByPrimaryKey(userNotificationEventId);
215 }
216
217
224 @Override
225 public UserNotificationEvent fetchUserNotificationEventByUuidAndCompanyId(
226 String uuid, long companyId) {
227 return userNotificationEventPersistence.fetchByUuid_C_First(uuid,
228 companyId, null);
229 }
230
231
238 @Override
239 public UserNotificationEvent getUserNotificationEvent(
240 long userNotificationEventId) throws PortalException {
241 return userNotificationEventPersistence.findByPrimaryKey(userNotificationEventId);
242 }
243
244 @Override
245 public ActionableDynamicQuery getActionableDynamicQuery() {
246 ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
247
248 actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.UserNotificationEventLocalServiceUtil.getService());
249 actionableDynamicQuery.setClassLoader(getClassLoader());
250 actionableDynamicQuery.setModelClass(UserNotificationEvent.class);
251
252 actionableDynamicQuery.setPrimaryKeyPropertyName(
253 "userNotificationEventId");
254
255 return actionableDynamicQuery;
256 }
257
258 @Override
259 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
260 IndexableActionableDynamicQuery indexableActionableDynamicQuery = new IndexableActionableDynamicQuery();
261
262 indexableActionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.UserNotificationEventLocalServiceUtil.getService());
263 indexableActionableDynamicQuery.setClassLoader(getClassLoader());
264 indexableActionableDynamicQuery.setModelClass(UserNotificationEvent.class);
265
266 indexableActionableDynamicQuery.setPrimaryKeyPropertyName(
267 "userNotificationEventId");
268
269 return indexableActionableDynamicQuery;
270 }
271
272 protected void initActionableDynamicQuery(
273 ActionableDynamicQuery actionableDynamicQuery) {
274 actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.UserNotificationEventLocalServiceUtil.getService());
275 actionableDynamicQuery.setClassLoader(getClassLoader());
276 actionableDynamicQuery.setModelClass(UserNotificationEvent.class);
277
278 actionableDynamicQuery.setPrimaryKeyPropertyName(
279 "userNotificationEventId");
280 }
281
282
285 @Override
286 public PersistedModel deletePersistedModel(PersistedModel persistedModel)
287 throws PortalException {
288 return userNotificationEventLocalService.deleteUserNotificationEvent((UserNotificationEvent)persistedModel);
289 }
290
291 @Override
292 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
293 throws PortalException {
294 return userNotificationEventPersistence.findByPrimaryKey(primaryKeyObj);
295 }
296
297
305 @Override
306 public UserNotificationEvent getUserNotificationEventByUuidAndCompanyId(
307 String uuid, long companyId) throws PortalException {
308 return userNotificationEventPersistence.findByUuid_C_First(uuid,
309 companyId, null);
310 }
311
312
323 @Override
324 public List<UserNotificationEvent> getUserNotificationEvents(int start,
325 int end) {
326 return userNotificationEventPersistence.findAll(start, end);
327 }
328
329
334 @Override
335 public int getUserNotificationEventsCount() {
336 return userNotificationEventPersistence.countAll();
337 }
338
339
345 @Indexable(type = IndexableType.REINDEX)
346 @Override
347 public UserNotificationEvent updateUserNotificationEvent(
348 UserNotificationEvent userNotificationEvent) {
349 return userNotificationEventPersistence.update(userNotificationEvent);
350 }
351
352
357 public UserNotificationEventLocalService getUserNotificationEventLocalService() {
358 return userNotificationEventLocalService;
359 }
360
361
366 public void setUserNotificationEventLocalService(
367 UserNotificationEventLocalService userNotificationEventLocalService) {
368 this.userNotificationEventLocalService = userNotificationEventLocalService;
369 }
370
371
376 public UserNotificationEventPersistence getUserNotificationEventPersistence() {
377 return userNotificationEventPersistence;
378 }
379
380
385 public void setUserNotificationEventPersistence(
386 UserNotificationEventPersistence userNotificationEventPersistence) {
387 this.userNotificationEventPersistence = userNotificationEventPersistence;
388 }
389
390
395 public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
396 return counterLocalService;
397 }
398
399
404 public void setCounterLocalService(
405 com.liferay.counter.service.CounterLocalService counterLocalService) {
406 this.counterLocalService = counterLocalService;
407 }
408
409
414 public com.liferay.portal.service.UserLocalService getUserLocalService() {
415 return userLocalService;
416 }
417
418
423 public void setUserLocalService(
424 com.liferay.portal.service.UserLocalService userLocalService) {
425 this.userLocalService = userLocalService;
426 }
427
428
433 public UserPersistence getUserPersistence() {
434 return userPersistence;
435 }
436
437
442 public void setUserPersistence(UserPersistence userPersistence) {
443 this.userPersistence = userPersistence;
444 }
445
446
451 public UserFinder getUserFinder() {
452 return userFinder;
453 }
454
455
460 public void setUserFinder(UserFinder userFinder) {
461 this.userFinder = userFinder;
462 }
463
464 public void afterPropertiesSet() {
465 persistedModelLocalServiceRegistry.register("com.liferay.portal.model.UserNotificationEvent",
466 userNotificationEventLocalService);
467 }
468
469 public void destroy() {
470 persistedModelLocalServiceRegistry.unregister(
471 "com.liferay.portal.model.UserNotificationEvent");
472 }
473
474
479 @Override
480 public String getOSGiServiceIdentifier() {
481 return UserNotificationEventLocalService.class.getName();
482 }
483
484 protected Class<?> getModelClass() {
485 return UserNotificationEvent.class;
486 }
487
488 protected String getModelClassName() {
489 return UserNotificationEvent.class.getName();
490 }
491
492
497 protected void runSQL(String sql) {
498 try {
499 DataSource dataSource = userNotificationEventPersistence.getDataSource();
500
501 DB db = DBManagerUtil.getDB();
502
503 sql = db.buildSQL(sql);
504 sql = PortalUtil.transformSQL(sql);
505
506 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
507 sql, new int[0]);
508
509 sqlUpdate.update();
510 }
511 catch (Exception e) {
512 throw new SystemException(e);
513 }
514 }
515
516 @BeanReference(type = com.liferay.portal.service.UserNotificationEventLocalService.class)
517 protected UserNotificationEventLocalService userNotificationEventLocalService;
518 @BeanReference(type = UserNotificationEventPersistence.class)
519 protected UserNotificationEventPersistence userNotificationEventPersistence;
520 @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
521 protected com.liferay.counter.service.CounterLocalService counterLocalService;
522 @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
523 protected com.liferay.portal.service.UserLocalService userLocalService;
524 @BeanReference(type = UserPersistence.class)
525 protected UserPersistence userPersistence;
526 @BeanReference(type = UserFinder.class)
527 protected UserFinder userFinder;
528 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
529 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
530 }