001
014
015 package com.liferay.portal.service.persistence;
016
017 import com.liferay.portal.NoSuchModelException;
018 import com.liferay.portal.NoSuchResourceActionException;
019 import com.liferay.portal.kernel.bean.BeanReference;
020 import com.liferay.portal.kernel.cache.CacheRegistryUtil;
021 import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
022 import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
023 import com.liferay.portal.kernel.dao.orm.FinderPath;
024 import com.liferay.portal.kernel.dao.orm.Query;
025 import com.liferay.portal.kernel.dao.orm.QueryPos;
026 import com.liferay.portal.kernel.dao.orm.QueryUtil;
027 import com.liferay.portal.kernel.dao.orm.Session;
028 import com.liferay.portal.kernel.exception.SystemException;
029 import com.liferay.portal.kernel.log.Log;
030 import com.liferay.portal.kernel.log.LogFactoryUtil;
031 import com.liferay.portal.kernel.util.GetterUtil;
032 import com.liferay.portal.kernel.util.InstanceFactory;
033 import com.liferay.portal.kernel.util.OrderByComparator;
034 import com.liferay.portal.kernel.util.StringBundler;
035 import com.liferay.portal.kernel.util.StringPool;
036 import com.liferay.portal.kernel.util.StringUtil;
037 import com.liferay.portal.kernel.util.Validator;
038 import com.liferay.portal.model.CacheModel;
039 import com.liferay.portal.model.ModelListener;
040 import com.liferay.portal.model.ResourceAction;
041 import com.liferay.portal.model.impl.ResourceActionImpl;
042 import com.liferay.portal.model.impl.ResourceActionModelImpl;
043 import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
044
045 import java.io.Serializable;
046
047 import java.util.ArrayList;
048 import java.util.Collections;
049 import java.util.List;
050
051
063 public class ResourceActionPersistenceImpl extends BasePersistenceImpl<ResourceAction>
064 implements ResourceActionPersistence {
065
070 public static final String FINDER_CLASS_NAME_ENTITY = ResourceActionImpl.class.getName();
071 public static final String FINDER_CLASS_NAME_LIST_WITH_PAGINATION = FINDER_CLASS_NAME_ENTITY +
072 ".List1";
073 public static final String FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION = FINDER_CLASS_NAME_ENTITY +
074 ".List2";
075 public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_BY_NAME = new FinderPath(ResourceActionModelImpl.ENTITY_CACHE_ENABLED,
076 ResourceActionModelImpl.FINDER_CACHE_ENABLED,
077 ResourceActionImpl.class, FINDER_CLASS_NAME_LIST_WITH_PAGINATION,
078 "findByName",
079 new String[] {
080 String.class.getName(),
081
082 "java.lang.Integer", "java.lang.Integer",
083 "com.liferay.portal.kernel.util.OrderByComparator"
084 });
085 public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_NAME = new FinderPath(ResourceActionModelImpl.ENTITY_CACHE_ENABLED,
086 ResourceActionModelImpl.FINDER_CACHE_ENABLED,
087 ResourceActionImpl.class,
088 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findByName",
089 new String[] { String.class.getName() },
090 ResourceActionModelImpl.NAME_COLUMN_BITMASK);
091 public static final FinderPath FINDER_PATH_COUNT_BY_NAME = new FinderPath(ResourceActionModelImpl.ENTITY_CACHE_ENABLED,
092 ResourceActionModelImpl.FINDER_CACHE_ENABLED, Long.class,
093 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByName",
094 new String[] { String.class.getName() });
095 public static final FinderPath FINDER_PATH_FETCH_BY_N_A = new FinderPath(ResourceActionModelImpl.ENTITY_CACHE_ENABLED,
096 ResourceActionModelImpl.FINDER_CACHE_ENABLED,
097 ResourceActionImpl.class, FINDER_CLASS_NAME_ENTITY, "fetchByN_A",
098 new String[] { String.class.getName(), String.class.getName() },
099 ResourceActionModelImpl.NAME_COLUMN_BITMASK |
100 ResourceActionModelImpl.ACTIONID_COLUMN_BITMASK);
101 public static final FinderPath FINDER_PATH_COUNT_BY_N_A = new FinderPath(ResourceActionModelImpl.ENTITY_CACHE_ENABLED,
102 ResourceActionModelImpl.FINDER_CACHE_ENABLED, Long.class,
103 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByN_A",
104 new String[] { String.class.getName(), String.class.getName() });
105 public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_ALL = new FinderPath(ResourceActionModelImpl.ENTITY_CACHE_ENABLED,
106 ResourceActionModelImpl.FINDER_CACHE_ENABLED,
107 ResourceActionImpl.class, FINDER_CLASS_NAME_LIST_WITH_PAGINATION,
108 "findAll", new String[0]);
109 public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL = new FinderPath(ResourceActionModelImpl.ENTITY_CACHE_ENABLED,
110 ResourceActionModelImpl.FINDER_CACHE_ENABLED,
111 ResourceActionImpl.class,
112 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findAll", new String[0]);
113 public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(ResourceActionModelImpl.ENTITY_CACHE_ENABLED,
114 ResourceActionModelImpl.FINDER_CACHE_ENABLED, Long.class,
115 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countAll", new String[0]);
116
117
122 public void cacheResult(ResourceAction resourceAction) {
123 EntityCacheUtil.putResult(ResourceActionModelImpl.ENTITY_CACHE_ENABLED,
124 ResourceActionImpl.class, resourceAction.getPrimaryKey(),
125 resourceAction);
126
127 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_N_A,
128 new Object[] { resourceAction.getName(), resourceAction.getActionId() },
129 resourceAction);
130
131 resourceAction.resetOriginalValues();
132 }
133
134
139 public void cacheResult(List<ResourceAction> resourceActions) {
140 for (ResourceAction resourceAction : resourceActions) {
141 if (EntityCacheUtil.getResult(
142 ResourceActionModelImpl.ENTITY_CACHE_ENABLED,
143 ResourceActionImpl.class, resourceAction.getPrimaryKey()) == null) {
144 cacheResult(resourceAction);
145 }
146 else {
147 resourceAction.resetOriginalValues();
148 }
149 }
150 }
151
152
159 @Override
160 public void clearCache() {
161 if (_HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE) {
162 CacheRegistryUtil.clear(ResourceActionImpl.class.getName());
163 }
164
165 EntityCacheUtil.clearCache(ResourceActionImpl.class.getName());
166
167 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
168 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
169 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
170 }
171
172
179 @Override
180 public void clearCache(ResourceAction resourceAction) {
181 EntityCacheUtil.removeResult(ResourceActionModelImpl.ENTITY_CACHE_ENABLED,
182 ResourceActionImpl.class, resourceAction.getPrimaryKey());
183
184 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
185 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
186
187 clearUniqueFindersCache(resourceAction);
188 }
189
190 @Override
191 public void clearCache(List<ResourceAction> resourceActions) {
192 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
193 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
194
195 for (ResourceAction resourceAction : resourceActions) {
196 EntityCacheUtil.removeResult(ResourceActionModelImpl.ENTITY_CACHE_ENABLED,
197 ResourceActionImpl.class, resourceAction.getPrimaryKey());
198
199 clearUniqueFindersCache(resourceAction);
200 }
201 }
202
203 protected void clearUniqueFindersCache(ResourceAction resourceAction) {
204 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_N_A,
205 new Object[] { resourceAction.getName(), resourceAction.getActionId() });
206 }
207
208
214 public ResourceAction create(long resourceActionId) {
215 ResourceAction resourceAction = new ResourceActionImpl();
216
217 resourceAction.setNew(true);
218 resourceAction.setPrimaryKey(resourceActionId);
219
220 return resourceAction;
221 }
222
223
231 public ResourceAction remove(long resourceActionId)
232 throws NoSuchResourceActionException, SystemException {
233 return remove(Long.valueOf(resourceActionId));
234 }
235
236
244 @Override
245 public ResourceAction remove(Serializable primaryKey)
246 throws NoSuchResourceActionException, SystemException {
247 Session session = null;
248
249 try {
250 session = openSession();
251
252 ResourceAction resourceAction = (ResourceAction)session.get(ResourceActionImpl.class,
253 primaryKey);
254
255 if (resourceAction == null) {
256 if (_log.isWarnEnabled()) {
257 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
258 }
259
260 throw new NoSuchResourceActionException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
261 primaryKey);
262 }
263
264 return remove(resourceAction);
265 }
266 catch (NoSuchResourceActionException nsee) {
267 throw nsee;
268 }
269 catch (Exception e) {
270 throw processException(e);
271 }
272 finally {
273 closeSession(session);
274 }
275 }
276
277 @Override
278 protected ResourceAction removeImpl(ResourceAction resourceAction)
279 throws SystemException {
280 resourceAction = toUnwrappedModel(resourceAction);
281
282 Session session = null;
283
284 try {
285 session = openSession();
286
287 BatchSessionUtil.delete(session, resourceAction);
288 }
289 catch (Exception e) {
290 throw processException(e);
291 }
292 finally {
293 closeSession(session);
294 }
295
296 clearCache(resourceAction);
297
298 return resourceAction;
299 }
300
301 @Override
302 public ResourceAction updateImpl(
303 com.liferay.portal.model.ResourceAction resourceAction, boolean merge)
304 throws SystemException {
305 resourceAction = toUnwrappedModel(resourceAction);
306
307 boolean isNew = resourceAction.isNew();
308
309 ResourceActionModelImpl resourceActionModelImpl = (ResourceActionModelImpl)resourceAction;
310
311 Session session = null;
312
313 try {
314 session = openSession();
315
316 BatchSessionUtil.update(session, resourceAction, merge);
317
318 resourceAction.setNew(false);
319 }
320 catch (Exception e) {
321 throw processException(e);
322 }
323 finally {
324 closeSession(session);
325 }
326
327 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
328
329 if (isNew || !ResourceActionModelImpl.COLUMN_BITMASK_ENABLED) {
330 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
331 }
332
333 else {
334 if ((resourceActionModelImpl.getColumnBitmask() &
335 FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_NAME.getColumnBitmask()) != 0) {
336 Object[] args = new Object[] {
337 resourceActionModelImpl.getOriginalName()
338 };
339
340 FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_NAME, args);
341 FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_NAME,
342 args);
343
344 args = new Object[] { resourceActionModelImpl.getName() };
345
346 FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_NAME, args);
347 FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_NAME,
348 args);
349 }
350 }
351
352 EntityCacheUtil.putResult(ResourceActionModelImpl.ENTITY_CACHE_ENABLED,
353 ResourceActionImpl.class, resourceAction.getPrimaryKey(),
354 resourceAction);
355
356 if (isNew) {
357 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_N_A,
358 new Object[] {
359 resourceAction.getName(),
360
361 resourceAction.getActionId()
362 }, resourceAction);
363 }
364 else {
365 if ((resourceActionModelImpl.getColumnBitmask() &
366 FINDER_PATH_FETCH_BY_N_A.getColumnBitmask()) != 0) {
367 Object[] args = new Object[] {
368 resourceActionModelImpl.getOriginalName(),
369
370 resourceActionModelImpl.getOriginalActionId()
371 };
372
373 FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_N_A, args);
374
375 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_N_A, args);
376
377 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_N_A,
378 new Object[] {
379 resourceAction.getName(),
380
381 resourceAction.getActionId()
382 }, resourceAction);
383 }
384 }
385
386 return resourceAction;
387 }
388
389 protected ResourceAction toUnwrappedModel(ResourceAction resourceAction) {
390 if (resourceAction instanceof ResourceActionImpl) {
391 return resourceAction;
392 }
393
394 ResourceActionImpl resourceActionImpl = new ResourceActionImpl();
395
396 resourceActionImpl.setNew(resourceAction.isNew());
397 resourceActionImpl.setPrimaryKey(resourceAction.getPrimaryKey());
398
399 resourceActionImpl.setResourceActionId(resourceAction.getResourceActionId());
400 resourceActionImpl.setName(resourceAction.getName());
401 resourceActionImpl.setActionId(resourceAction.getActionId());
402 resourceActionImpl.setBitwiseValue(resourceAction.getBitwiseValue());
403
404 return resourceActionImpl;
405 }
406
407
415 @Override
416 public ResourceAction findByPrimaryKey(Serializable primaryKey)
417 throws NoSuchModelException, SystemException {
418 return findByPrimaryKey(((Long)primaryKey).longValue());
419 }
420
421
429 public ResourceAction findByPrimaryKey(long resourceActionId)
430 throws NoSuchResourceActionException, SystemException {
431 ResourceAction resourceAction = fetchByPrimaryKey(resourceActionId);
432
433 if (resourceAction == null) {
434 if (_log.isWarnEnabled()) {
435 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + resourceActionId);
436 }
437
438 throw new NoSuchResourceActionException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
439 resourceActionId);
440 }
441
442 return resourceAction;
443 }
444
445
452 @Override
453 public ResourceAction fetchByPrimaryKey(Serializable primaryKey)
454 throws SystemException {
455 return fetchByPrimaryKey(((Long)primaryKey).longValue());
456 }
457
458
465 public ResourceAction fetchByPrimaryKey(long resourceActionId)
466 throws SystemException {
467 ResourceAction resourceAction = (ResourceAction)EntityCacheUtil.getResult(ResourceActionModelImpl.ENTITY_CACHE_ENABLED,
468 ResourceActionImpl.class, resourceActionId);
469
470 if (resourceAction == _nullResourceAction) {
471 return null;
472 }
473
474 if (resourceAction == null) {
475 Session session = null;
476
477 boolean hasException = false;
478
479 try {
480 session = openSession();
481
482 resourceAction = (ResourceAction)session.get(ResourceActionImpl.class,
483 Long.valueOf(resourceActionId));
484 }
485 catch (Exception e) {
486 hasException = true;
487
488 throw processException(e);
489 }
490 finally {
491 if (resourceAction != null) {
492 cacheResult(resourceAction);
493 }
494 else if (!hasException) {
495 EntityCacheUtil.putResult(ResourceActionModelImpl.ENTITY_CACHE_ENABLED,
496 ResourceActionImpl.class, resourceActionId,
497 _nullResourceAction);
498 }
499
500 closeSession(session);
501 }
502 }
503
504 return resourceAction;
505 }
506
507
514 public List<ResourceAction> findByName(String name)
515 throws SystemException {
516 return findByName(name, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
517 }
518
519
532 public List<ResourceAction> findByName(String name, int start, int end)
533 throws SystemException {
534 return findByName(name, start, end, null);
535 }
536
537
551 public List<ResourceAction> findByName(String name, int start, int end,
552 OrderByComparator orderByComparator) throws SystemException {
553 FinderPath finderPath = null;
554 Object[] finderArgs = null;
555
556 if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
557 (orderByComparator == null)) {
558 finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_NAME;
559 finderArgs = new Object[] { name };
560 }
561 else {
562 finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_NAME;
563 finderArgs = new Object[] { name, start, end, orderByComparator };
564 }
565
566 List<ResourceAction> list = (List<ResourceAction>)FinderCacheUtil.getResult(finderPath,
567 finderArgs, this);
568
569 if ((list != null) && !list.isEmpty()) {
570 for (ResourceAction resourceAction : list) {
571 if (!Validator.equals(name, resourceAction.getName())) {
572 list = null;
573
574 break;
575 }
576 }
577 }
578
579 if (list == null) {
580 StringBundler query = null;
581
582 if (orderByComparator != null) {
583 query = new StringBundler(3 +
584 (orderByComparator.getOrderByFields().length * 3));
585 }
586 else {
587 query = new StringBundler(3);
588 }
589
590 query.append(_SQL_SELECT_RESOURCEACTION_WHERE);
591
592 if (name == null) {
593 query.append(_FINDER_COLUMN_NAME_NAME_1);
594 }
595 else {
596 if (name.equals(StringPool.BLANK)) {
597 query.append(_FINDER_COLUMN_NAME_NAME_3);
598 }
599 else {
600 query.append(_FINDER_COLUMN_NAME_NAME_2);
601 }
602 }
603
604 if (orderByComparator != null) {
605 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
606 orderByComparator);
607 }
608
609 else {
610 query.append(ResourceActionModelImpl.ORDER_BY_JPQL);
611 }
612
613 String sql = query.toString();
614
615 Session session = null;
616
617 try {
618 session = openSession();
619
620 Query q = session.createQuery(sql);
621
622 QueryPos qPos = QueryPos.getInstance(q);
623
624 if (name != null) {
625 qPos.add(name);
626 }
627
628 list = (List<ResourceAction>)QueryUtil.list(q, getDialect(),
629 start, end);
630 }
631 catch (Exception e) {
632 throw processException(e);
633 }
634 finally {
635 if (list == null) {
636 FinderCacheUtil.removeResult(finderPath, finderArgs);
637 }
638 else {
639 cacheResult(list);
640
641 FinderCacheUtil.putResult(finderPath, finderArgs, list);
642 }
643
644 closeSession(session);
645 }
646 }
647
648 return list;
649 }
650
651
660 public ResourceAction findByName_First(String name,
661 OrderByComparator orderByComparator)
662 throws NoSuchResourceActionException, SystemException {
663 ResourceAction resourceAction = fetchByName_First(name,
664 orderByComparator);
665
666 if (resourceAction != null) {
667 return resourceAction;
668 }
669
670 StringBundler msg = new StringBundler(4);
671
672 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
673
674 msg.append("name=");
675 msg.append(name);
676
677 msg.append(StringPool.CLOSE_CURLY_BRACE);
678
679 throw new NoSuchResourceActionException(msg.toString());
680 }
681
682
690 public ResourceAction fetchByName_First(String name,
691 OrderByComparator orderByComparator) throws SystemException {
692 List<ResourceAction> list = findByName(name, 0, 1, orderByComparator);
693
694 if (!list.isEmpty()) {
695 return list.get(0);
696 }
697
698 return null;
699 }
700
701
710 public ResourceAction findByName_Last(String name,
711 OrderByComparator orderByComparator)
712 throws NoSuchResourceActionException, SystemException {
713 ResourceAction resourceAction = fetchByName_Last(name, orderByComparator);
714
715 if (resourceAction != null) {
716 return resourceAction;
717 }
718
719 StringBundler msg = new StringBundler(4);
720
721 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
722
723 msg.append("name=");
724 msg.append(name);
725
726 msg.append(StringPool.CLOSE_CURLY_BRACE);
727
728 throw new NoSuchResourceActionException(msg.toString());
729 }
730
731
739 public ResourceAction fetchByName_Last(String name,
740 OrderByComparator orderByComparator) throws SystemException {
741 int count = countByName(name);
742
743 List<ResourceAction> list = findByName(name, count - 1, count,
744 orderByComparator);
745
746 if (!list.isEmpty()) {
747 return list.get(0);
748 }
749
750 return null;
751 }
752
753
763 public ResourceAction[] findByName_PrevAndNext(long resourceActionId,
764 String name, OrderByComparator orderByComparator)
765 throws NoSuchResourceActionException, SystemException {
766 ResourceAction resourceAction = findByPrimaryKey(resourceActionId);
767
768 Session session = null;
769
770 try {
771 session = openSession();
772
773 ResourceAction[] array = new ResourceActionImpl[3];
774
775 array[0] = getByName_PrevAndNext(session, resourceAction, name,
776 orderByComparator, true);
777
778 array[1] = resourceAction;
779
780 array[2] = getByName_PrevAndNext(session, resourceAction, name,
781 orderByComparator, false);
782
783 return array;
784 }
785 catch (Exception e) {
786 throw processException(e);
787 }
788 finally {
789 closeSession(session);
790 }
791 }
792
793 protected ResourceAction getByName_PrevAndNext(Session session,
794 ResourceAction resourceAction, String name,
795 OrderByComparator orderByComparator, boolean previous) {
796 StringBundler query = null;
797
798 if (orderByComparator != null) {
799 query = new StringBundler(6 +
800 (orderByComparator.getOrderByFields().length * 6));
801 }
802 else {
803 query = new StringBundler(3);
804 }
805
806 query.append(_SQL_SELECT_RESOURCEACTION_WHERE);
807
808 if (name == null) {
809 query.append(_FINDER_COLUMN_NAME_NAME_1);
810 }
811 else {
812 if (name.equals(StringPool.BLANK)) {
813 query.append(_FINDER_COLUMN_NAME_NAME_3);
814 }
815 else {
816 query.append(_FINDER_COLUMN_NAME_NAME_2);
817 }
818 }
819
820 if (orderByComparator != null) {
821 String[] orderByConditionFields = orderByComparator.getOrderByConditionFields();
822
823 if (orderByConditionFields.length > 0) {
824 query.append(WHERE_AND);
825 }
826
827 for (int i = 0; i < orderByConditionFields.length; i++) {
828 query.append(_ORDER_BY_ENTITY_ALIAS);
829 query.append(orderByConditionFields[i]);
830
831 if ((i + 1) < orderByConditionFields.length) {
832 if (orderByComparator.isAscending() ^ previous) {
833 query.append(WHERE_GREATER_THAN_HAS_NEXT);
834 }
835 else {
836 query.append(WHERE_LESSER_THAN_HAS_NEXT);
837 }
838 }
839 else {
840 if (orderByComparator.isAscending() ^ previous) {
841 query.append(WHERE_GREATER_THAN);
842 }
843 else {
844 query.append(WHERE_LESSER_THAN);
845 }
846 }
847 }
848
849 query.append(ORDER_BY_CLAUSE);
850
851 String[] orderByFields = orderByComparator.getOrderByFields();
852
853 for (int i = 0; i < orderByFields.length; i++) {
854 query.append(_ORDER_BY_ENTITY_ALIAS);
855 query.append(orderByFields[i]);
856
857 if ((i + 1) < orderByFields.length) {
858 if (orderByComparator.isAscending() ^ previous) {
859 query.append(ORDER_BY_ASC_HAS_NEXT);
860 }
861 else {
862 query.append(ORDER_BY_DESC_HAS_NEXT);
863 }
864 }
865 else {
866 if (orderByComparator.isAscending() ^ previous) {
867 query.append(ORDER_BY_ASC);
868 }
869 else {
870 query.append(ORDER_BY_DESC);
871 }
872 }
873 }
874 }
875
876 else {
877 query.append(ResourceActionModelImpl.ORDER_BY_JPQL);
878 }
879
880 String sql = query.toString();
881
882 Query q = session.createQuery(sql);
883
884 q.setFirstResult(0);
885 q.setMaxResults(2);
886
887 QueryPos qPos = QueryPos.getInstance(q);
888
889 if (name != null) {
890 qPos.add(name);
891 }
892
893 if (orderByComparator != null) {
894 Object[] values = orderByComparator.getOrderByConditionValues(resourceAction);
895
896 for (Object value : values) {
897 qPos.add(value);
898 }
899 }
900
901 List<ResourceAction> list = q.list();
902
903 if (list.size() == 2) {
904 return list.get(1);
905 }
906 else {
907 return null;
908 }
909 }
910
911
920 public ResourceAction findByN_A(String name, String actionId)
921 throws NoSuchResourceActionException, SystemException {
922 ResourceAction resourceAction = fetchByN_A(name, actionId);
923
924 if (resourceAction == null) {
925 StringBundler msg = new StringBundler(6);
926
927 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
928
929 msg.append("name=");
930 msg.append(name);
931
932 msg.append(", actionId=");
933 msg.append(actionId);
934
935 msg.append(StringPool.CLOSE_CURLY_BRACE);
936
937 if (_log.isWarnEnabled()) {
938 _log.warn(msg.toString());
939 }
940
941 throw new NoSuchResourceActionException(msg.toString());
942 }
943
944 return resourceAction;
945 }
946
947
955 public ResourceAction fetchByN_A(String name, String actionId)
956 throws SystemException {
957 return fetchByN_A(name, actionId, true);
958 }
959
960
969 public ResourceAction fetchByN_A(String name, String actionId,
970 boolean retrieveFromCache) throws SystemException {
971 Object[] finderArgs = new Object[] { name, actionId };
972
973 Object result = null;
974
975 if (retrieveFromCache) {
976 result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_N_A,
977 finderArgs, this);
978 }
979
980 if (result instanceof ResourceAction) {
981 ResourceAction resourceAction = (ResourceAction)result;
982
983 if (!Validator.equals(name, resourceAction.getName()) ||
984 !Validator.equals(actionId, resourceAction.getActionId())) {
985 result = null;
986 }
987 }
988
989 if (result == null) {
990 StringBundler query = new StringBundler(4);
991
992 query.append(_SQL_SELECT_RESOURCEACTION_WHERE);
993
994 if (name == null) {
995 query.append(_FINDER_COLUMN_N_A_NAME_1);
996 }
997 else {
998 if (name.equals(StringPool.BLANK)) {
999 query.append(_FINDER_COLUMN_N_A_NAME_3);
1000 }
1001 else {
1002 query.append(_FINDER_COLUMN_N_A_NAME_2);
1003 }
1004 }
1005
1006 if (actionId == null) {
1007 query.append(_FINDER_COLUMN_N_A_ACTIONID_1);
1008 }
1009 else {
1010 if (actionId.equals(StringPool.BLANK)) {
1011 query.append(_FINDER_COLUMN_N_A_ACTIONID_3);
1012 }
1013 else {
1014 query.append(_FINDER_COLUMN_N_A_ACTIONID_2);
1015 }
1016 }
1017
1018 query.append(ResourceActionModelImpl.ORDER_BY_JPQL);
1019
1020 String sql = query.toString();
1021
1022 Session session = null;
1023
1024 try {
1025 session = openSession();
1026
1027 Query q = session.createQuery(sql);
1028
1029 QueryPos qPos = QueryPos.getInstance(q);
1030
1031 if (name != null) {
1032 qPos.add(name);
1033 }
1034
1035 if (actionId != null) {
1036 qPos.add(actionId);
1037 }
1038
1039 List<ResourceAction> list = q.list();
1040
1041 result = list;
1042
1043 ResourceAction resourceAction = null;
1044
1045 if (list.isEmpty()) {
1046 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_N_A,
1047 finderArgs, list);
1048 }
1049 else {
1050 resourceAction = list.get(0);
1051
1052 cacheResult(resourceAction);
1053
1054 if ((resourceAction.getName() == null) ||
1055 !resourceAction.getName().equals(name) ||
1056 (resourceAction.getActionId() == null) ||
1057 !resourceAction.getActionId().equals(actionId)) {
1058 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_N_A,
1059 finderArgs, resourceAction);
1060 }
1061 }
1062
1063 return resourceAction;
1064 }
1065 catch (Exception e) {
1066 throw processException(e);
1067 }
1068 finally {
1069 if (result == null) {
1070 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_N_A,
1071 finderArgs);
1072 }
1073
1074 closeSession(session);
1075 }
1076 }
1077 else {
1078 if (result instanceof List<?>) {
1079 return null;
1080 }
1081 else {
1082 return (ResourceAction)result;
1083 }
1084 }
1085 }
1086
1087
1093 public List<ResourceAction> findAll() throws SystemException {
1094 return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
1095 }
1096
1097
1109 public List<ResourceAction> findAll(int start, int end)
1110 throws SystemException {
1111 return findAll(start, end, null);
1112 }
1113
1114
1127 public List<ResourceAction> findAll(int start, int end,
1128 OrderByComparator orderByComparator) throws SystemException {
1129 FinderPath finderPath = null;
1130 Object[] finderArgs = new Object[] { start, end, orderByComparator };
1131
1132 if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
1133 (orderByComparator == null)) {
1134 finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL;
1135 finderArgs = FINDER_ARGS_EMPTY;
1136 }
1137 else {
1138 finderPath = FINDER_PATH_WITH_PAGINATION_FIND_ALL;
1139 finderArgs = new Object[] { start, end, orderByComparator };
1140 }
1141
1142 List<ResourceAction> list = (List<ResourceAction>)FinderCacheUtil.getResult(finderPath,
1143 finderArgs, this);
1144
1145 if (list == null) {
1146 StringBundler query = null;
1147 String sql = null;
1148
1149 if (orderByComparator != null) {
1150 query = new StringBundler(2 +
1151 (orderByComparator.getOrderByFields().length * 3));
1152
1153 query.append(_SQL_SELECT_RESOURCEACTION);
1154
1155 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
1156 orderByComparator);
1157
1158 sql = query.toString();
1159 }
1160 else {
1161 sql = _SQL_SELECT_RESOURCEACTION.concat(ResourceActionModelImpl.ORDER_BY_JPQL);
1162 }
1163
1164 Session session = null;
1165
1166 try {
1167 session = openSession();
1168
1169 Query q = session.createQuery(sql);
1170
1171 if (orderByComparator == null) {
1172 list = (List<ResourceAction>)QueryUtil.list(q,
1173 getDialect(), start, end, false);
1174
1175 Collections.sort(list);
1176 }
1177 else {
1178 list = (List<ResourceAction>)QueryUtil.list(q,
1179 getDialect(), start, end);
1180 }
1181 }
1182 catch (Exception e) {
1183 throw processException(e);
1184 }
1185 finally {
1186 if (list == null) {
1187 FinderCacheUtil.removeResult(finderPath, finderArgs);
1188 }
1189 else {
1190 cacheResult(list);
1191
1192 FinderCacheUtil.putResult(finderPath, finderArgs, list);
1193 }
1194
1195 closeSession(session);
1196 }
1197 }
1198
1199 return list;
1200 }
1201
1202
1208 public void removeByName(String name) throws SystemException {
1209 for (ResourceAction resourceAction : findByName(name)) {
1210 remove(resourceAction);
1211 }
1212 }
1213
1214
1222 public ResourceAction removeByN_A(String name, String actionId)
1223 throws NoSuchResourceActionException, SystemException {
1224 ResourceAction resourceAction = findByN_A(name, actionId);
1225
1226 return remove(resourceAction);
1227 }
1228
1229
1234 public void removeAll() throws SystemException {
1235 for (ResourceAction resourceAction : findAll()) {
1236 remove(resourceAction);
1237 }
1238 }
1239
1240
1247 public int countByName(String name) throws SystemException {
1248 Object[] finderArgs = new Object[] { name };
1249
1250 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_NAME,
1251 finderArgs, this);
1252
1253 if (count == null) {
1254 StringBundler query = new StringBundler(2);
1255
1256 query.append(_SQL_COUNT_RESOURCEACTION_WHERE);
1257
1258 if (name == null) {
1259 query.append(_FINDER_COLUMN_NAME_NAME_1);
1260 }
1261 else {
1262 if (name.equals(StringPool.BLANK)) {
1263 query.append(_FINDER_COLUMN_NAME_NAME_3);
1264 }
1265 else {
1266 query.append(_FINDER_COLUMN_NAME_NAME_2);
1267 }
1268 }
1269
1270 String sql = query.toString();
1271
1272 Session session = null;
1273
1274 try {
1275 session = openSession();
1276
1277 Query q = session.createQuery(sql);
1278
1279 QueryPos qPos = QueryPos.getInstance(q);
1280
1281 if (name != null) {
1282 qPos.add(name);
1283 }
1284
1285 count = (Long)q.uniqueResult();
1286 }
1287 catch (Exception e) {
1288 throw processException(e);
1289 }
1290 finally {
1291 if (count == null) {
1292 count = Long.valueOf(0);
1293 }
1294
1295 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_NAME,
1296 finderArgs, count);
1297
1298 closeSession(session);
1299 }
1300 }
1301
1302 return count.intValue();
1303 }
1304
1305
1313 public int countByN_A(String name, String actionId)
1314 throws SystemException {
1315 Object[] finderArgs = new Object[] { name, actionId };
1316
1317 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_N_A,
1318 finderArgs, this);
1319
1320 if (count == null) {
1321 StringBundler query = new StringBundler(3);
1322
1323 query.append(_SQL_COUNT_RESOURCEACTION_WHERE);
1324
1325 if (name == null) {
1326 query.append(_FINDER_COLUMN_N_A_NAME_1);
1327 }
1328 else {
1329 if (name.equals(StringPool.BLANK)) {
1330 query.append(_FINDER_COLUMN_N_A_NAME_3);
1331 }
1332 else {
1333 query.append(_FINDER_COLUMN_N_A_NAME_2);
1334 }
1335 }
1336
1337 if (actionId == null) {
1338 query.append(_FINDER_COLUMN_N_A_ACTIONID_1);
1339 }
1340 else {
1341 if (actionId.equals(StringPool.BLANK)) {
1342 query.append(_FINDER_COLUMN_N_A_ACTIONID_3);
1343 }
1344 else {
1345 query.append(_FINDER_COLUMN_N_A_ACTIONID_2);
1346 }
1347 }
1348
1349 String sql = query.toString();
1350
1351 Session session = null;
1352
1353 try {
1354 session = openSession();
1355
1356 Query q = session.createQuery(sql);
1357
1358 QueryPos qPos = QueryPos.getInstance(q);
1359
1360 if (name != null) {
1361 qPos.add(name);
1362 }
1363
1364 if (actionId != null) {
1365 qPos.add(actionId);
1366 }
1367
1368 count = (Long)q.uniqueResult();
1369 }
1370 catch (Exception e) {
1371 throw processException(e);
1372 }
1373 finally {
1374 if (count == null) {
1375 count = Long.valueOf(0);
1376 }
1377
1378 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_N_A, finderArgs,
1379 count);
1380
1381 closeSession(session);
1382 }
1383 }
1384
1385 return count.intValue();
1386 }
1387
1388
1394 public int countAll() throws SystemException {
1395 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
1396 FINDER_ARGS_EMPTY, this);
1397
1398 if (count == null) {
1399 Session session = null;
1400
1401 try {
1402 session = openSession();
1403
1404 Query q = session.createQuery(_SQL_COUNT_RESOURCEACTION);
1405
1406 count = (Long)q.uniqueResult();
1407 }
1408 catch (Exception e) {
1409 throw processException(e);
1410 }
1411 finally {
1412 if (count == null) {
1413 count = Long.valueOf(0);
1414 }
1415
1416 FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL,
1417 FINDER_ARGS_EMPTY, count);
1418
1419 closeSession(session);
1420 }
1421 }
1422
1423 return count.intValue();
1424 }
1425
1426
1429 public void afterPropertiesSet() {
1430 String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
1431 com.liferay.portal.util.PropsUtil.get(
1432 "value.object.listener.com.liferay.portal.model.ResourceAction")));
1433
1434 if (listenerClassNames.length > 0) {
1435 try {
1436 List<ModelListener<ResourceAction>> listenersList = new ArrayList<ModelListener<ResourceAction>>();
1437
1438 for (String listenerClassName : listenerClassNames) {
1439 listenersList.add((ModelListener<ResourceAction>)InstanceFactory.newInstance(
1440 listenerClassName));
1441 }
1442
1443 listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
1444 }
1445 catch (Exception e) {
1446 _log.error(e);
1447 }
1448 }
1449 }
1450
1451 public void destroy() {
1452 EntityCacheUtil.removeCache(ResourceActionImpl.class.getName());
1453 FinderCacheUtil.removeCache(FINDER_CLASS_NAME_ENTITY);
1454 FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
1455 }
1456
1457 @BeanReference(type = AccountPersistence.class)
1458 protected AccountPersistence accountPersistence;
1459 @BeanReference(type = AddressPersistence.class)
1460 protected AddressPersistence addressPersistence;
1461 @BeanReference(type = BrowserTrackerPersistence.class)
1462 protected BrowserTrackerPersistence browserTrackerPersistence;
1463 @BeanReference(type = ClassNamePersistence.class)
1464 protected ClassNamePersistence classNamePersistence;
1465 @BeanReference(type = ClusterGroupPersistence.class)
1466 protected ClusterGroupPersistence clusterGroupPersistence;
1467 @BeanReference(type = CompanyPersistence.class)
1468 protected CompanyPersistence companyPersistence;
1469 @BeanReference(type = ContactPersistence.class)
1470 protected ContactPersistence contactPersistence;
1471 @BeanReference(type = CountryPersistence.class)
1472 protected CountryPersistence countryPersistence;
1473 @BeanReference(type = EmailAddressPersistence.class)
1474 protected EmailAddressPersistence emailAddressPersistence;
1475 @BeanReference(type = GroupPersistence.class)
1476 protected GroupPersistence groupPersistence;
1477 @BeanReference(type = ImagePersistence.class)
1478 protected ImagePersistence imagePersistence;
1479 @BeanReference(type = LayoutPersistence.class)
1480 protected LayoutPersistence layoutPersistence;
1481 @BeanReference(type = LayoutBranchPersistence.class)
1482 protected LayoutBranchPersistence layoutBranchPersistence;
1483 @BeanReference(type = LayoutPrototypePersistence.class)
1484 protected LayoutPrototypePersistence layoutPrototypePersistence;
1485 @BeanReference(type = LayoutRevisionPersistence.class)
1486 protected LayoutRevisionPersistence layoutRevisionPersistence;
1487 @BeanReference(type = LayoutSetPersistence.class)
1488 protected LayoutSetPersistence layoutSetPersistence;
1489 @BeanReference(type = LayoutSetBranchPersistence.class)
1490 protected LayoutSetBranchPersistence layoutSetBranchPersistence;
1491 @BeanReference(type = LayoutSetPrototypePersistence.class)
1492 protected LayoutSetPrototypePersistence layoutSetPrototypePersistence;
1493 @BeanReference(type = ListTypePersistence.class)
1494 protected ListTypePersistence listTypePersistence;
1495 @BeanReference(type = LockPersistence.class)
1496 protected LockPersistence lockPersistence;
1497 @BeanReference(type = MembershipRequestPersistence.class)
1498 protected MembershipRequestPersistence membershipRequestPersistence;
1499 @BeanReference(type = OrganizationPersistence.class)
1500 protected OrganizationPersistence organizationPersistence;
1501 @BeanReference(type = OrgGroupPermissionPersistence.class)
1502 protected OrgGroupPermissionPersistence orgGroupPermissionPersistence;
1503 @BeanReference(type = OrgGroupRolePersistence.class)
1504 protected OrgGroupRolePersistence orgGroupRolePersistence;
1505 @BeanReference(type = OrgLaborPersistence.class)
1506 protected OrgLaborPersistence orgLaborPersistence;
1507 @BeanReference(type = PasswordPolicyPersistence.class)
1508 protected PasswordPolicyPersistence passwordPolicyPersistence;
1509 @BeanReference(type = PasswordPolicyRelPersistence.class)
1510 protected PasswordPolicyRelPersistence passwordPolicyRelPersistence;
1511 @BeanReference(type = PasswordTrackerPersistence.class)
1512 protected PasswordTrackerPersistence passwordTrackerPersistence;
1513 @BeanReference(type = PermissionPersistence.class)
1514 protected PermissionPersistence permissionPersistence;
1515 @BeanReference(type = PhonePersistence.class)
1516 protected PhonePersistence phonePersistence;
1517 @BeanReference(type = PluginSettingPersistence.class)
1518 protected PluginSettingPersistence pluginSettingPersistence;
1519 @BeanReference(type = PortalPreferencesPersistence.class)
1520 protected PortalPreferencesPersistence portalPreferencesPersistence;
1521 @BeanReference(type = PortletPersistence.class)
1522 protected PortletPersistence portletPersistence;
1523 @BeanReference(type = PortletItemPersistence.class)
1524 protected PortletItemPersistence portletItemPersistence;
1525 @BeanReference(type = PortletPreferencesPersistence.class)
1526 protected PortletPreferencesPersistence portletPreferencesPersistence;
1527 @BeanReference(type = RegionPersistence.class)
1528 protected RegionPersistence regionPersistence;
1529 @BeanReference(type = ReleasePersistence.class)
1530 protected ReleasePersistence releasePersistence;
1531 @BeanReference(type = RepositoryPersistence.class)
1532 protected RepositoryPersistence repositoryPersistence;
1533 @BeanReference(type = RepositoryEntryPersistence.class)
1534 protected RepositoryEntryPersistence repositoryEntryPersistence;
1535 @BeanReference(type = ResourcePersistence.class)
1536 protected ResourcePersistence resourcePersistence;
1537 @BeanReference(type = ResourceActionPersistence.class)
1538 protected ResourceActionPersistence resourceActionPersistence;
1539 @BeanReference(type = ResourceBlockPersistence.class)
1540 protected ResourceBlockPersistence resourceBlockPersistence;
1541 @BeanReference(type = ResourceBlockPermissionPersistence.class)
1542 protected ResourceBlockPermissionPersistence resourceBlockPermissionPersistence;
1543 @BeanReference(type = ResourceCodePersistence.class)
1544 protected ResourceCodePersistence resourceCodePersistence;
1545 @BeanReference(type = ResourcePermissionPersistence.class)
1546 protected ResourcePermissionPersistence resourcePermissionPersistence;
1547 @BeanReference(type = ResourceTypePermissionPersistence.class)
1548 protected ResourceTypePermissionPersistence resourceTypePermissionPersistence;
1549 @BeanReference(type = RolePersistence.class)
1550 protected RolePersistence rolePersistence;
1551 @BeanReference(type = ServiceComponentPersistence.class)
1552 protected ServiceComponentPersistence serviceComponentPersistence;
1553 @BeanReference(type = ShardPersistence.class)
1554 protected ShardPersistence shardPersistence;
1555 @BeanReference(type = SubscriptionPersistence.class)
1556 protected SubscriptionPersistence subscriptionPersistence;
1557 @BeanReference(type = TeamPersistence.class)
1558 protected TeamPersistence teamPersistence;
1559 @BeanReference(type = TicketPersistence.class)
1560 protected TicketPersistence ticketPersistence;
1561 @BeanReference(type = UserPersistence.class)
1562 protected UserPersistence userPersistence;
1563 @BeanReference(type = UserGroupPersistence.class)
1564 protected UserGroupPersistence userGroupPersistence;
1565 @BeanReference(type = UserGroupGroupRolePersistence.class)
1566 protected UserGroupGroupRolePersistence userGroupGroupRolePersistence;
1567 @BeanReference(type = UserGroupRolePersistence.class)
1568 protected UserGroupRolePersistence userGroupRolePersistence;
1569 @BeanReference(type = UserIdMapperPersistence.class)
1570 protected UserIdMapperPersistence userIdMapperPersistence;
1571 @BeanReference(type = UserNotificationEventPersistence.class)
1572 protected UserNotificationEventPersistence userNotificationEventPersistence;
1573 @BeanReference(type = UserTrackerPersistence.class)
1574 protected UserTrackerPersistence userTrackerPersistence;
1575 @BeanReference(type = UserTrackerPathPersistence.class)
1576 protected UserTrackerPathPersistence userTrackerPathPersistence;
1577 @BeanReference(type = VirtualHostPersistence.class)
1578 protected VirtualHostPersistence virtualHostPersistence;
1579 @BeanReference(type = WebDAVPropsPersistence.class)
1580 protected WebDAVPropsPersistence webDAVPropsPersistence;
1581 @BeanReference(type = WebsitePersistence.class)
1582 protected WebsitePersistence websitePersistence;
1583 @BeanReference(type = WorkflowDefinitionLinkPersistence.class)
1584 protected WorkflowDefinitionLinkPersistence workflowDefinitionLinkPersistence;
1585 @BeanReference(type = WorkflowInstanceLinkPersistence.class)
1586 protected WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence;
1587 private static final String _SQL_SELECT_RESOURCEACTION = "SELECT resourceAction FROM ResourceAction resourceAction";
1588 private static final String _SQL_SELECT_RESOURCEACTION_WHERE = "SELECT resourceAction FROM ResourceAction resourceAction WHERE ";
1589 private static final String _SQL_COUNT_RESOURCEACTION = "SELECT COUNT(resourceAction) FROM ResourceAction resourceAction";
1590 private static final String _SQL_COUNT_RESOURCEACTION_WHERE = "SELECT COUNT(resourceAction) FROM ResourceAction resourceAction WHERE ";
1591 private static final String _FINDER_COLUMN_NAME_NAME_1 = "resourceAction.name IS NULL";
1592 private static final String _FINDER_COLUMN_NAME_NAME_2 = "resourceAction.name = ?";
1593 private static final String _FINDER_COLUMN_NAME_NAME_3 = "(resourceAction.name IS NULL OR resourceAction.name = ?)";
1594 private static final String _FINDER_COLUMN_N_A_NAME_1 = "resourceAction.name IS NULL AND ";
1595 private static final String _FINDER_COLUMN_N_A_NAME_2 = "lower(resourceAction.name) = lower(CAST_TEXT(?)) AND ";
1596 private static final String _FINDER_COLUMN_N_A_NAME_3 = "(resourceAction.name IS NULL OR lower(resourceAction.name) = lower(CAST_TEXT(?))) AND ";
1597 private static final String _FINDER_COLUMN_N_A_ACTIONID_1 = "resourceAction.actionId IS NULL";
1598 private static final String _FINDER_COLUMN_N_A_ACTIONID_2 = "resourceAction.actionId = ?";
1599 private static final String _FINDER_COLUMN_N_A_ACTIONID_3 = "(resourceAction.actionId IS NULL OR resourceAction.actionId = ?)";
1600 private static final String _ORDER_BY_ENTITY_ALIAS = "resourceAction.";
1601 private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No ResourceAction exists with the primary key ";
1602 private static final String _NO_SUCH_ENTITY_WITH_KEY = "No ResourceAction exists with the key {";
1603 private static final boolean _HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE = com.liferay.portal.util.PropsValues.HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE;
1604 private static Log _log = LogFactoryUtil.getLog(ResourceActionPersistenceImpl.class);
1605 private static ResourceAction _nullResourceAction = new ResourceActionImpl() {
1606 @Override
1607 public Object clone() {
1608 return this;
1609 }
1610
1611 @Override
1612 public CacheModel<ResourceAction> toCacheModel() {
1613 return _nullResourceActionCacheModel;
1614 }
1615 };
1616
1617 private static CacheModel<ResourceAction> _nullResourceActionCacheModel = new CacheModel<ResourceAction>() {
1618 public ResourceAction toEntityModel() {
1619 return _nullResourceAction;
1620 }
1621 };
1622 }