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