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.UserNotificationEvent;
037 import com.liferay.portal.service.BaseLocalServiceImpl;
038 import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
039 import com.liferay.portal.service.UserNotificationEventLocalService;
040 import com.liferay.portal.service.persistence.UserFinder;
041 import com.liferay.portal.service.persistence.UserNotificationEventPersistence;
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 UserNotificationEventLocalServiceBaseImpl
065 extends BaseLocalServiceImpl implements UserNotificationEventLocalService,
066 IdentifiableBean {
067
072
073
079 @Indexable(type = IndexableType.REINDEX)
080 @Override
081 public UserNotificationEvent addUserNotificationEvent(
082 UserNotificationEvent userNotificationEvent) {
083 userNotificationEvent.setNew(true);
084
085 return userNotificationEventPersistence.update(userNotificationEvent);
086 }
087
088
094 @Override
095 public UserNotificationEvent createUserNotificationEvent(
096 long userNotificationEventId) {
097 return userNotificationEventPersistence.create(userNotificationEventId);
098 }
099
100
107 @Indexable(type = IndexableType.DELETE)
108 @Override
109 public UserNotificationEvent deleteUserNotificationEvent(
110 long userNotificationEventId) throws PortalException {
111 return userNotificationEventPersistence.remove(userNotificationEventId);
112 }
113
114
120 @Indexable(type = IndexableType.DELETE)
121 @Override
122 public UserNotificationEvent deleteUserNotificationEvent(
123 UserNotificationEvent userNotificationEvent) {
124 return userNotificationEventPersistence.remove(userNotificationEvent);
125 }
126
127 @Override
128 public DynamicQuery dynamicQuery() {
129 Class<?> clazz = getClass();
130
131 return DynamicQueryFactoryUtil.forClass(UserNotificationEvent.class,
132 clazz.getClassLoader());
133 }
134
135
141 @Override
142 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
143 return userNotificationEventPersistence.findWithDynamicQuery(dynamicQuery);
144 }
145
146
158 @Override
159 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
160 int end) {
161 return userNotificationEventPersistence.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 userNotificationEventPersistence.findWithDynamicQuery(dynamicQuery,
182 start, end, orderByComparator);
183 }
184
185
191 @Override
192 public long dynamicQueryCount(DynamicQuery dynamicQuery) {
193 return userNotificationEventPersistence.countWithDynamicQuery(dynamicQuery);
194 }
195
196
203 @Override
204 public long dynamicQueryCount(DynamicQuery dynamicQuery,
205 Projection projection) {
206 return userNotificationEventPersistence.countWithDynamicQuery(dynamicQuery,
207 projection);
208 }
209
210 @Override
211 public UserNotificationEvent fetchUserNotificationEvent(
212 long userNotificationEventId) {
213 return userNotificationEventPersistence.fetchByPrimaryKey(userNotificationEventId);
214 }
215
216
223 @Override
224 public UserNotificationEvent fetchUserNotificationEventByUuidAndCompanyId(
225 String uuid, long companyId) {
226 return userNotificationEventPersistence.fetchByUuid_C_First(uuid,
227 companyId, null);
228 }
229
230
237 @Override
238 public UserNotificationEvent getUserNotificationEvent(
239 long userNotificationEventId) throws PortalException {
240 return userNotificationEventPersistence.findByPrimaryKey(userNotificationEventId);
241 }
242
243 @Override
244 public ActionableDynamicQuery getActionableDynamicQuery() {
245 ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
246
247 actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.UserNotificationEventLocalServiceUtil.getService());
248 actionableDynamicQuery.setClass(UserNotificationEvent.class);
249 actionableDynamicQuery.setClassLoader(getClassLoader());
250
251 actionableDynamicQuery.setPrimaryKeyPropertyName(
252 "userNotificationEventId");
253
254 return actionableDynamicQuery;
255 }
256
257 protected void initActionableDynamicQuery(
258 ActionableDynamicQuery actionableDynamicQuery) {
259 actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.UserNotificationEventLocalServiceUtil.getService());
260 actionableDynamicQuery.setClass(UserNotificationEvent.class);
261 actionableDynamicQuery.setClassLoader(getClassLoader());
262
263 actionableDynamicQuery.setPrimaryKeyPropertyName(
264 "userNotificationEventId");
265 }
266
267
270 @Override
271 public PersistedModel deletePersistedModel(PersistedModel persistedModel)
272 throws PortalException {
273 return userNotificationEventLocalService.deleteUserNotificationEvent((UserNotificationEvent)persistedModel);
274 }
275
276 @Override
277 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
278 throws PortalException {
279 return userNotificationEventPersistence.findByPrimaryKey(primaryKeyObj);
280 }
281
282
290 @Override
291 public UserNotificationEvent getUserNotificationEventByUuidAndCompanyId(
292 String uuid, long companyId) throws PortalException {
293 return userNotificationEventPersistence.findByUuid_C_First(uuid,
294 companyId, null);
295 }
296
297
308 @Override
309 public List<UserNotificationEvent> getUserNotificationEvents(int start,
310 int end) {
311 return userNotificationEventPersistence.findAll(start, end);
312 }
313
314
319 @Override
320 public int getUserNotificationEventsCount() {
321 return userNotificationEventPersistence.countAll();
322 }
323
324
330 @Indexable(type = IndexableType.REINDEX)
331 @Override
332 public UserNotificationEvent updateUserNotificationEvent(
333 UserNotificationEvent userNotificationEvent) {
334 return userNotificationEventPersistence.update(userNotificationEvent);
335 }
336
337
342 public UserNotificationEventLocalService getUserNotificationEventLocalService() {
343 return userNotificationEventLocalService;
344 }
345
346
351 public void setUserNotificationEventLocalService(
352 UserNotificationEventLocalService userNotificationEventLocalService) {
353 this.userNotificationEventLocalService = userNotificationEventLocalService;
354 }
355
356
361 public UserNotificationEventPersistence getUserNotificationEventPersistence() {
362 return userNotificationEventPersistence;
363 }
364
365
370 public void setUserNotificationEventPersistence(
371 UserNotificationEventPersistence userNotificationEventPersistence) {
372 this.userNotificationEventPersistence = userNotificationEventPersistence;
373 }
374
375
380 public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
381 return counterLocalService;
382 }
383
384
389 public void setCounterLocalService(
390 com.liferay.counter.service.CounterLocalService counterLocalService) {
391 this.counterLocalService = counterLocalService;
392 }
393
394
399 public com.liferay.portal.service.UserLocalService getUserLocalService() {
400 return userLocalService;
401 }
402
403
408 public void setUserLocalService(
409 com.liferay.portal.service.UserLocalService userLocalService) {
410 this.userLocalService = userLocalService;
411 }
412
413
418 public com.liferay.portal.service.UserService getUserService() {
419 return userService;
420 }
421
422
427 public void setUserService(
428 com.liferay.portal.service.UserService userService) {
429 this.userService = userService;
430 }
431
432
437 public UserPersistence getUserPersistence() {
438 return userPersistence;
439 }
440
441
446 public void setUserPersistence(UserPersistence userPersistence) {
447 this.userPersistence = userPersistence;
448 }
449
450
455 public UserFinder getUserFinder() {
456 return userFinder;
457 }
458
459
464 public void setUserFinder(UserFinder userFinder) {
465 this.userFinder = userFinder;
466 }
467
468 public void afterPropertiesSet() {
469 persistedModelLocalServiceRegistry.register("com.liferay.portal.model.UserNotificationEvent",
470 userNotificationEventLocalService);
471 }
472
473 public void destroy() {
474 persistedModelLocalServiceRegistry.unregister(
475 "com.liferay.portal.model.UserNotificationEvent");
476 }
477
478
483 @Override
484 public String getBeanIdentifier() {
485 return _beanIdentifier;
486 }
487
488
493 @Override
494 public void setBeanIdentifier(String beanIdentifier) {
495 _beanIdentifier = beanIdentifier;
496 }
497
498 protected Class<?> getModelClass() {
499 return UserNotificationEvent.class;
500 }
501
502 protected String getModelClassName() {
503 return UserNotificationEvent.class.getName();
504 }
505
506
511 protected void runSQL(String sql) {
512 try {
513 DataSource dataSource = userNotificationEventPersistence.getDataSource();
514
515 DB db = DBFactoryUtil.getDB();
516
517 sql = db.buildSQL(sql);
518 sql = PortalUtil.transformSQL(sql);
519
520 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
521 sql, new int[0]);
522
523 sqlUpdate.update();
524 }
525 catch (Exception e) {
526 throw new SystemException(e);
527 }
528 }
529
530 @BeanReference(type = com.liferay.portal.service.UserNotificationEventLocalService.class)
531 protected UserNotificationEventLocalService userNotificationEventLocalService;
532 @BeanReference(type = UserNotificationEventPersistence.class)
533 protected UserNotificationEventPersistence userNotificationEventPersistence;
534 @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
535 protected com.liferay.counter.service.CounterLocalService counterLocalService;
536 @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
537 protected com.liferay.portal.service.UserLocalService userLocalService;
538 @BeanReference(type = com.liferay.portal.service.UserService.class)
539 protected com.liferay.portal.service.UserService userService;
540 @BeanReference(type = UserPersistence.class)
541 protected UserPersistence userPersistence;
542 @BeanReference(type = UserFinder.class)
543 protected UserFinder userFinder;
544 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
545 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
546 private String _beanIdentifier;
547 }