001
014
015 package com.liferay.portlet.announcements.service.persistence.impl;
016
017 import aQute.bnd.annotation.ProviderType;
018
019 import com.liferay.portal.kernel.bean.BeanReference;
020 import com.liferay.portal.kernel.dao.orm.EntityCache;
021 import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
022 import com.liferay.portal.kernel.dao.orm.FinderCache;
023 import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
024 import com.liferay.portal.kernel.dao.orm.FinderPath;
025 import com.liferay.portal.kernel.dao.orm.Query;
026 import com.liferay.portal.kernel.dao.orm.QueryPos;
027 import com.liferay.portal.kernel.dao.orm.QueryUtil;
028 import com.liferay.portal.kernel.dao.orm.Session;
029 import com.liferay.portal.kernel.log.Log;
030 import com.liferay.portal.kernel.log.LogFactoryUtil;
031 import com.liferay.portal.kernel.util.OrderByComparator;
032 import com.liferay.portal.kernel.util.SetUtil;
033 import com.liferay.portal.kernel.util.StringBundler;
034 import com.liferay.portal.kernel.util.StringPool;
035 import com.liferay.portal.kernel.util.Validator;
036 import com.liferay.portal.model.CacheModel;
037 import com.liferay.portal.service.persistence.CompanyProvider;
038 import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
039
040 import com.liferay.portlet.announcements.NoSuchDeliveryException;
041 import com.liferay.portlet.announcements.model.AnnouncementsDelivery;
042 import com.liferay.portlet.announcements.model.impl.AnnouncementsDeliveryImpl;
043 import com.liferay.portlet.announcements.model.impl.AnnouncementsDeliveryModelImpl;
044 import com.liferay.portlet.announcements.service.persistence.AnnouncementsDeliveryPersistence;
045
046 import java.io.Serializable;
047
048 import java.util.Collections;
049 import java.util.HashMap;
050 import java.util.HashSet;
051 import java.util.Iterator;
052 import java.util.List;
053 import java.util.Map;
054 import java.util.Set;
055
056
068 @ProviderType
069 public class AnnouncementsDeliveryPersistenceImpl extends BasePersistenceImpl<AnnouncementsDelivery>
070 implements AnnouncementsDeliveryPersistence {
071
076 public static final String FINDER_CLASS_NAME_ENTITY = AnnouncementsDeliveryImpl.class.getName();
077 public static final String FINDER_CLASS_NAME_LIST_WITH_PAGINATION = FINDER_CLASS_NAME_ENTITY +
078 ".List1";
079 public static final String FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION = FINDER_CLASS_NAME_ENTITY +
080 ".List2";
081 public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_ALL = new FinderPath(AnnouncementsDeliveryModelImpl.ENTITY_CACHE_ENABLED,
082 AnnouncementsDeliveryModelImpl.FINDER_CACHE_ENABLED,
083 AnnouncementsDeliveryImpl.class,
084 FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findAll", new String[0]);
085 public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL = new FinderPath(AnnouncementsDeliveryModelImpl.ENTITY_CACHE_ENABLED,
086 AnnouncementsDeliveryModelImpl.FINDER_CACHE_ENABLED,
087 AnnouncementsDeliveryImpl.class,
088 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findAll", new String[0]);
089 public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(AnnouncementsDeliveryModelImpl.ENTITY_CACHE_ENABLED,
090 AnnouncementsDeliveryModelImpl.FINDER_CACHE_ENABLED, Long.class,
091 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countAll", new String[0]);
092 public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_BY_USERID = new FinderPath(AnnouncementsDeliveryModelImpl.ENTITY_CACHE_ENABLED,
093 AnnouncementsDeliveryModelImpl.FINDER_CACHE_ENABLED,
094 AnnouncementsDeliveryImpl.class,
095 FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findByUserId",
096 new String[] {
097 Long.class.getName(),
098
099 Integer.class.getName(), Integer.class.getName(),
100 OrderByComparator.class.getName()
101 });
102 public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_USERID =
103 new FinderPath(AnnouncementsDeliveryModelImpl.ENTITY_CACHE_ENABLED,
104 AnnouncementsDeliveryModelImpl.FINDER_CACHE_ENABLED,
105 AnnouncementsDeliveryImpl.class,
106 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findByUserId",
107 new String[] { Long.class.getName() },
108 AnnouncementsDeliveryModelImpl.USERID_COLUMN_BITMASK);
109 public static final FinderPath FINDER_PATH_COUNT_BY_USERID = new FinderPath(AnnouncementsDeliveryModelImpl.ENTITY_CACHE_ENABLED,
110 AnnouncementsDeliveryModelImpl.FINDER_CACHE_ENABLED, Long.class,
111 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByUserId",
112 new String[] { Long.class.getName() });
113
114
120 @Override
121 public List<AnnouncementsDelivery> findByUserId(long userId) {
122 return findByUserId(userId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
123 }
124
125
137 @Override
138 public List<AnnouncementsDelivery> findByUserId(long userId, int start,
139 int end) {
140 return findByUserId(userId, start, end, null);
141 }
142
143
156 @Override
157 public List<AnnouncementsDelivery> findByUserId(long userId, int start,
158 int end, OrderByComparator<AnnouncementsDelivery> orderByComparator) {
159 return findByUserId(userId, start, end, orderByComparator, true);
160 }
161
162
176 @Override
177 public List<AnnouncementsDelivery> findByUserId(long userId, int start,
178 int end, OrderByComparator<AnnouncementsDelivery> orderByComparator,
179 boolean retrieveFromCache) {
180 boolean pagination = true;
181 FinderPath finderPath = null;
182 Object[] finderArgs = null;
183
184 if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
185 (orderByComparator == null)) {
186 pagination = false;
187 finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_USERID;
188 finderArgs = new Object[] { userId };
189 }
190 else {
191 finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_USERID;
192 finderArgs = new Object[] { userId, start, end, orderByComparator };
193 }
194
195 List<AnnouncementsDelivery> list = null;
196
197 if (retrieveFromCache) {
198 list = (List<AnnouncementsDelivery>)finderCache.getResult(finderPath,
199 finderArgs, this);
200
201 if ((list != null) && !list.isEmpty()) {
202 for (AnnouncementsDelivery announcementsDelivery : list) {
203 if ((userId != announcementsDelivery.getUserId())) {
204 list = null;
205
206 break;
207 }
208 }
209 }
210 }
211
212 if (list == null) {
213 StringBundler query = null;
214
215 if (orderByComparator != null) {
216 query = new StringBundler(3 +
217 (orderByComparator.getOrderByFields().length * 3));
218 }
219 else {
220 query = new StringBundler(3);
221 }
222
223 query.append(_SQL_SELECT_ANNOUNCEMENTSDELIVERY_WHERE);
224
225 query.append(_FINDER_COLUMN_USERID_USERID_2);
226
227 if (orderByComparator != null) {
228 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
229 orderByComparator);
230 }
231 else
232 if (pagination) {
233 query.append(AnnouncementsDeliveryModelImpl.ORDER_BY_JPQL);
234 }
235
236 String sql = query.toString();
237
238 Session session = null;
239
240 try {
241 session = openSession();
242
243 Query q = session.createQuery(sql);
244
245 QueryPos qPos = QueryPos.getInstance(q);
246
247 qPos.add(userId);
248
249 if (!pagination) {
250 list = (List<AnnouncementsDelivery>)QueryUtil.list(q,
251 getDialect(), start, end, false);
252
253 Collections.sort(list);
254
255 list = Collections.unmodifiableList(list);
256 }
257 else {
258 list = (List<AnnouncementsDelivery>)QueryUtil.list(q,
259 getDialect(), start, end);
260 }
261
262 cacheResult(list);
263
264 finderCache.putResult(finderPath, finderArgs, list);
265 }
266 catch (Exception e) {
267 finderCache.removeResult(finderPath, finderArgs);
268
269 throw processException(e);
270 }
271 finally {
272 closeSession(session);
273 }
274 }
275
276 return list;
277 }
278
279
287 @Override
288 public AnnouncementsDelivery findByUserId_First(long userId,
289 OrderByComparator<AnnouncementsDelivery> orderByComparator)
290 throws NoSuchDeliveryException {
291 AnnouncementsDelivery announcementsDelivery = fetchByUserId_First(userId,
292 orderByComparator);
293
294 if (announcementsDelivery != null) {
295 return announcementsDelivery;
296 }
297
298 StringBundler msg = new StringBundler(4);
299
300 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
301
302 msg.append("userId=");
303 msg.append(userId);
304
305 msg.append(StringPool.CLOSE_CURLY_BRACE);
306
307 throw new NoSuchDeliveryException(msg.toString());
308 }
309
310
317 @Override
318 public AnnouncementsDelivery fetchByUserId_First(long userId,
319 OrderByComparator<AnnouncementsDelivery> orderByComparator) {
320 List<AnnouncementsDelivery> list = findByUserId(userId, 0, 1,
321 orderByComparator);
322
323 if (!list.isEmpty()) {
324 return list.get(0);
325 }
326
327 return null;
328 }
329
330
338 @Override
339 public AnnouncementsDelivery findByUserId_Last(long userId,
340 OrderByComparator<AnnouncementsDelivery> orderByComparator)
341 throws NoSuchDeliveryException {
342 AnnouncementsDelivery announcementsDelivery = fetchByUserId_Last(userId,
343 orderByComparator);
344
345 if (announcementsDelivery != null) {
346 return announcementsDelivery;
347 }
348
349 StringBundler msg = new StringBundler(4);
350
351 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
352
353 msg.append("userId=");
354 msg.append(userId);
355
356 msg.append(StringPool.CLOSE_CURLY_BRACE);
357
358 throw new NoSuchDeliveryException(msg.toString());
359 }
360
361
368 @Override
369 public AnnouncementsDelivery fetchByUserId_Last(long userId,
370 OrderByComparator<AnnouncementsDelivery> orderByComparator) {
371 int count = countByUserId(userId);
372
373 if (count == 0) {
374 return null;
375 }
376
377 List<AnnouncementsDelivery> list = findByUserId(userId, count - 1,
378 count, orderByComparator);
379
380 if (!list.isEmpty()) {
381 return list.get(0);
382 }
383
384 return null;
385 }
386
387
396 @Override
397 public AnnouncementsDelivery[] findByUserId_PrevAndNext(long deliveryId,
398 long userId, OrderByComparator<AnnouncementsDelivery> orderByComparator)
399 throws NoSuchDeliveryException {
400 AnnouncementsDelivery announcementsDelivery = findByPrimaryKey(deliveryId);
401
402 Session session = null;
403
404 try {
405 session = openSession();
406
407 AnnouncementsDelivery[] array = new AnnouncementsDeliveryImpl[3];
408
409 array[0] = getByUserId_PrevAndNext(session, announcementsDelivery,
410 userId, orderByComparator, true);
411
412 array[1] = announcementsDelivery;
413
414 array[2] = getByUserId_PrevAndNext(session, announcementsDelivery,
415 userId, orderByComparator, false);
416
417 return array;
418 }
419 catch (Exception e) {
420 throw processException(e);
421 }
422 finally {
423 closeSession(session);
424 }
425 }
426
427 protected AnnouncementsDelivery getByUserId_PrevAndNext(Session session,
428 AnnouncementsDelivery announcementsDelivery, long userId,
429 OrderByComparator<AnnouncementsDelivery> orderByComparator,
430 boolean previous) {
431 StringBundler query = null;
432
433 if (orderByComparator != null) {
434 query = new StringBundler(6 +
435 (orderByComparator.getOrderByFields().length * 6));
436 }
437 else {
438 query = new StringBundler(3);
439 }
440
441 query.append(_SQL_SELECT_ANNOUNCEMENTSDELIVERY_WHERE);
442
443 query.append(_FINDER_COLUMN_USERID_USERID_2);
444
445 if (orderByComparator != null) {
446 String[] orderByConditionFields = orderByComparator.getOrderByConditionFields();
447
448 if (orderByConditionFields.length > 0) {
449 query.append(WHERE_AND);
450 }
451
452 for (int i = 0; i < orderByConditionFields.length; i++) {
453 query.append(_ORDER_BY_ENTITY_ALIAS);
454 query.append(orderByConditionFields[i]);
455
456 if ((i + 1) < orderByConditionFields.length) {
457 if (orderByComparator.isAscending() ^ previous) {
458 query.append(WHERE_GREATER_THAN_HAS_NEXT);
459 }
460 else {
461 query.append(WHERE_LESSER_THAN_HAS_NEXT);
462 }
463 }
464 else {
465 if (orderByComparator.isAscending() ^ previous) {
466 query.append(WHERE_GREATER_THAN);
467 }
468 else {
469 query.append(WHERE_LESSER_THAN);
470 }
471 }
472 }
473
474 query.append(ORDER_BY_CLAUSE);
475
476 String[] orderByFields = orderByComparator.getOrderByFields();
477
478 for (int i = 0; i < orderByFields.length; i++) {
479 query.append(_ORDER_BY_ENTITY_ALIAS);
480 query.append(orderByFields[i]);
481
482 if ((i + 1) < orderByFields.length) {
483 if (orderByComparator.isAscending() ^ previous) {
484 query.append(ORDER_BY_ASC_HAS_NEXT);
485 }
486 else {
487 query.append(ORDER_BY_DESC_HAS_NEXT);
488 }
489 }
490 else {
491 if (orderByComparator.isAscending() ^ previous) {
492 query.append(ORDER_BY_ASC);
493 }
494 else {
495 query.append(ORDER_BY_DESC);
496 }
497 }
498 }
499 }
500 else {
501 query.append(AnnouncementsDeliveryModelImpl.ORDER_BY_JPQL);
502 }
503
504 String sql = query.toString();
505
506 Query q = session.createQuery(sql);
507
508 q.setFirstResult(0);
509 q.setMaxResults(2);
510
511 QueryPos qPos = QueryPos.getInstance(q);
512
513 qPos.add(userId);
514
515 if (orderByComparator != null) {
516 Object[] values = orderByComparator.getOrderByConditionValues(announcementsDelivery);
517
518 for (Object value : values) {
519 qPos.add(value);
520 }
521 }
522
523 List<AnnouncementsDelivery> list = q.list();
524
525 if (list.size() == 2) {
526 return list.get(1);
527 }
528 else {
529 return null;
530 }
531 }
532
533
538 @Override
539 public void removeByUserId(long userId) {
540 for (AnnouncementsDelivery announcementsDelivery : findByUserId(
541 userId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
542 remove(announcementsDelivery);
543 }
544 }
545
546
552 @Override
553 public int countByUserId(long userId) {
554 FinderPath finderPath = FINDER_PATH_COUNT_BY_USERID;
555
556 Object[] finderArgs = new Object[] { userId };
557
558 Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);
559
560 if (count == null) {
561 StringBundler query = new StringBundler(2);
562
563 query.append(_SQL_COUNT_ANNOUNCEMENTSDELIVERY_WHERE);
564
565 query.append(_FINDER_COLUMN_USERID_USERID_2);
566
567 String sql = query.toString();
568
569 Session session = null;
570
571 try {
572 session = openSession();
573
574 Query q = session.createQuery(sql);
575
576 QueryPos qPos = QueryPos.getInstance(q);
577
578 qPos.add(userId);
579
580 count = (Long)q.uniqueResult();
581
582 finderCache.putResult(finderPath, finderArgs, count);
583 }
584 catch (Exception e) {
585 finderCache.removeResult(finderPath, finderArgs);
586
587 throw processException(e);
588 }
589 finally {
590 closeSession(session);
591 }
592 }
593
594 return count.intValue();
595 }
596
597 private static final String _FINDER_COLUMN_USERID_USERID_2 = "announcementsDelivery.userId = ?";
598 public static final FinderPath FINDER_PATH_FETCH_BY_U_T = new FinderPath(AnnouncementsDeliveryModelImpl.ENTITY_CACHE_ENABLED,
599 AnnouncementsDeliveryModelImpl.FINDER_CACHE_ENABLED,
600 AnnouncementsDeliveryImpl.class, FINDER_CLASS_NAME_ENTITY,
601 "fetchByU_T",
602 new String[] { Long.class.getName(), String.class.getName() },
603 AnnouncementsDeliveryModelImpl.USERID_COLUMN_BITMASK |
604 AnnouncementsDeliveryModelImpl.TYPE_COLUMN_BITMASK);
605 public static final FinderPath FINDER_PATH_COUNT_BY_U_T = new FinderPath(AnnouncementsDeliveryModelImpl.ENTITY_CACHE_ENABLED,
606 AnnouncementsDeliveryModelImpl.FINDER_CACHE_ENABLED, Long.class,
607 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByU_T",
608 new String[] { Long.class.getName(), String.class.getName() });
609
610
618 @Override
619 public AnnouncementsDelivery findByU_T(long userId, String type)
620 throws NoSuchDeliveryException {
621 AnnouncementsDelivery announcementsDelivery = fetchByU_T(userId, type);
622
623 if (announcementsDelivery == null) {
624 StringBundler msg = new StringBundler(6);
625
626 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
627
628 msg.append("userId=");
629 msg.append(userId);
630
631 msg.append(", type=");
632 msg.append(type);
633
634 msg.append(StringPool.CLOSE_CURLY_BRACE);
635
636 if (_log.isWarnEnabled()) {
637 _log.warn(msg.toString());
638 }
639
640 throw new NoSuchDeliveryException(msg.toString());
641 }
642
643 return announcementsDelivery;
644 }
645
646
653 @Override
654 public AnnouncementsDelivery fetchByU_T(long userId, String type) {
655 return fetchByU_T(userId, type, true);
656 }
657
658
666 @Override
667 public AnnouncementsDelivery fetchByU_T(long userId, String type,
668 boolean retrieveFromCache) {
669 Object[] finderArgs = new Object[] { userId, type };
670
671 Object result = null;
672
673 if (retrieveFromCache) {
674 result = finderCache.getResult(FINDER_PATH_FETCH_BY_U_T,
675 finderArgs, this);
676 }
677
678 if (result instanceof AnnouncementsDelivery) {
679 AnnouncementsDelivery announcementsDelivery = (AnnouncementsDelivery)result;
680
681 if ((userId != announcementsDelivery.getUserId()) ||
682 !Validator.equals(type, announcementsDelivery.getType())) {
683 result = null;
684 }
685 }
686
687 if (result == null) {
688 StringBundler query = new StringBundler(4);
689
690 query.append(_SQL_SELECT_ANNOUNCEMENTSDELIVERY_WHERE);
691
692 query.append(_FINDER_COLUMN_U_T_USERID_2);
693
694 boolean bindType = false;
695
696 if (type == null) {
697 query.append(_FINDER_COLUMN_U_T_TYPE_1);
698 }
699 else if (type.equals(StringPool.BLANK)) {
700 query.append(_FINDER_COLUMN_U_T_TYPE_3);
701 }
702 else {
703 bindType = true;
704
705 query.append(_FINDER_COLUMN_U_T_TYPE_2);
706 }
707
708 String sql = query.toString();
709
710 Session session = null;
711
712 try {
713 session = openSession();
714
715 Query q = session.createQuery(sql);
716
717 QueryPos qPos = QueryPos.getInstance(q);
718
719 qPos.add(userId);
720
721 if (bindType) {
722 qPos.add(type);
723 }
724
725 List<AnnouncementsDelivery> list = q.list();
726
727 if (list.isEmpty()) {
728 finderCache.putResult(FINDER_PATH_FETCH_BY_U_T, finderArgs,
729 list);
730 }
731 else {
732 AnnouncementsDelivery announcementsDelivery = list.get(0);
733
734 result = announcementsDelivery;
735
736 cacheResult(announcementsDelivery);
737
738 if ((announcementsDelivery.getUserId() != userId) ||
739 (announcementsDelivery.getType() == null) ||
740 !announcementsDelivery.getType().equals(type)) {
741 finderCache.putResult(FINDER_PATH_FETCH_BY_U_T,
742 finderArgs, announcementsDelivery);
743 }
744 }
745 }
746 catch (Exception e) {
747 finderCache.removeResult(FINDER_PATH_FETCH_BY_U_T, finderArgs);
748
749 throw processException(e);
750 }
751 finally {
752 closeSession(session);
753 }
754 }
755
756 if (result instanceof List<?>) {
757 return null;
758 }
759 else {
760 return (AnnouncementsDelivery)result;
761 }
762 }
763
764
771 @Override
772 public AnnouncementsDelivery removeByU_T(long userId, String type)
773 throws NoSuchDeliveryException {
774 AnnouncementsDelivery announcementsDelivery = findByU_T(userId, type);
775
776 return remove(announcementsDelivery);
777 }
778
779
786 @Override
787 public int countByU_T(long userId, String type) {
788 FinderPath finderPath = FINDER_PATH_COUNT_BY_U_T;
789
790 Object[] finderArgs = new Object[] { userId, type };
791
792 Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);
793
794 if (count == null) {
795 StringBundler query = new StringBundler(3);
796
797 query.append(_SQL_COUNT_ANNOUNCEMENTSDELIVERY_WHERE);
798
799 query.append(_FINDER_COLUMN_U_T_USERID_2);
800
801 boolean bindType = false;
802
803 if (type == null) {
804 query.append(_FINDER_COLUMN_U_T_TYPE_1);
805 }
806 else if (type.equals(StringPool.BLANK)) {
807 query.append(_FINDER_COLUMN_U_T_TYPE_3);
808 }
809 else {
810 bindType = true;
811
812 query.append(_FINDER_COLUMN_U_T_TYPE_2);
813 }
814
815 String sql = query.toString();
816
817 Session session = null;
818
819 try {
820 session = openSession();
821
822 Query q = session.createQuery(sql);
823
824 QueryPos qPos = QueryPos.getInstance(q);
825
826 qPos.add(userId);
827
828 if (bindType) {
829 qPos.add(type);
830 }
831
832 count = (Long)q.uniqueResult();
833
834 finderCache.putResult(finderPath, finderArgs, count);
835 }
836 catch (Exception e) {
837 finderCache.removeResult(finderPath, finderArgs);
838
839 throw processException(e);
840 }
841 finally {
842 closeSession(session);
843 }
844 }
845
846 return count.intValue();
847 }
848
849 private static final String _FINDER_COLUMN_U_T_USERID_2 = "announcementsDelivery.userId = ? AND ";
850 private static final String _FINDER_COLUMN_U_T_TYPE_1 = "announcementsDelivery.type IS NULL";
851 private static final String _FINDER_COLUMN_U_T_TYPE_2 = "announcementsDelivery.type = ?";
852 private static final String _FINDER_COLUMN_U_T_TYPE_3 = "(announcementsDelivery.type IS NULL OR announcementsDelivery.type = '')";
853
854 public AnnouncementsDeliveryPersistenceImpl() {
855 setModelClass(AnnouncementsDelivery.class);
856 }
857
858
863 @Override
864 public void cacheResult(AnnouncementsDelivery announcementsDelivery) {
865 entityCache.putResult(AnnouncementsDeliveryModelImpl.ENTITY_CACHE_ENABLED,
866 AnnouncementsDeliveryImpl.class,
867 announcementsDelivery.getPrimaryKey(), announcementsDelivery);
868
869 finderCache.putResult(FINDER_PATH_FETCH_BY_U_T,
870 new Object[] {
871 announcementsDelivery.getUserId(),
872 announcementsDelivery.getType()
873 }, announcementsDelivery);
874
875 announcementsDelivery.resetOriginalValues();
876 }
877
878
883 @Override
884 public void cacheResult(List<AnnouncementsDelivery> announcementsDeliveries) {
885 for (AnnouncementsDelivery announcementsDelivery : announcementsDeliveries) {
886 if (entityCache.getResult(
887 AnnouncementsDeliveryModelImpl.ENTITY_CACHE_ENABLED,
888 AnnouncementsDeliveryImpl.class,
889 announcementsDelivery.getPrimaryKey()) == null) {
890 cacheResult(announcementsDelivery);
891 }
892 else {
893 announcementsDelivery.resetOriginalValues();
894 }
895 }
896 }
897
898
905 @Override
906 public void clearCache() {
907 entityCache.clearCache(AnnouncementsDeliveryImpl.class);
908
909 finderCache.clearCache(FINDER_CLASS_NAME_ENTITY);
910 finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
911 finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
912 }
913
914
921 @Override
922 public void clearCache(AnnouncementsDelivery announcementsDelivery) {
923 entityCache.removeResult(AnnouncementsDeliveryModelImpl.ENTITY_CACHE_ENABLED,
924 AnnouncementsDeliveryImpl.class,
925 announcementsDelivery.getPrimaryKey());
926
927 finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
928 finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
929
930 clearUniqueFindersCache((AnnouncementsDeliveryModelImpl)announcementsDelivery);
931 }
932
933 @Override
934 public void clearCache(List<AnnouncementsDelivery> announcementsDeliveries) {
935 finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
936 finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
937
938 for (AnnouncementsDelivery announcementsDelivery : announcementsDeliveries) {
939 entityCache.removeResult(AnnouncementsDeliveryModelImpl.ENTITY_CACHE_ENABLED,
940 AnnouncementsDeliveryImpl.class,
941 announcementsDelivery.getPrimaryKey());
942
943 clearUniqueFindersCache((AnnouncementsDeliveryModelImpl)announcementsDelivery);
944 }
945 }
946
947 protected void cacheUniqueFindersCache(
948 AnnouncementsDeliveryModelImpl announcementsDeliveryModelImpl,
949 boolean isNew) {
950 if (isNew) {
951 Object[] args = new Object[] {
952 announcementsDeliveryModelImpl.getUserId(),
953 announcementsDeliveryModelImpl.getType()
954 };
955
956 finderCache.putResult(FINDER_PATH_COUNT_BY_U_T, args,
957 Long.valueOf(1));
958 finderCache.putResult(FINDER_PATH_FETCH_BY_U_T, args,
959 announcementsDeliveryModelImpl);
960 }
961 else {
962 if ((announcementsDeliveryModelImpl.getColumnBitmask() &
963 FINDER_PATH_FETCH_BY_U_T.getColumnBitmask()) != 0) {
964 Object[] args = new Object[] {
965 announcementsDeliveryModelImpl.getUserId(),
966 announcementsDeliveryModelImpl.getType()
967 };
968
969 finderCache.putResult(FINDER_PATH_COUNT_BY_U_T, args,
970 Long.valueOf(1));
971 finderCache.putResult(FINDER_PATH_FETCH_BY_U_T, args,
972 announcementsDeliveryModelImpl);
973 }
974 }
975 }
976
977 protected void clearUniqueFindersCache(
978 AnnouncementsDeliveryModelImpl announcementsDeliveryModelImpl) {
979 Object[] args = new Object[] {
980 announcementsDeliveryModelImpl.getUserId(),
981 announcementsDeliveryModelImpl.getType()
982 };
983
984 finderCache.removeResult(FINDER_PATH_COUNT_BY_U_T, args);
985 finderCache.removeResult(FINDER_PATH_FETCH_BY_U_T, args);
986
987 if ((announcementsDeliveryModelImpl.getColumnBitmask() &
988 FINDER_PATH_FETCH_BY_U_T.getColumnBitmask()) != 0) {
989 args = new Object[] {
990 announcementsDeliveryModelImpl.getOriginalUserId(),
991 announcementsDeliveryModelImpl.getOriginalType()
992 };
993
994 finderCache.removeResult(FINDER_PATH_COUNT_BY_U_T, args);
995 finderCache.removeResult(FINDER_PATH_FETCH_BY_U_T, args);
996 }
997 }
998
999
1005 @Override
1006 public AnnouncementsDelivery create(long deliveryId) {
1007 AnnouncementsDelivery announcementsDelivery = new AnnouncementsDeliveryImpl();
1008
1009 announcementsDelivery.setNew(true);
1010 announcementsDelivery.setPrimaryKey(deliveryId);
1011
1012 return announcementsDelivery;
1013 }
1014
1015
1022 @Override
1023 public AnnouncementsDelivery remove(long deliveryId)
1024 throws NoSuchDeliveryException {
1025 return remove((Serializable)deliveryId);
1026 }
1027
1028
1035 @Override
1036 public AnnouncementsDelivery remove(Serializable primaryKey)
1037 throws NoSuchDeliveryException {
1038 Session session = null;
1039
1040 try {
1041 session = openSession();
1042
1043 AnnouncementsDelivery announcementsDelivery = (AnnouncementsDelivery)session.get(AnnouncementsDeliveryImpl.class,
1044 primaryKey);
1045
1046 if (announcementsDelivery == null) {
1047 if (_log.isWarnEnabled()) {
1048 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
1049 }
1050
1051 throw new NoSuchDeliveryException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
1052 primaryKey);
1053 }
1054
1055 return remove(announcementsDelivery);
1056 }
1057 catch (NoSuchDeliveryException nsee) {
1058 throw nsee;
1059 }
1060 catch (Exception e) {
1061 throw processException(e);
1062 }
1063 finally {
1064 closeSession(session);
1065 }
1066 }
1067
1068 @Override
1069 protected AnnouncementsDelivery removeImpl(
1070 AnnouncementsDelivery announcementsDelivery) {
1071 announcementsDelivery = toUnwrappedModel(announcementsDelivery);
1072
1073 Session session = null;
1074
1075 try {
1076 session = openSession();
1077
1078 if (!session.contains(announcementsDelivery)) {
1079 announcementsDelivery = (AnnouncementsDelivery)session.get(AnnouncementsDeliveryImpl.class,
1080 announcementsDelivery.getPrimaryKeyObj());
1081 }
1082
1083 if (announcementsDelivery != null) {
1084 session.delete(announcementsDelivery);
1085 }
1086 }
1087 catch (Exception e) {
1088 throw processException(e);
1089 }
1090 finally {
1091 closeSession(session);
1092 }
1093
1094 if (announcementsDelivery != null) {
1095 clearCache(announcementsDelivery);
1096 }
1097
1098 return announcementsDelivery;
1099 }
1100
1101 @Override
1102 public AnnouncementsDelivery updateImpl(
1103 AnnouncementsDelivery announcementsDelivery) {
1104 announcementsDelivery = toUnwrappedModel(announcementsDelivery);
1105
1106 boolean isNew = announcementsDelivery.isNew();
1107
1108 AnnouncementsDeliveryModelImpl announcementsDeliveryModelImpl = (AnnouncementsDeliveryModelImpl)announcementsDelivery;
1109
1110 Session session = null;
1111
1112 try {
1113 session = openSession();
1114
1115 if (announcementsDelivery.isNew()) {
1116 session.save(announcementsDelivery);
1117
1118 announcementsDelivery.setNew(false);
1119 }
1120 else {
1121 announcementsDelivery = (AnnouncementsDelivery)session.merge(announcementsDelivery);
1122 }
1123 }
1124 catch (Exception e) {
1125 throw processException(e);
1126 }
1127 finally {
1128 closeSession(session);
1129 }
1130
1131 finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
1132
1133 if (isNew || !AnnouncementsDeliveryModelImpl.COLUMN_BITMASK_ENABLED) {
1134 finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
1135 }
1136
1137 else {
1138 if ((announcementsDeliveryModelImpl.getColumnBitmask() &
1139 FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_USERID.getColumnBitmask()) != 0) {
1140 Object[] args = new Object[] {
1141 announcementsDeliveryModelImpl.getOriginalUserId()
1142 };
1143
1144 finderCache.removeResult(FINDER_PATH_COUNT_BY_USERID, args);
1145 finderCache.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_USERID,
1146 args);
1147
1148 args = new Object[] { announcementsDeliveryModelImpl.getUserId() };
1149
1150 finderCache.removeResult(FINDER_PATH_COUNT_BY_USERID, args);
1151 finderCache.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_USERID,
1152 args);
1153 }
1154 }
1155
1156 entityCache.putResult(AnnouncementsDeliveryModelImpl.ENTITY_CACHE_ENABLED,
1157 AnnouncementsDeliveryImpl.class,
1158 announcementsDelivery.getPrimaryKey(), announcementsDelivery, false);
1159
1160 clearUniqueFindersCache(announcementsDeliveryModelImpl);
1161 cacheUniqueFindersCache(announcementsDeliveryModelImpl, isNew);
1162
1163 announcementsDelivery.resetOriginalValues();
1164
1165 return announcementsDelivery;
1166 }
1167
1168 protected AnnouncementsDelivery toUnwrappedModel(
1169 AnnouncementsDelivery announcementsDelivery) {
1170 if (announcementsDelivery instanceof AnnouncementsDeliveryImpl) {
1171 return announcementsDelivery;
1172 }
1173
1174 AnnouncementsDeliveryImpl announcementsDeliveryImpl = new AnnouncementsDeliveryImpl();
1175
1176 announcementsDeliveryImpl.setNew(announcementsDelivery.isNew());
1177 announcementsDeliveryImpl.setPrimaryKey(announcementsDelivery.getPrimaryKey());
1178
1179 announcementsDeliveryImpl.setDeliveryId(announcementsDelivery.getDeliveryId());
1180 announcementsDeliveryImpl.setCompanyId(announcementsDelivery.getCompanyId());
1181 announcementsDeliveryImpl.setUserId(announcementsDelivery.getUserId());
1182 announcementsDeliveryImpl.setType(announcementsDelivery.getType());
1183 announcementsDeliveryImpl.setEmail(announcementsDelivery.isEmail());
1184 announcementsDeliveryImpl.setSms(announcementsDelivery.isSms());
1185 announcementsDeliveryImpl.setWebsite(announcementsDelivery.isWebsite());
1186
1187 return announcementsDeliveryImpl;
1188 }
1189
1190
1197 @Override
1198 public AnnouncementsDelivery findByPrimaryKey(Serializable primaryKey)
1199 throws NoSuchDeliveryException {
1200 AnnouncementsDelivery announcementsDelivery = fetchByPrimaryKey(primaryKey);
1201
1202 if (announcementsDelivery == null) {
1203 if (_log.isWarnEnabled()) {
1204 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
1205 }
1206
1207 throw new NoSuchDeliveryException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
1208 primaryKey);
1209 }
1210
1211 return announcementsDelivery;
1212 }
1213
1214
1221 @Override
1222 public AnnouncementsDelivery findByPrimaryKey(long deliveryId)
1223 throws NoSuchDeliveryException {
1224 return findByPrimaryKey((Serializable)deliveryId);
1225 }
1226
1227
1233 @Override
1234 public AnnouncementsDelivery fetchByPrimaryKey(Serializable primaryKey) {
1235 AnnouncementsDelivery announcementsDelivery = (AnnouncementsDelivery)entityCache.getResult(AnnouncementsDeliveryModelImpl.ENTITY_CACHE_ENABLED,
1236 AnnouncementsDeliveryImpl.class, primaryKey);
1237
1238 if (announcementsDelivery == _nullAnnouncementsDelivery) {
1239 return null;
1240 }
1241
1242 if (announcementsDelivery == null) {
1243 Session session = null;
1244
1245 try {
1246 session = openSession();
1247
1248 announcementsDelivery = (AnnouncementsDelivery)session.get(AnnouncementsDeliveryImpl.class,
1249 primaryKey);
1250
1251 if (announcementsDelivery != null) {
1252 cacheResult(announcementsDelivery);
1253 }
1254 else {
1255 entityCache.putResult(AnnouncementsDeliveryModelImpl.ENTITY_CACHE_ENABLED,
1256 AnnouncementsDeliveryImpl.class, primaryKey,
1257 _nullAnnouncementsDelivery);
1258 }
1259 }
1260 catch (Exception e) {
1261 entityCache.removeResult(AnnouncementsDeliveryModelImpl.ENTITY_CACHE_ENABLED,
1262 AnnouncementsDeliveryImpl.class, primaryKey);
1263
1264 throw processException(e);
1265 }
1266 finally {
1267 closeSession(session);
1268 }
1269 }
1270
1271 return announcementsDelivery;
1272 }
1273
1274
1280 @Override
1281 public AnnouncementsDelivery fetchByPrimaryKey(long deliveryId) {
1282 return fetchByPrimaryKey((Serializable)deliveryId);
1283 }
1284
1285 @Override
1286 public Map<Serializable, AnnouncementsDelivery> fetchByPrimaryKeys(
1287 Set<Serializable> primaryKeys) {
1288 if (primaryKeys.isEmpty()) {
1289 return Collections.emptyMap();
1290 }
1291
1292 Map<Serializable, AnnouncementsDelivery> map = new HashMap<Serializable, AnnouncementsDelivery>();
1293
1294 if (primaryKeys.size() == 1) {
1295 Iterator<Serializable> iterator = primaryKeys.iterator();
1296
1297 Serializable primaryKey = iterator.next();
1298
1299 AnnouncementsDelivery announcementsDelivery = fetchByPrimaryKey(primaryKey);
1300
1301 if (announcementsDelivery != null) {
1302 map.put(primaryKey, announcementsDelivery);
1303 }
1304
1305 return map;
1306 }
1307
1308 Set<Serializable> uncachedPrimaryKeys = null;
1309
1310 for (Serializable primaryKey : primaryKeys) {
1311 AnnouncementsDelivery announcementsDelivery = (AnnouncementsDelivery)entityCache.getResult(AnnouncementsDeliveryModelImpl.ENTITY_CACHE_ENABLED,
1312 AnnouncementsDeliveryImpl.class, primaryKey);
1313
1314 if (announcementsDelivery == null) {
1315 if (uncachedPrimaryKeys == null) {
1316 uncachedPrimaryKeys = new HashSet<Serializable>();
1317 }
1318
1319 uncachedPrimaryKeys.add(primaryKey);
1320 }
1321 else {
1322 map.put(primaryKey, announcementsDelivery);
1323 }
1324 }
1325
1326 if (uncachedPrimaryKeys == null) {
1327 return map;
1328 }
1329
1330 StringBundler query = new StringBundler((uncachedPrimaryKeys.size() * 2) +
1331 1);
1332
1333 query.append(_SQL_SELECT_ANNOUNCEMENTSDELIVERY_WHERE_PKS_IN);
1334
1335 for (Serializable primaryKey : uncachedPrimaryKeys) {
1336 query.append(String.valueOf(primaryKey));
1337
1338 query.append(StringPool.COMMA);
1339 }
1340
1341 query.setIndex(query.index() - 1);
1342
1343 query.append(StringPool.CLOSE_PARENTHESIS);
1344
1345 String sql = query.toString();
1346
1347 Session session = null;
1348
1349 try {
1350 session = openSession();
1351
1352 Query q = session.createQuery(sql);
1353
1354 for (AnnouncementsDelivery announcementsDelivery : (List<AnnouncementsDelivery>)q.list()) {
1355 map.put(announcementsDelivery.getPrimaryKeyObj(),
1356 announcementsDelivery);
1357
1358 cacheResult(announcementsDelivery);
1359
1360 uncachedPrimaryKeys.remove(announcementsDelivery.getPrimaryKeyObj());
1361 }
1362
1363 for (Serializable primaryKey : uncachedPrimaryKeys) {
1364 entityCache.putResult(AnnouncementsDeliveryModelImpl.ENTITY_CACHE_ENABLED,
1365 AnnouncementsDeliveryImpl.class, primaryKey,
1366 _nullAnnouncementsDelivery);
1367 }
1368 }
1369 catch (Exception e) {
1370 throw processException(e);
1371 }
1372 finally {
1373 closeSession(session);
1374 }
1375
1376 return map;
1377 }
1378
1379
1384 @Override
1385 public List<AnnouncementsDelivery> findAll() {
1386 return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
1387 }
1388
1389
1400 @Override
1401 public List<AnnouncementsDelivery> findAll(int start, int end) {
1402 return findAll(start, end, null);
1403 }
1404
1405
1417 @Override
1418 public List<AnnouncementsDelivery> findAll(int start, int end,
1419 OrderByComparator<AnnouncementsDelivery> orderByComparator) {
1420 return findAll(start, end, orderByComparator, true);
1421 }
1422
1423
1436 @Override
1437 public List<AnnouncementsDelivery> findAll(int start, int end,
1438 OrderByComparator<AnnouncementsDelivery> orderByComparator,
1439 boolean retrieveFromCache) {
1440 boolean pagination = true;
1441 FinderPath finderPath = null;
1442 Object[] finderArgs = null;
1443
1444 if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
1445 (orderByComparator == null)) {
1446 pagination = false;
1447 finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL;
1448 finderArgs = FINDER_ARGS_EMPTY;
1449 }
1450 else {
1451 finderPath = FINDER_PATH_WITH_PAGINATION_FIND_ALL;
1452 finderArgs = new Object[] { start, end, orderByComparator };
1453 }
1454
1455 List<AnnouncementsDelivery> list = null;
1456
1457 if (retrieveFromCache) {
1458 list = (List<AnnouncementsDelivery>)finderCache.getResult(finderPath,
1459 finderArgs, this);
1460 }
1461
1462 if (list == null) {
1463 StringBundler query = null;
1464 String sql = null;
1465
1466 if (orderByComparator != null) {
1467 query = new StringBundler(2 +
1468 (orderByComparator.getOrderByFields().length * 3));
1469
1470 query.append(_SQL_SELECT_ANNOUNCEMENTSDELIVERY);
1471
1472 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
1473 orderByComparator);
1474
1475 sql = query.toString();
1476 }
1477 else {
1478 sql = _SQL_SELECT_ANNOUNCEMENTSDELIVERY;
1479
1480 if (pagination) {
1481 sql = sql.concat(AnnouncementsDeliveryModelImpl.ORDER_BY_JPQL);
1482 }
1483 }
1484
1485 Session session = null;
1486
1487 try {
1488 session = openSession();
1489
1490 Query q = session.createQuery(sql);
1491
1492 if (!pagination) {
1493 list = (List<AnnouncementsDelivery>)QueryUtil.list(q,
1494 getDialect(), start, end, false);
1495
1496 Collections.sort(list);
1497
1498 list = Collections.unmodifiableList(list);
1499 }
1500 else {
1501 list = (List<AnnouncementsDelivery>)QueryUtil.list(q,
1502 getDialect(), start, end);
1503 }
1504
1505 cacheResult(list);
1506
1507 finderCache.putResult(finderPath, finderArgs, list);
1508 }
1509 catch (Exception e) {
1510 finderCache.removeResult(finderPath, finderArgs);
1511
1512 throw processException(e);
1513 }
1514 finally {
1515 closeSession(session);
1516 }
1517 }
1518
1519 return list;
1520 }
1521
1522
1526 @Override
1527 public void removeAll() {
1528 for (AnnouncementsDelivery announcementsDelivery : findAll()) {
1529 remove(announcementsDelivery);
1530 }
1531 }
1532
1533
1538 @Override
1539 public int countAll() {
1540 Long count = (Long)finderCache.getResult(FINDER_PATH_COUNT_ALL,
1541 FINDER_ARGS_EMPTY, this);
1542
1543 if (count == null) {
1544 Session session = null;
1545
1546 try {
1547 session = openSession();
1548
1549 Query q = session.createQuery(_SQL_COUNT_ANNOUNCEMENTSDELIVERY);
1550
1551 count = (Long)q.uniqueResult();
1552
1553 finderCache.putResult(FINDER_PATH_COUNT_ALL, FINDER_ARGS_EMPTY,
1554 count);
1555 }
1556 catch (Exception e) {
1557 finderCache.removeResult(FINDER_PATH_COUNT_ALL,
1558 FINDER_ARGS_EMPTY);
1559
1560 throw processException(e);
1561 }
1562 finally {
1563 closeSession(session);
1564 }
1565 }
1566
1567 return count.intValue();
1568 }
1569
1570 @Override
1571 public Set<String> getBadColumnNames() {
1572 return _badColumnNames;
1573 }
1574
1575 @Override
1576 protected Map<String, Integer> getTableColumnsMap() {
1577 return AnnouncementsDeliveryModelImpl.TABLE_COLUMNS_MAP;
1578 }
1579
1580
1583 public void afterPropertiesSet() {
1584 }
1585
1586 public void destroy() {
1587 entityCache.removeCache(AnnouncementsDeliveryImpl.class.getName());
1588 finderCache.removeCache(FINDER_CLASS_NAME_ENTITY);
1589 finderCache.removeCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
1590 finderCache.removeCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
1591 }
1592
1593 @BeanReference(type = CompanyProvider.class)
1594 protected CompanyProvider companyProvider;
1595 protected EntityCache entityCache = EntityCacheUtil.getEntityCache();
1596 protected FinderCache finderCache = FinderCacheUtil.getFinderCache();
1597 private static final String _SQL_SELECT_ANNOUNCEMENTSDELIVERY = "SELECT announcementsDelivery FROM AnnouncementsDelivery announcementsDelivery";
1598 private static final String _SQL_SELECT_ANNOUNCEMENTSDELIVERY_WHERE_PKS_IN = "SELECT announcementsDelivery FROM AnnouncementsDelivery announcementsDelivery WHERE deliveryId IN (";
1599 private static final String _SQL_SELECT_ANNOUNCEMENTSDELIVERY_WHERE = "SELECT announcementsDelivery FROM AnnouncementsDelivery announcementsDelivery WHERE ";
1600 private static final String _SQL_COUNT_ANNOUNCEMENTSDELIVERY = "SELECT COUNT(announcementsDelivery) FROM AnnouncementsDelivery announcementsDelivery";
1601 private static final String _SQL_COUNT_ANNOUNCEMENTSDELIVERY_WHERE = "SELECT COUNT(announcementsDelivery) FROM AnnouncementsDelivery announcementsDelivery WHERE ";
1602 private static final String _ORDER_BY_ENTITY_ALIAS = "announcementsDelivery.";
1603 private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No AnnouncementsDelivery exists with the primary key ";
1604 private static final String _NO_SUCH_ENTITY_WITH_KEY = "No AnnouncementsDelivery exists with the key {";
1605 private static final Log _log = LogFactoryUtil.getLog(AnnouncementsDeliveryPersistenceImpl.class);
1606 private static final Set<String> _badColumnNames = SetUtil.fromArray(new String[] {
1607 "type"
1608 });
1609 private static final AnnouncementsDelivery _nullAnnouncementsDelivery = new AnnouncementsDeliveryImpl() {
1610 @Override
1611 public Object clone() {
1612 return this;
1613 }
1614
1615 @Override
1616 public CacheModel<AnnouncementsDelivery> toCacheModel() {
1617 return _nullAnnouncementsDeliveryCacheModel;
1618 }
1619 };
1620
1621 private static final CacheModel<AnnouncementsDelivery> _nullAnnouncementsDeliveryCacheModel =
1622 new CacheModel<AnnouncementsDelivery>() {
1623 @Override
1624 public AnnouncementsDelivery toEntityModel() {
1625 return _nullAnnouncementsDelivery;
1626 }
1627 };
1628 }