001
014
015 package com.liferay.portlet.expando.service.persistence;
016
017 import com.liferay.portal.NoSuchModelException;
018 import com.liferay.portal.kernel.annotation.BeanReference;
019 import com.liferay.portal.kernel.cache.CacheRegistryUtil;
020 import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
021 import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
022 import com.liferay.portal.kernel.dao.orm.FinderPath;
023 import com.liferay.portal.kernel.dao.orm.Query;
024 import com.liferay.portal.kernel.dao.orm.QueryPos;
025 import com.liferay.portal.kernel.dao.orm.QueryUtil;
026 import com.liferay.portal.kernel.dao.orm.Session;
027 import com.liferay.portal.kernel.exception.SystemException;
028 import com.liferay.portal.kernel.log.Log;
029 import com.liferay.portal.kernel.log.LogFactoryUtil;
030 import com.liferay.portal.kernel.util.GetterUtil;
031 import com.liferay.portal.kernel.util.InstanceFactory;
032 import com.liferay.portal.kernel.util.OrderByComparator;
033 import com.liferay.portal.kernel.util.StringBundler;
034 import com.liferay.portal.kernel.util.StringPool;
035 import com.liferay.portal.kernel.util.StringUtil;
036 import com.liferay.portal.model.ModelListener;
037 import com.liferay.portal.service.persistence.BatchSessionUtil;
038 import com.liferay.portal.service.persistence.ResourcePersistence;
039 import com.liferay.portal.service.persistence.UserPersistence;
040 import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
041
042 import com.liferay.portlet.expando.NoSuchValueException;
043 import com.liferay.portlet.expando.model.ExpandoValue;
044 import com.liferay.portlet.expando.model.impl.ExpandoValueImpl;
045 import com.liferay.portlet.expando.model.impl.ExpandoValueModelImpl;
046
047 import java.io.Serializable;
048
049 import java.util.ArrayList;
050 import java.util.Collections;
051 import java.util.List;
052
053
069 public class ExpandoValuePersistenceImpl extends BasePersistenceImpl<ExpandoValue>
070 implements ExpandoValuePersistence {
071 public static final String FINDER_CLASS_NAME_ENTITY = ExpandoValueImpl.class.getName();
072 public static final String FINDER_CLASS_NAME_LIST = FINDER_CLASS_NAME_ENTITY +
073 ".List";
074 public static final FinderPath FINDER_PATH_FIND_BY_TABLEID = new FinderPath(ExpandoValueModelImpl.ENTITY_CACHE_ENABLED,
075 ExpandoValueModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
076 "findByTableId",
077 new String[] {
078 Long.class.getName(),
079
080 "java.lang.Integer", "java.lang.Integer",
081 "com.liferay.portal.kernel.util.OrderByComparator"
082 });
083 public static final FinderPath FINDER_PATH_COUNT_BY_TABLEID = new FinderPath(ExpandoValueModelImpl.ENTITY_CACHE_ENABLED,
084 ExpandoValueModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
085 "countByTableId", new String[] { Long.class.getName() });
086 public static final FinderPath FINDER_PATH_FIND_BY_COLUMNID = new FinderPath(ExpandoValueModelImpl.ENTITY_CACHE_ENABLED,
087 ExpandoValueModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
088 "findByColumnId",
089 new String[] {
090 Long.class.getName(),
091
092 "java.lang.Integer", "java.lang.Integer",
093 "com.liferay.portal.kernel.util.OrderByComparator"
094 });
095 public static final FinderPath FINDER_PATH_COUNT_BY_COLUMNID = new FinderPath(ExpandoValueModelImpl.ENTITY_CACHE_ENABLED,
096 ExpandoValueModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
097 "countByColumnId", new String[] { Long.class.getName() });
098 public static final FinderPath FINDER_PATH_FIND_BY_ROWID = new FinderPath(ExpandoValueModelImpl.ENTITY_CACHE_ENABLED,
099 ExpandoValueModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
100 "findByRowId",
101 new String[] {
102 Long.class.getName(),
103
104 "java.lang.Integer", "java.lang.Integer",
105 "com.liferay.portal.kernel.util.OrderByComparator"
106 });
107 public static final FinderPath FINDER_PATH_COUNT_BY_ROWID = new FinderPath(ExpandoValueModelImpl.ENTITY_CACHE_ENABLED,
108 ExpandoValueModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
109 "countByRowId", new String[] { Long.class.getName() });
110 public static final FinderPath FINDER_PATH_FIND_BY_T_C = new FinderPath(ExpandoValueModelImpl.ENTITY_CACHE_ENABLED,
111 ExpandoValueModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
112 "findByT_C",
113 new String[] {
114 Long.class.getName(), Long.class.getName(),
115
116 "java.lang.Integer", "java.lang.Integer",
117 "com.liferay.portal.kernel.util.OrderByComparator"
118 });
119 public static final FinderPath FINDER_PATH_COUNT_BY_T_C = new FinderPath(ExpandoValueModelImpl.ENTITY_CACHE_ENABLED,
120 ExpandoValueModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
121 "countByT_C",
122 new String[] { Long.class.getName(), Long.class.getName() });
123 public static final FinderPath FINDER_PATH_FIND_BY_T_CPK = new FinderPath(ExpandoValueModelImpl.ENTITY_CACHE_ENABLED,
124 ExpandoValueModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
125 "findByT_CPK",
126 new String[] {
127 Long.class.getName(), Long.class.getName(),
128
129 "java.lang.Integer", "java.lang.Integer",
130 "com.liferay.portal.kernel.util.OrderByComparator"
131 });
132 public static final FinderPath FINDER_PATH_COUNT_BY_T_CPK = new FinderPath(ExpandoValueModelImpl.ENTITY_CACHE_ENABLED,
133 ExpandoValueModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
134 "countByT_CPK",
135 new String[] { Long.class.getName(), Long.class.getName() });
136 public static final FinderPath FINDER_PATH_FIND_BY_T_R = new FinderPath(ExpandoValueModelImpl.ENTITY_CACHE_ENABLED,
137 ExpandoValueModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
138 "findByT_R",
139 new String[] {
140 Long.class.getName(), Long.class.getName(),
141
142 "java.lang.Integer", "java.lang.Integer",
143 "com.liferay.portal.kernel.util.OrderByComparator"
144 });
145 public static final FinderPath FINDER_PATH_COUNT_BY_T_R = new FinderPath(ExpandoValueModelImpl.ENTITY_CACHE_ENABLED,
146 ExpandoValueModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
147 "countByT_R",
148 new String[] { Long.class.getName(), Long.class.getName() });
149 public static final FinderPath FINDER_PATH_FETCH_BY_C_R = new FinderPath(ExpandoValueModelImpl.ENTITY_CACHE_ENABLED,
150 ExpandoValueModelImpl.FINDER_CACHE_ENABLED,
151 FINDER_CLASS_NAME_ENTITY, "fetchByC_R",
152 new String[] { Long.class.getName(), Long.class.getName() });
153 public static final FinderPath FINDER_PATH_COUNT_BY_C_R = new FinderPath(ExpandoValueModelImpl.ENTITY_CACHE_ENABLED,
154 ExpandoValueModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
155 "countByC_R",
156 new String[] { Long.class.getName(), Long.class.getName() });
157 public static final FinderPath FINDER_PATH_FIND_BY_C_C = new FinderPath(ExpandoValueModelImpl.ENTITY_CACHE_ENABLED,
158 ExpandoValueModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
159 "findByC_C",
160 new String[] {
161 Long.class.getName(), Long.class.getName(),
162
163 "java.lang.Integer", "java.lang.Integer",
164 "com.liferay.portal.kernel.util.OrderByComparator"
165 });
166 public static final FinderPath FINDER_PATH_COUNT_BY_C_C = new FinderPath(ExpandoValueModelImpl.ENTITY_CACHE_ENABLED,
167 ExpandoValueModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
168 "countByC_C",
169 new String[] { Long.class.getName(), Long.class.getName() });
170 public static final FinderPath FINDER_PATH_FETCH_BY_T_C_C = new FinderPath(ExpandoValueModelImpl.ENTITY_CACHE_ENABLED,
171 ExpandoValueModelImpl.FINDER_CACHE_ENABLED,
172 FINDER_CLASS_NAME_ENTITY, "fetchByT_C_C",
173 new String[] {
174 Long.class.getName(), Long.class.getName(), Long.class.getName()
175 });
176 public static final FinderPath FINDER_PATH_COUNT_BY_T_C_C = new FinderPath(ExpandoValueModelImpl.ENTITY_CACHE_ENABLED,
177 ExpandoValueModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
178 "countByT_C_C",
179 new String[] {
180 Long.class.getName(), Long.class.getName(), Long.class.getName()
181 });
182 public static final FinderPath FINDER_PATH_FIND_BY_T_C_D = new FinderPath(ExpandoValueModelImpl.ENTITY_CACHE_ENABLED,
183 ExpandoValueModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
184 "findByT_C_D",
185 new String[] {
186 Long.class.getName(), Long.class.getName(),
187 String.class.getName(),
188
189 "java.lang.Integer", "java.lang.Integer",
190 "com.liferay.portal.kernel.util.OrderByComparator"
191 });
192 public static final FinderPath FINDER_PATH_COUNT_BY_T_C_D = new FinderPath(ExpandoValueModelImpl.ENTITY_CACHE_ENABLED,
193 ExpandoValueModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
194 "countByT_C_D",
195 new String[] {
196 Long.class.getName(), Long.class.getName(),
197 String.class.getName()
198 });
199 public static final FinderPath FINDER_PATH_FIND_ALL = new FinderPath(ExpandoValueModelImpl.ENTITY_CACHE_ENABLED,
200 ExpandoValueModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
201 "findAll", new String[0]);
202 public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(ExpandoValueModelImpl.ENTITY_CACHE_ENABLED,
203 ExpandoValueModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
204 "countAll", new String[0]);
205
206
211 public void cacheResult(ExpandoValue expandoValue) {
212 EntityCacheUtil.putResult(ExpandoValueModelImpl.ENTITY_CACHE_ENABLED,
213 ExpandoValueImpl.class, expandoValue.getPrimaryKey(), expandoValue);
214
215 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_R,
216 new Object[] {
217 new Long(expandoValue.getColumnId()),
218 new Long(expandoValue.getRowId())
219 }, expandoValue);
220
221 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_T_C_C,
222 new Object[] {
223 new Long(expandoValue.getTableId()),
224 new Long(expandoValue.getColumnId()),
225 new Long(expandoValue.getClassPK())
226 }, expandoValue);
227 }
228
229
234 public void cacheResult(List<ExpandoValue> expandoValues) {
235 for (ExpandoValue expandoValue : expandoValues) {
236 if (EntityCacheUtil.getResult(
237 ExpandoValueModelImpl.ENTITY_CACHE_ENABLED,
238 ExpandoValueImpl.class, expandoValue.getPrimaryKey(),
239 this) == null) {
240 cacheResult(expandoValue);
241 }
242 }
243 }
244
245
252 public void clearCache() {
253 CacheRegistryUtil.clear(ExpandoValueImpl.class.getName());
254 EntityCacheUtil.clearCache(ExpandoValueImpl.class.getName());
255 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
256 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
257 }
258
259
266 public void clearCache(ExpandoValue expandoValue) {
267 EntityCacheUtil.removeResult(ExpandoValueModelImpl.ENTITY_CACHE_ENABLED,
268 ExpandoValueImpl.class, expandoValue.getPrimaryKey());
269
270 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_C_R,
271 new Object[] {
272 new Long(expandoValue.getColumnId()),
273 new Long(expandoValue.getRowId())
274 });
275
276 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_T_C_C,
277 new Object[] {
278 new Long(expandoValue.getTableId()),
279 new Long(expandoValue.getColumnId()),
280 new Long(expandoValue.getClassPK())
281 });
282 }
283
284
290 public ExpandoValue create(long valueId) {
291 ExpandoValue expandoValue = new ExpandoValueImpl();
292
293 expandoValue.setNew(true);
294 expandoValue.setPrimaryKey(valueId);
295
296 return expandoValue;
297 }
298
299
307 public ExpandoValue remove(Serializable primaryKey)
308 throws NoSuchModelException, SystemException {
309 return remove(((Long)primaryKey).longValue());
310 }
311
312
320 public ExpandoValue remove(long valueId)
321 throws NoSuchValueException, SystemException {
322 Session session = null;
323
324 try {
325 session = openSession();
326
327 ExpandoValue expandoValue = (ExpandoValue)session.get(ExpandoValueImpl.class,
328 new Long(valueId));
329
330 if (expandoValue == null) {
331 if (_log.isWarnEnabled()) {
332 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + valueId);
333 }
334
335 throw new NoSuchValueException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
336 valueId);
337 }
338
339 return remove(expandoValue);
340 }
341 catch (NoSuchValueException nsee) {
342 throw nsee;
343 }
344 catch (Exception e) {
345 throw processException(e);
346 }
347 finally {
348 closeSession(session);
349 }
350 }
351
352 protected ExpandoValue removeImpl(ExpandoValue expandoValue)
353 throws SystemException {
354 expandoValue = toUnwrappedModel(expandoValue);
355
356 Session session = null;
357
358 try {
359 session = openSession();
360
361 BatchSessionUtil.delete(session, expandoValue);
362 }
363 catch (Exception e) {
364 throw processException(e);
365 }
366 finally {
367 closeSession(session);
368 }
369
370 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
371
372 ExpandoValueModelImpl expandoValueModelImpl = (ExpandoValueModelImpl)expandoValue;
373
374 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_C_R,
375 new Object[] {
376 new Long(expandoValueModelImpl.getColumnId()),
377 new Long(expandoValueModelImpl.getRowId())
378 });
379
380 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_T_C_C,
381 new Object[] {
382 new Long(expandoValueModelImpl.getTableId()),
383 new Long(expandoValueModelImpl.getColumnId()),
384 new Long(expandoValueModelImpl.getClassPK())
385 });
386
387 EntityCacheUtil.removeResult(ExpandoValueModelImpl.ENTITY_CACHE_ENABLED,
388 ExpandoValueImpl.class, expandoValue.getPrimaryKey());
389
390 return expandoValue;
391 }
392
393 public ExpandoValue updateImpl(
394 com.liferay.portlet.expando.model.ExpandoValue expandoValue,
395 boolean merge) throws SystemException {
396 expandoValue = toUnwrappedModel(expandoValue);
397
398 boolean isNew = expandoValue.isNew();
399
400 ExpandoValueModelImpl expandoValueModelImpl = (ExpandoValueModelImpl)expandoValue;
401
402 Session session = null;
403
404 try {
405 session = openSession();
406
407 BatchSessionUtil.update(session, expandoValue, merge);
408
409 expandoValue.setNew(false);
410 }
411 catch (Exception e) {
412 throw processException(e);
413 }
414 finally {
415 closeSession(session);
416 }
417
418 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
419
420 EntityCacheUtil.putResult(ExpandoValueModelImpl.ENTITY_CACHE_ENABLED,
421 ExpandoValueImpl.class, expandoValue.getPrimaryKey(), expandoValue);
422
423 if (!isNew &&
424 ((expandoValue.getColumnId() != expandoValueModelImpl.getOriginalColumnId()) ||
425 (expandoValue.getRowId() != expandoValueModelImpl.getOriginalRowId()))) {
426 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_C_R,
427 new Object[] {
428 new Long(expandoValueModelImpl.getOriginalColumnId()),
429 new Long(expandoValueModelImpl.getOriginalRowId())
430 });
431 }
432
433 if (isNew ||
434 ((expandoValue.getColumnId() != expandoValueModelImpl.getOriginalColumnId()) ||
435 (expandoValue.getRowId() != expandoValueModelImpl.getOriginalRowId()))) {
436 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_R,
437 new Object[] {
438 new Long(expandoValue.getColumnId()),
439 new Long(expandoValue.getRowId())
440 }, expandoValue);
441 }
442
443 if (!isNew &&
444 ((expandoValue.getTableId() != expandoValueModelImpl.getOriginalTableId()) ||
445 (expandoValue.getColumnId() != expandoValueModelImpl.getOriginalColumnId()) ||
446 (expandoValue.getClassPK() != expandoValueModelImpl.getOriginalClassPK()))) {
447 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_T_C_C,
448 new Object[] {
449 new Long(expandoValueModelImpl.getOriginalTableId()),
450 new Long(expandoValueModelImpl.getOriginalColumnId()),
451 new Long(expandoValueModelImpl.getOriginalClassPK())
452 });
453 }
454
455 if (isNew ||
456 ((expandoValue.getTableId() != expandoValueModelImpl.getOriginalTableId()) ||
457 (expandoValue.getColumnId() != expandoValueModelImpl.getOriginalColumnId()) ||
458 (expandoValue.getClassPK() != expandoValueModelImpl.getOriginalClassPK()))) {
459 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_T_C_C,
460 new Object[] {
461 new Long(expandoValue.getTableId()),
462 new Long(expandoValue.getColumnId()),
463 new Long(expandoValue.getClassPK())
464 }, expandoValue);
465 }
466
467 return expandoValue;
468 }
469
470 protected ExpandoValue toUnwrappedModel(ExpandoValue expandoValue) {
471 if (expandoValue instanceof ExpandoValueImpl) {
472 return expandoValue;
473 }
474
475 ExpandoValueImpl expandoValueImpl = new ExpandoValueImpl();
476
477 expandoValueImpl.setNew(expandoValue.isNew());
478 expandoValueImpl.setPrimaryKey(expandoValue.getPrimaryKey());
479
480 expandoValueImpl.setValueId(expandoValue.getValueId());
481 expandoValueImpl.setCompanyId(expandoValue.getCompanyId());
482 expandoValueImpl.setTableId(expandoValue.getTableId());
483 expandoValueImpl.setColumnId(expandoValue.getColumnId());
484 expandoValueImpl.setRowId(expandoValue.getRowId());
485 expandoValueImpl.setClassNameId(expandoValue.getClassNameId());
486 expandoValueImpl.setClassPK(expandoValue.getClassPK());
487 expandoValueImpl.setData(expandoValue.getData());
488
489 return expandoValueImpl;
490 }
491
492
500 public ExpandoValue findByPrimaryKey(Serializable primaryKey)
501 throws NoSuchModelException, SystemException {
502 return findByPrimaryKey(((Long)primaryKey).longValue());
503 }
504
505
513 public ExpandoValue findByPrimaryKey(long valueId)
514 throws NoSuchValueException, SystemException {
515 ExpandoValue expandoValue = fetchByPrimaryKey(valueId);
516
517 if (expandoValue == null) {
518 if (_log.isWarnEnabled()) {
519 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + valueId);
520 }
521
522 throw new NoSuchValueException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
523 valueId);
524 }
525
526 return expandoValue;
527 }
528
529
536 public ExpandoValue fetchByPrimaryKey(Serializable primaryKey)
537 throws SystemException {
538 return fetchByPrimaryKey(((Long)primaryKey).longValue());
539 }
540
541
548 public ExpandoValue fetchByPrimaryKey(long valueId)
549 throws SystemException {
550 ExpandoValue expandoValue = (ExpandoValue)EntityCacheUtil.getResult(ExpandoValueModelImpl.ENTITY_CACHE_ENABLED,
551 ExpandoValueImpl.class, valueId, this);
552
553 if (expandoValue == null) {
554 Session session = null;
555
556 try {
557 session = openSession();
558
559 expandoValue = (ExpandoValue)session.get(ExpandoValueImpl.class,
560 new Long(valueId));
561 }
562 catch (Exception e) {
563 throw processException(e);
564 }
565 finally {
566 if (expandoValue != null) {
567 cacheResult(expandoValue);
568 }
569
570 closeSession(session);
571 }
572 }
573
574 return expandoValue;
575 }
576
577
584 public List<ExpandoValue> findByTableId(long tableId)
585 throws SystemException {
586 return findByTableId(tableId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
587 }
588
589
602 public List<ExpandoValue> findByTableId(long tableId, int start, int end)
603 throws SystemException {
604 return findByTableId(tableId, start, end, null);
605 }
606
607
621 public List<ExpandoValue> findByTableId(long tableId, int start, int end,
622 OrderByComparator orderByComparator) throws SystemException {
623 Object[] finderArgs = new Object[] {
624 tableId,
625
626 String.valueOf(start), String.valueOf(end),
627 String.valueOf(orderByComparator)
628 };
629
630 List<ExpandoValue> list = (List<ExpandoValue>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_TABLEID,
631 finderArgs, this);
632
633 if (list == null) {
634 StringBundler query = null;
635
636 if (orderByComparator != null) {
637 query = new StringBundler(3 +
638 (orderByComparator.getOrderByFields().length * 3));
639 }
640 else {
641 query = new StringBundler(3);
642 }
643
644 query.append(_SQL_SELECT_EXPANDOVALUE_WHERE);
645
646 query.append(_FINDER_COLUMN_TABLEID_TABLEID_2);
647
648 if (orderByComparator != null) {
649 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
650 orderByComparator);
651 }
652
653 else {
654 query.append(ExpandoValueModelImpl.ORDER_BY_JPQL);
655 }
656
657 String sql = query.toString();
658
659 Session session = null;
660
661 try {
662 session = openSession();
663
664 Query q = session.createQuery(sql);
665
666 QueryPos qPos = QueryPos.getInstance(q);
667
668 qPos.add(tableId);
669
670 list = (List<ExpandoValue>)QueryUtil.list(q, getDialect(),
671 start, end);
672 }
673 catch (Exception e) {
674 throw processException(e);
675 }
676 finally {
677 if (list == null) {
678 FinderCacheUtil.removeResult(FINDER_PATH_FIND_BY_TABLEID,
679 finderArgs);
680 }
681 else {
682 cacheResult(list);
683
684 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_TABLEID,
685 finderArgs, list);
686 }
687
688 closeSession(session);
689 }
690 }
691
692 return list;
693 }
694
695
708 public ExpandoValue findByTableId_First(long tableId,
709 OrderByComparator orderByComparator)
710 throws NoSuchValueException, SystemException {
711 List<ExpandoValue> list = findByTableId(tableId, 0, 1, orderByComparator);
712
713 if (list.isEmpty()) {
714 StringBundler msg = new StringBundler(4);
715
716 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
717
718 msg.append("tableId=");
719 msg.append(tableId);
720
721 msg.append(StringPool.CLOSE_CURLY_BRACE);
722
723 throw new NoSuchValueException(msg.toString());
724 }
725 else {
726 return list.get(0);
727 }
728 }
729
730
743 public ExpandoValue findByTableId_Last(long tableId,
744 OrderByComparator orderByComparator)
745 throws NoSuchValueException, SystemException {
746 int count = countByTableId(tableId);
747
748 List<ExpandoValue> list = findByTableId(tableId, count - 1, count,
749 orderByComparator);
750
751 if (list.isEmpty()) {
752 StringBundler msg = new StringBundler(4);
753
754 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
755
756 msg.append("tableId=");
757 msg.append(tableId);
758
759 msg.append(StringPool.CLOSE_CURLY_BRACE);
760
761 throw new NoSuchValueException(msg.toString());
762 }
763 else {
764 return list.get(0);
765 }
766 }
767
768
782 public ExpandoValue[] findByTableId_PrevAndNext(long valueId, long tableId,
783 OrderByComparator orderByComparator)
784 throws NoSuchValueException, SystemException {
785 ExpandoValue expandoValue = findByPrimaryKey(valueId);
786
787 Session session = null;
788
789 try {
790 session = openSession();
791
792 ExpandoValue[] array = new ExpandoValueImpl[3];
793
794 array[0] = getByTableId_PrevAndNext(session, expandoValue, tableId,
795 orderByComparator, true);
796
797 array[1] = expandoValue;
798
799 array[2] = getByTableId_PrevAndNext(session, expandoValue, tableId,
800 orderByComparator, false);
801
802 return array;
803 }
804 catch (Exception e) {
805 throw processException(e);
806 }
807 finally {
808 closeSession(session);
809 }
810 }
811
812 protected ExpandoValue getByTableId_PrevAndNext(Session session,
813 ExpandoValue expandoValue, long tableId,
814 OrderByComparator orderByComparator, boolean previous) {
815 StringBundler query = null;
816
817 if (orderByComparator != null) {
818 query = new StringBundler(6 +
819 (orderByComparator.getOrderByFields().length * 6));
820 }
821 else {
822 query = new StringBundler(3);
823 }
824
825 query.append(_SQL_SELECT_EXPANDOVALUE_WHERE);
826
827 query.append(_FINDER_COLUMN_TABLEID_TABLEID_2);
828
829 if (orderByComparator != null) {
830 String[] orderByFields = orderByComparator.getOrderByFields();
831
832 if (orderByFields.length > 0) {
833 query.append(WHERE_AND);
834 }
835
836 for (int i = 0; i < orderByFields.length; i++) {
837 query.append(_ORDER_BY_ENTITY_ALIAS);
838 query.append(orderByFields[i]);
839
840 if ((i + 1) < orderByFields.length) {
841 if (orderByComparator.isAscending() ^ previous) {
842 query.append(WHERE_GREATER_THAN_HAS_NEXT);
843 }
844 else {
845 query.append(WHERE_LESSER_THAN_HAS_NEXT);
846 }
847 }
848 else {
849 if (orderByComparator.isAscending() ^ previous) {
850 query.append(WHERE_GREATER_THAN);
851 }
852 else {
853 query.append(WHERE_LESSER_THAN);
854 }
855 }
856 }
857
858 query.append(ORDER_BY_CLAUSE);
859
860 for (int i = 0; i < orderByFields.length; i++) {
861 query.append(_ORDER_BY_ENTITY_ALIAS);
862 query.append(orderByFields[i]);
863
864 if ((i + 1) < orderByFields.length) {
865 if (orderByComparator.isAscending() ^ previous) {
866 query.append(ORDER_BY_ASC_HAS_NEXT);
867 }
868 else {
869 query.append(ORDER_BY_DESC_HAS_NEXT);
870 }
871 }
872 else {
873 if (orderByComparator.isAscending() ^ previous) {
874 query.append(ORDER_BY_ASC);
875 }
876 else {
877 query.append(ORDER_BY_DESC);
878 }
879 }
880 }
881 }
882
883 else {
884 query.append(ExpandoValueModelImpl.ORDER_BY_JPQL);
885 }
886
887 String sql = query.toString();
888
889 Query q = session.createQuery(sql);
890
891 q.setFirstResult(0);
892 q.setMaxResults(2);
893
894 QueryPos qPos = QueryPos.getInstance(q);
895
896 qPos.add(tableId);
897
898 if (orderByComparator != null) {
899 Object[] values = orderByComparator.getOrderByValues(expandoValue);
900
901 for (Object value : values) {
902 qPos.add(value);
903 }
904 }
905
906 List<ExpandoValue> list = q.list();
907
908 if (list.size() == 2) {
909 return list.get(1);
910 }
911 else {
912 return null;
913 }
914 }
915
916
923 public List<ExpandoValue> findByColumnId(long columnId)
924 throws SystemException {
925 return findByColumnId(columnId, QueryUtil.ALL_POS, QueryUtil.ALL_POS,
926 null);
927 }
928
929
942 public List<ExpandoValue> findByColumnId(long columnId, int start, int end)
943 throws SystemException {
944 return findByColumnId(columnId, start, end, null);
945 }
946
947
961 public List<ExpandoValue> findByColumnId(long columnId, int start, int end,
962 OrderByComparator orderByComparator) throws SystemException {
963 Object[] finderArgs = new Object[] {
964 columnId,
965
966 String.valueOf(start), String.valueOf(end),
967 String.valueOf(orderByComparator)
968 };
969
970 List<ExpandoValue> list = (List<ExpandoValue>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_COLUMNID,
971 finderArgs, this);
972
973 if (list == null) {
974 StringBundler query = null;
975
976 if (orderByComparator != null) {
977 query = new StringBundler(3 +
978 (orderByComparator.getOrderByFields().length * 3));
979 }
980 else {
981 query = new StringBundler(3);
982 }
983
984 query.append(_SQL_SELECT_EXPANDOVALUE_WHERE);
985
986 query.append(_FINDER_COLUMN_COLUMNID_COLUMNID_2);
987
988 if (orderByComparator != null) {
989 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
990 orderByComparator);
991 }
992
993 else {
994 query.append(ExpandoValueModelImpl.ORDER_BY_JPQL);
995 }
996
997 String sql = query.toString();
998
999 Session session = null;
1000
1001 try {
1002 session = openSession();
1003
1004 Query q = session.createQuery(sql);
1005
1006 QueryPos qPos = QueryPos.getInstance(q);
1007
1008 qPos.add(columnId);
1009
1010 list = (List<ExpandoValue>)QueryUtil.list(q, getDialect(),
1011 start, end);
1012 }
1013 catch (Exception e) {
1014 throw processException(e);
1015 }
1016 finally {
1017 if (list == null) {
1018 FinderCacheUtil.removeResult(FINDER_PATH_FIND_BY_COLUMNID,
1019 finderArgs);
1020 }
1021 else {
1022 cacheResult(list);
1023
1024 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_COLUMNID,
1025 finderArgs, list);
1026 }
1027
1028 closeSession(session);
1029 }
1030 }
1031
1032 return list;
1033 }
1034
1035
1048 public ExpandoValue findByColumnId_First(long columnId,
1049 OrderByComparator orderByComparator)
1050 throws NoSuchValueException, SystemException {
1051 List<ExpandoValue> list = findByColumnId(columnId, 0, 1,
1052 orderByComparator);
1053
1054 if (list.isEmpty()) {
1055 StringBundler msg = new StringBundler(4);
1056
1057 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1058
1059 msg.append("columnId=");
1060 msg.append(columnId);
1061
1062 msg.append(StringPool.CLOSE_CURLY_BRACE);
1063
1064 throw new NoSuchValueException(msg.toString());
1065 }
1066 else {
1067 return list.get(0);
1068 }
1069 }
1070
1071
1084 public ExpandoValue findByColumnId_Last(long columnId,
1085 OrderByComparator orderByComparator)
1086 throws NoSuchValueException, SystemException {
1087 int count = countByColumnId(columnId);
1088
1089 List<ExpandoValue> list = findByColumnId(columnId, count - 1, count,
1090 orderByComparator);
1091
1092 if (list.isEmpty()) {
1093 StringBundler msg = new StringBundler(4);
1094
1095 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1096
1097 msg.append("columnId=");
1098 msg.append(columnId);
1099
1100 msg.append(StringPool.CLOSE_CURLY_BRACE);
1101
1102 throw new NoSuchValueException(msg.toString());
1103 }
1104 else {
1105 return list.get(0);
1106 }
1107 }
1108
1109
1123 public ExpandoValue[] findByColumnId_PrevAndNext(long valueId,
1124 long columnId, OrderByComparator orderByComparator)
1125 throws NoSuchValueException, SystemException {
1126 ExpandoValue expandoValue = findByPrimaryKey(valueId);
1127
1128 Session session = null;
1129
1130 try {
1131 session = openSession();
1132
1133 ExpandoValue[] array = new ExpandoValueImpl[3];
1134
1135 array[0] = getByColumnId_PrevAndNext(session, expandoValue,
1136 columnId, orderByComparator, true);
1137
1138 array[1] = expandoValue;
1139
1140 array[2] = getByColumnId_PrevAndNext(session, expandoValue,
1141 columnId, orderByComparator, false);
1142
1143 return array;
1144 }
1145 catch (Exception e) {
1146 throw processException(e);
1147 }
1148 finally {
1149 closeSession(session);
1150 }
1151 }
1152
1153 protected ExpandoValue getByColumnId_PrevAndNext(Session session,
1154 ExpandoValue expandoValue, long columnId,
1155 OrderByComparator orderByComparator, boolean previous) {
1156 StringBundler query = null;
1157
1158 if (orderByComparator != null) {
1159 query = new StringBundler(6 +
1160 (orderByComparator.getOrderByFields().length * 6));
1161 }
1162 else {
1163 query = new StringBundler(3);
1164 }
1165
1166 query.append(_SQL_SELECT_EXPANDOVALUE_WHERE);
1167
1168 query.append(_FINDER_COLUMN_COLUMNID_COLUMNID_2);
1169
1170 if (orderByComparator != null) {
1171 String[] orderByFields = orderByComparator.getOrderByFields();
1172
1173 if (orderByFields.length > 0) {
1174 query.append(WHERE_AND);
1175 }
1176
1177 for (int i = 0; i < orderByFields.length; i++) {
1178 query.append(_ORDER_BY_ENTITY_ALIAS);
1179 query.append(orderByFields[i]);
1180
1181 if ((i + 1) < orderByFields.length) {
1182 if (orderByComparator.isAscending() ^ previous) {
1183 query.append(WHERE_GREATER_THAN_HAS_NEXT);
1184 }
1185 else {
1186 query.append(WHERE_LESSER_THAN_HAS_NEXT);
1187 }
1188 }
1189 else {
1190 if (orderByComparator.isAscending() ^ previous) {
1191 query.append(WHERE_GREATER_THAN);
1192 }
1193 else {
1194 query.append(WHERE_LESSER_THAN);
1195 }
1196 }
1197 }
1198
1199 query.append(ORDER_BY_CLAUSE);
1200
1201 for (int i = 0; i < orderByFields.length; i++) {
1202 query.append(_ORDER_BY_ENTITY_ALIAS);
1203 query.append(orderByFields[i]);
1204
1205 if ((i + 1) < orderByFields.length) {
1206 if (orderByComparator.isAscending() ^ previous) {
1207 query.append(ORDER_BY_ASC_HAS_NEXT);
1208 }
1209 else {
1210 query.append(ORDER_BY_DESC_HAS_NEXT);
1211 }
1212 }
1213 else {
1214 if (orderByComparator.isAscending() ^ previous) {
1215 query.append(ORDER_BY_ASC);
1216 }
1217 else {
1218 query.append(ORDER_BY_DESC);
1219 }
1220 }
1221 }
1222 }
1223
1224 else {
1225 query.append(ExpandoValueModelImpl.ORDER_BY_JPQL);
1226 }
1227
1228 String sql = query.toString();
1229
1230 Query q = session.createQuery(sql);
1231
1232 q.setFirstResult(0);
1233 q.setMaxResults(2);
1234
1235 QueryPos qPos = QueryPos.getInstance(q);
1236
1237 qPos.add(columnId);
1238
1239 if (orderByComparator != null) {
1240 Object[] values = orderByComparator.getOrderByValues(expandoValue);
1241
1242 for (Object value : values) {
1243 qPos.add(value);
1244 }
1245 }
1246
1247 List<ExpandoValue> list = q.list();
1248
1249 if (list.size() == 2) {
1250 return list.get(1);
1251 }
1252 else {
1253 return null;
1254 }
1255 }
1256
1257
1264 public List<ExpandoValue> findByRowId(long rowId) throws SystemException {
1265 return findByRowId(rowId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
1266 }
1267
1268
1281 public List<ExpandoValue> findByRowId(long rowId, int start, int end)
1282 throws SystemException {
1283 return findByRowId(rowId, start, end, null);
1284 }
1285
1286
1300 public List<ExpandoValue> findByRowId(long rowId, int start, int end,
1301 OrderByComparator orderByComparator) throws SystemException {
1302 Object[] finderArgs = new Object[] {
1303 rowId,
1304
1305 String.valueOf(start), String.valueOf(end),
1306 String.valueOf(orderByComparator)
1307 };
1308
1309 List<ExpandoValue> list = (List<ExpandoValue>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_ROWID,
1310 finderArgs, this);
1311
1312 if (list == null) {
1313 StringBundler query = null;
1314
1315 if (orderByComparator != null) {
1316 query = new StringBundler(3 +
1317 (orderByComparator.getOrderByFields().length * 3));
1318 }
1319 else {
1320 query = new StringBundler(3);
1321 }
1322
1323 query.append(_SQL_SELECT_EXPANDOVALUE_WHERE);
1324
1325 query.append(_FINDER_COLUMN_ROWID_ROWID_2);
1326
1327 if (orderByComparator != null) {
1328 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
1329 orderByComparator);
1330 }
1331
1332 else {
1333 query.append(ExpandoValueModelImpl.ORDER_BY_JPQL);
1334 }
1335
1336 String sql = query.toString();
1337
1338 Session session = null;
1339
1340 try {
1341 session = openSession();
1342
1343 Query q = session.createQuery(sql);
1344
1345 QueryPos qPos = QueryPos.getInstance(q);
1346
1347 qPos.add(rowId);
1348
1349 list = (List<ExpandoValue>)QueryUtil.list(q, getDialect(),
1350 start, end);
1351 }
1352 catch (Exception e) {
1353 throw processException(e);
1354 }
1355 finally {
1356 if (list == null) {
1357 FinderCacheUtil.removeResult(FINDER_PATH_FIND_BY_ROWID,
1358 finderArgs);
1359 }
1360 else {
1361 cacheResult(list);
1362
1363 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_ROWID,
1364 finderArgs, list);
1365 }
1366
1367 closeSession(session);
1368 }
1369 }
1370
1371 return list;
1372 }
1373
1374
1387 public ExpandoValue findByRowId_First(long rowId,
1388 OrderByComparator orderByComparator)
1389 throws NoSuchValueException, SystemException {
1390 List<ExpandoValue> list = findByRowId(rowId, 0, 1, orderByComparator);
1391
1392 if (list.isEmpty()) {
1393 StringBundler msg = new StringBundler(4);
1394
1395 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1396
1397 msg.append("rowId=");
1398 msg.append(rowId);
1399
1400 msg.append(StringPool.CLOSE_CURLY_BRACE);
1401
1402 throw new NoSuchValueException(msg.toString());
1403 }
1404 else {
1405 return list.get(0);
1406 }
1407 }
1408
1409
1422 public ExpandoValue findByRowId_Last(long rowId,
1423 OrderByComparator orderByComparator)
1424 throws NoSuchValueException, SystemException {
1425 int count = countByRowId(rowId);
1426
1427 List<ExpandoValue> list = findByRowId(rowId, count - 1, count,
1428 orderByComparator);
1429
1430 if (list.isEmpty()) {
1431 StringBundler msg = new StringBundler(4);
1432
1433 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1434
1435 msg.append("rowId=");
1436 msg.append(rowId);
1437
1438 msg.append(StringPool.CLOSE_CURLY_BRACE);
1439
1440 throw new NoSuchValueException(msg.toString());
1441 }
1442 else {
1443 return list.get(0);
1444 }
1445 }
1446
1447
1461 public ExpandoValue[] findByRowId_PrevAndNext(long valueId, long rowId,
1462 OrderByComparator orderByComparator)
1463 throws NoSuchValueException, SystemException {
1464 ExpandoValue expandoValue = findByPrimaryKey(valueId);
1465
1466 Session session = null;
1467
1468 try {
1469 session = openSession();
1470
1471 ExpandoValue[] array = new ExpandoValueImpl[3];
1472
1473 array[0] = getByRowId_PrevAndNext(session, expandoValue, rowId,
1474 orderByComparator, true);
1475
1476 array[1] = expandoValue;
1477
1478 array[2] = getByRowId_PrevAndNext(session, expandoValue, rowId,
1479 orderByComparator, false);
1480
1481 return array;
1482 }
1483 catch (Exception e) {
1484 throw processException(e);
1485 }
1486 finally {
1487 closeSession(session);
1488 }
1489 }
1490
1491 protected ExpandoValue getByRowId_PrevAndNext(Session session,
1492 ExpandoValue expandoValue, long rowId,
1493 OrderByComparator orderByComparator, boolean previous) {
1494 StringBundler query = null;
1495
1496 if (orderByComparator != null) {
1497 query = new StringBundler(6 +
1498 (orderByComparator.getOrderByFields().length * 6));
1499 }
1500 else {
1501 query = new StringBundler(3);
1502 }
1503
1504 query.append(_SQL_SELECT_EXPANDOVALUE_WHERE);
1505
1506 query.append(_FINDER_COLUMN_ROWID_ROWID_2);
1507
1508 if (orderByComparator != null) {
1509 String[] orderByFields = orderByComparator.getOrderByFields();
1510
1511 if (orderByFields.length > 0) {
1512 query.append(WHERE_AND);
1513 }
1514
1515 for (int i = 0; i < orderByFields.length; i++) {
1516 query.append(_ORDER_BY_ENTITY_ALIAS);
1517 query.append(orderByFields[i]);
1518
1519 if ((i + 1) < orderByFields.length) {
1520 if (orderByComparator.isAscending() ^ previous) {
1521 query.append(WHERE_GREATER_THAN_HAS_NEXT);
1522 }
1523 else {
1524 query.append(WHERE_LESSER_THAN_HAS_NEXT);
1525 }
1526 }
1527 else {
1528 if (orderByComparator.isAscending() ^ previous) {
1529 query.append(WHERE_GREATER_THAN);
1530 }
1531 else {
1532 query.append(WHERE_LESSER_THAN);
1533 }
1534 }
1535 }
1536
1537 query.append(ORDER_BY_CLAUSE);
1538
1539 for (int i = 0; i < orderByFields.length; i++) {
1540 query.append(_ORDER_BY_ENTITY_ALIAS);
1541 query.append(orderByFields[i]);
1542
1543 if ((i + 1) < orderByFields.length) {
1544 if (orderByComparator.isAscending() ^ previous) {
1545 query.append(ORDER_BY_ASC_HAS_NEXT);
1546 }
1547 else {
1548 query.append(ORDER_BY_DESC_HAS_NEXT);
1549 }
1550 }
1551 else {
1552 if (orderByComparator.isAscending() ^ previous) {
1553 query.append(ORDER_BY_ASC);
1554 }
1555 else {
1556 query.append(ORDER_BY_DESC);
1557 }
1558 }
1559 }
1560 }
1561
1562 else {
1563 query.append(ExpandoValueModelImpl.ORDER_BY_JPQL);
1564 }
1565
1566 String sql = query.toString();
1567
1568 Query q = session.createQuery(sql);
1569
1570 q.setFirstResult(0);
1571 q.setMaxResults(2);
1572
1573 QueryPos qPos = QueryPos.getInstance(q);
1574
1575 qPos.add(rowId);
1576
1577 if (orderByComparator != null) {
1578 Object[] values = orderByComparator.getOrderByValues(expandoValue);
1579
1580 for (Object value : values) {
1581 qPos.add(value);
1582 }
1583 }
1584
1585 List<ExpandoValue> list = q.list();
1586
1587 if (list.size() == 2) {
1588 return list.get(1);
1589 }
1590 else {
1591 return null;
1592 }
1593 }
1594
1595
1603 public List<ExpandoValue> findByT_C(long tableId, long columnId)
1604 throws SystemException {
1605 return findByT_C(tableId, columnId, QueryUtil.ALL_POS,
1606 QueryUtil.ALL_POS, null);
1607 }
1608
1609
1623 public List<ExpandoValue> findByT_C(long tableId, long columnId, int start,
1624 int end) throws SystemException {
1625 return findByT_C(tableId, columnId, start, end, null);
1626 }
1627
1628
1643 public List<ExpandoValue> findByT_C(long tableId, long columnId, int start,
1644 int end, OrderByComparator orderByComparator) throws SystemException {
1645 Object[] finderArgs = new Object[] {
1646 tableId, columnId,
1647
1648 String.valueOf(start), String.valueOf(end),
1649 String.valueOf(orderByComparator)
1650 };
1651
1652 List<ExpandoValue> list = (List<ExpandoValue>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_T_C,
1653 finderArgs, this);
1654
1655 if (list == null) {
1656 StringBundler query = null;
1657
1658 if (orderByComparator != null) {
1659 query = new StringBundler(4 +
1660 (orderByComparator.getOrderByFields().length * 3));
1661 }
1662 else {
1663 query = new StringBundler(4);
1664 }
1665
1666 query.append(_SQL_SELECT_EXPANDOVALUE_WHERE);
1667
1668 query.append(_FINDER_COLUMN_T_C_TABLEID_2);
1669
1670 query.append(_FINDER_COLUMN_T_C_COLUMNID_2);
1671
1672 if (orderByComparator != null) {
1673 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
1674 orderByComparator);
1675 }
1676
1677 else {
1678 query.append(ExpandoValueModelImpl.ORDER_BY_JPQL);
1679 }
1680
1681 String sql = query.toString();
1682
1683 Session session = null;
1684
1685 try {
1686 session = openSession();
1687
1688 Query q = session.createQuery(sql);
1689
1690 QueryPos qPos = QueryPos.getInstance(q);
1691
1692 qPos.add(tableId);
1693
1694 qPos.add(columnId);
1695
1696 list = (List<ExpandoValue>)QueryUtil.list(q, getDialect(),
1697 start, end);
1698 }
1699 catch (Exception e) {
1700 throw processException(e);
1701 }
1702 finally {
1703 if (list == null) {
1704 FinderCacheUtil.removeResult(FINDER_PATH_FIND_BY_T_C,
1705 finderArgs);
1706 }
1707 else {
1708 cacheResult(list);
1709
1710 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_T_C,
1711 finderArgs, list);
1712 }
1713
1714 closeSession(session);
1715 }
1716 }
1717
1718 return list;
1719 }
1720
1721
1735 public ExpandoValue findByT_C_First(long tableId, long columnId,
1736 OrderByComparator orderByComparator)
1737 throws NoSuchValueException, SystemException {
1738 List<ExpandoValue> list = findByT_C(tableId, columnId, 0, 1,
1739 orderByComparator);
1740
1741 if (list.isEmpty()) {
1742 StringBundler msg = new StringBundler(6);
1743
1744 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1745
1746 msg.append("tableId=");
1747 msg.append(tableId);
1748
1749 msg.append(", columnId=");
1750 msg.append(columnId);
1751
1752 msg.append(StringPool.CLOSE_CURLY_BRACE);
1753
1754 throw new NoSuchValueException(msg.toString());
1755 }
1756 else {
1757 return list.get(0);
1758 }
1759 }
1760
1761
1775 public ExpandoValue findByT_C_Last(long tableId, long columnId,
1776 OrderByComparator orderByComparator)
1777 throws NoSuchValueException, SystemException {
1778 int count = countByT_C(tableId, columnId);
1779
1780 List<ExpandoValue> list = findByT_C(tableId, columnId, count - 1,
1781 count, orderByComparator);
1782
1783 if (list.isEmpty()) {
1784 StringBundler msg = new StringBundler(6);
1785
1786 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1787
1788 msg.append("tableId=");
1789 msg.append(tableId);
1790
1791 msg.append(", columnId=");
1792 msg.append(columnId);
1793
1794 msg.append(StringPool.CLOSE_CURLY_BRACE);
1795
1796 throw new NoSuchValueException(msg.toString());
1797 }
1798 else {
1799 return list.get(0);
1800 }
1801 }
1802
1803
1818 public ExpandoValue[] findByT_C_PrevAndNext(long valueId, long tableId,
1819 long columnId, OrderByComparator orderByComparator)
1820 throws NoSuchValueException, SystemException {
1821 ExpandoValue expandoValue = findByPrimaryKey(valueId);
1822
1823 Session session = null;
1824
1825 try {
1826 session = openSession();
1827
1828 ExpandoValue[] array = new ExpandoValueImpl[3];
1829
1830 array[0] = getByT_C_PrevAndNext(session, expandoValue, tableId,
1831 columnId, orderByComparator, true);
1832
1833 array[1] = expandoValue;
1834
1835 array[2] = getByT_C_PrevAndNext(session, expandoValue, tableId,
1836 columnId, orderByComparator, false);
1837
1838 return array;
1839 }
1840 catch (Exception e) {
1841 throw processException(e);
1842 }
1843 finally {
1844 closeSession(session);
1845 }
1846 }
1847
1848 protected ExpandoValue getByT_C_PrevAndNext(Session session,
1849 ExpandoValue expandoValue, long tableId, long columnId,
1850 OrderByComparator orderByComparator, boolean previous) {
1851 StringBundler query = null;
1852
1853 if (orderByComparator != null) {
1854 query = new StringBundler(6 +
1855 (orderByComparator.getOrderByFields().length * 6));
1856 }
1857 else {
1858 query = new StringBundler(3);
1859 }
1860
1861 query.append(_SQL_SELECT_EXPANDOVALUE_WHERE);
1862
1863 query.append(_FINDER_COLUMN_T_C_TABLEID_2);
1864
1865 query.append(_FINDER_COLUMN_T_C_COLUMNID_2);
1866
1867 if (orderByComparator != null) {
1868 String[] orderByFields = orderByComparator.getOrderByFields();
1869
1870 if (orderByFields.length > 0) {
1871 query.append(WHERE_AND);
1872 }
1873
1874 for (int i = 0; i < orderByFields.length; i++) {
1875 query.append(_ORDER_BY_ENTITY_ALIAS);
1876 query.append(orderByFields[i]);
1877
1878 if ((i + 1) < orderByFields.length) {
1879 if (orderByComparator.isAscending() ^ previous) {
1880 query.append(WHERE_GREATER_THAN_HAS_NEXT);
1881 }
1882 else {
1883 query.append(WHERE_LESSER_THAN_HAS_NEXT);
1884 }
1885 }
1886 else {
1887 if (orderByComparator.isAscending() ^ previous) {
1888 query.append(WHERE_GREATER_THAN);
1889 }
1890 else {
1891 query.append(WHERE_LESSER_THAN);
1892 }
1893 }
1894 }
1895
1896 query.append(ORDER_BY_CLAUSE);
1897
1898 for (int i = 0; i < orderByFields.length; i++) {
1899 query.append(_ORDER_BY_ENTITY_ALIAS);
1900 query.append(orderByFields[i]);
1901
1902 if ((i + 1) < orderByFields.length) {
1903 if (orderByComparator.isAscending() ^ previous) {
1904 query.append(ORDER_BY_ASC_HAS_NEXT);
1905 }
1906 else {
1907 query.append(ORDER_BY_DESC_HAS_NEXT);
1908 }
1909 }
1910 else {
1911 if (orderByComparator.isAscending() ^ previous) {
1912 query.append(ORDER_BY_ASC);
1913 }
1914 else {
1915 query.append(ORDER_BY_DESC);
1916 }
1917 }
1918 }
1919 }
1920
1921 else {
1922 query.append(ExpandoValueModelImpl.ORDER_BY_JPQL);
1923 }
1924
1925 String sql = query.toString();
1926
1927 Query q = session.createQuery(sql);
1928
1929 q.setFirstResult(0);
1930 q.setMaxResults(2);
1931
1932 QueryPos qPos = QueryPos.getInstance(q);
1933
1934 qPos.add(tableId);
1935
1936 qPos.add(columnId);
1937
1938 if (orderByComparator != null) {
1939 Object[] values = orderByComparator.getOrderByValues(expandoValue);
1940
1941 for (Object value : values) {
1942 qPos.add(value);
1943 }
1944 }
1945
1946 List<ExpandoValue> list = q.list();
1947
1948 if (list.size() == 2) {
1949 return list.get(1);
1950 }
1951 else {
1952 return null;
1953 }
1954 }
1955
1956
1964 public List<ExpandoValue> findByT_CPK(long tableId, long classPK)
1965 throws SystemException {
1966 return findByT_CPK(tableId, classPK, QueryUtil.ALL_POS,
1967 QueryUtil.ALL_POS, null);
1968 }
1969
1970
1984 public List<ExpandoValue> findByT_CPK(long tableId, long classPK,
1985 int start, int end) throws SystemException {
1986 return findByT_CPK(tableId, classPK, start, end, null);
1987 }
1988
1989
2004 public List<ExpandoValue> findByT_CPK(long tableId, long classPK,
2005 int start, int end, OrderByComparator orderByComparator)
2006 throws SystemException {
2007 Object[] finderArgs = new Object[] {
2008 tableId, classPK,
2009
2010 String.valueOf(start), String.valueOf(end),
2011 String.valueOf(orderByComparator)
2012 };
2013
2014 List<ExpandoValue> list = (List<ExpandoValue>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_T_CPK,
2015 finderArgs, this);
2016
2017 if (list == null) {
2018 StringBundler query = null;
2019
2020 if (orderByComparator != null) {
2021 query = new StringBundler(4 +
2022 (orderByComparator.getOrderByFields().length * 3));
2023 }
2024 else {
2025 query = new StringBundler(4);
2026 }
2027
2028 query.append(_SQL_SELECT_EXPANDOVALUE_WHERE);
2029
2030 query.append(_FINDER_COLUMN_T_CPK_TABLEID_2);
2031
2032 query.append(_FINDER_COLUMN_T_CPK_CLASSPK_2);
2033
2034 if (orderByComparator != null) {
2035 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
2036 orderByComparator);
2037 }
2038
2039 else {
2040 query.append(ExpandoValueModelImpl.ORDER_BY_JPQL);
2041 }
2042
2043 String sql = query.toString();
2044
2045 Session session = null;
2046
2047 try {
2048 session = openSession();
2049
2050 Query q = session.createQuery(sql);
2051
2052 QueryPos qPos = QueryPos.getInstance(q);
2053
2054 qPos.add(tableId);
2055
2056 qPos.add(classPK);
2057
2058 list = (List<ExpandoValue>)QueryUtil.list(q, getDialect(),
2059 start, end);
2060 }
2061 catch (Exception e) {
2062 throw processException(e);
2063 }
2064 finally {
2065 if (list == null) {
2066 FinderCacheUtil.removeResult(FINDER_PATH_FIND_BY_T_CPK,
2067 finderArgs);
2068 }
2069 else {
2070 cacheResult(list);
2071
2072 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_T_CPK,
2073 finderArgs, list);
2074 }
2075
2076 closeSession(session);
2077 }
2078 }
2079
2080 return list;
2081 }
2082
2083
2097 public ExpandoValue findByT_CPK_First(long tableId, long classPK,
2098 OrderByComparator orderByComparator)
2099 throws NoSuchValueException, SystemException {
2100 List<ExpandoValue> list = findByT_CPK(tableId, classPK, 0, 1,
2101 orderByComparator);
2102
2103 if (list.isEmpty()) {
2104 StringBundler msg = new StringBundler(6);
2105
2106 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
2107
2108 msg.append("tableId=");
2109 msg.append(tableId);
2110
2111 msg.append(", classPK=");
2112 msg.append(classPK);
2113
2114 msg.append(StringPool.CLOSE_CURLY_BRACE);
2115
2116 throw new NoSuchValueException(msg.toString());
2117 }
2118 else {
2119 return list.get(0);
2120 }
2121 }
2122
2123
2137 public ExpandoValue findByT_CPK_Last(long tableId, long classPK,
2138 OrderByComparator orderByComparator)
2139 throws NoSuchValueException, SystemException {
2140 int count = countByT_CPK(tableId, classPK);
2141
2142 List<ExpandoValue> list = findByT_CPK(tableId, classPK, count - 1,
2143 count, orderByComparator);
2144
2145 if (list.isEmpty()) {
2146 StringBundler msg = new StringBundler(6);
2147
2148 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
2149
2150 msg.append("tableId=");
2151 msg.append(tableId);
2152
2153 msg.append(", classPK=");
2154 msg.append(classPK);
2155
2156 msg.append(StringPool.CLOSE_CURLY_BRACE);
2157
2158 throw new NoSuchValueException(msg.toString());
2159 }
2160 else {
2161 return list.get(0);
2162 }
2163 }
2164
2165
2180 public ExpandoValue[] findByT_CPK_PrevAndNext(long valueId, long tableId,
2181 long classPK, OrderByComparator orderByComparator)
2182 throws NoSuchValueException, SystemException {
2183 ExpandoValue expandoValue = findByPrimaryKey(valueId);
2184
2185 Session session = null;
2186
2187 try {
2188 session = openSession();
2189
2190 ExpandoValue[] array = new ExpandoValueImpl[3];
2191
2192 array[0] = getByT_CPK_PrevAndNext(session, expandoValue, tableId,
2193 classPK, orderByComparator, true);
2194
2195 array[1] = expandoValue;
2196
2197 array[2] = getByT_CPK_PrevAndNext(session, expandoValue, tableId,
2198 classPK, orderByComparator, false);
2199
2200 return array;
2201 }
2202 catch (Exception e) {
2203 throw processException(e);
2204 }
2205 finally {
2206 closeSession(session);
2207 }
2208 }
2209
2210 protected ExpandoValue getByT_CPK_PrevAndNext(Session session,
2211 ExpandoValue expandoValue, long tableId, long classPK,
2212 OrderByComparator orderByComparator, boolean previous) {
2213 StringBundler query = null;
2214
2215 if (orderByComparator != null) {
2216 query = new StringBundler(6 +
2217 (orderByComparator.getOrderByFields().length * 6));
2218 }
2219 else {
2220 query = new StringBundler(3);
2221 }
2222
2223 query.append(_SQL_SELECT_EXPANDOVALUE_WHERE);
2224
2225 query.append(_FINDER_COLUMN_T_CPK_TABLEID_2);
2226
2227 query.append(_FINDER_COLUMN_T_CPK_CLASSPK_2);
2228
2229 if (orderByComparator != null) {
2230 String[] orderByFields = orderByComparator.getOrderByFields();
2231
2232 if (orderByFields.length > 0) {
2233 query.append(WHERE_AND);
2234 }
2235
2236 for (int i = 0; i < orderByFields.length; i++) {
2237 query.append(_ORDER_BY_ENTITY_ALIAS);
2238 query.append(orderByFields[i]);
2239
2240 if ((i + 1) < orderByFields.length) {
2241 if (orderByComparator.isAscending() ^ previous) {
2242 query.append(WHERE_GREATER_THAN_HAS_NEXT);
2243 }
2244 else {
2245 query.append(WHERE_LESSER_THAN_HAS_NEXT);
2246 }
2247 }
2248 else {
2249 if (orderByComparator.isAscending() ^ previous) {
2250 query.append(WHERE_GREATER_THAN);
2251 }
2252 else {
2253 query.append(WHERE_LESSER_THAN);
2254 }
2255 }
2256 }
2257
2258 query.append(ORDER_BY_CLAUSE);
2259
2260 for (int i = 0; i < orderByFields.length; i++) {
2261 query.append(_ORDER_BY_ENTITY_ALIAS);
2262 query.append(orderByFields[i]);
2263
2264 if ((i + 1) < orderByFields.length) {
2265 if (orderByComparator.isAscending() ^ previous) {
2266 query.append(ORDER_BY_ASC_HAS_NEXT);
2267 }
2268 else {
2269 query.append(ORDER_BY_DESC_HAS_NEXT);
2270 }
2271 }
2272 else {
2273 if (orderByComparator.isAscending() ^ previous) {
2274 query.append(ORDER_BY_ASC);
2275 }
2276 else {
2277 query.append(ORDER_BY_DESC);
2278 }
2279 }
2280 }
2281 }
2282
2283 else {
2284 query.append(ExpandoValueModelImpl.ORDER_BY_JPQL);
2285 }
2286
2287 String sql = query.toString();
2288
2289 Query q = session.createQuery(sql);
2290
2291 q.setFirstResult(0);
2292 q.setMaxResults(2);
2293
2294 QueryPos qPos = QueryPos.getInstance(q);
2295
2296 qPos.add(tableId);
2297
2298 qPos.add(classPK);
2299
2300 if (orderByComparator != null) {
2301 Object[] values = orderByComparator.getOrderByValues(expandoValue);
2302
2303 for (Object value : values) {
2304 qPos.add(value);
2305 }
2306 }
2307
2308 List<ExpandoValue> list = q.list();
2309
2310 if (list.size() == 2) {
2311 return list.get(1);
2312 }
2313 else {
2314 return null;
2315 }
2316 }
2317
2318
2326 public List<ExpandoValue> findByT_R(long tableId, long rowId)
2327 throws SystemException {
2328 return findByT_R(tableId, rowId, QueryUtil.ALL_POS, QueryUtil.ALL_POS,
2329 null);
2330 }
2331
2332
2346 public List<ExpandoValue> findByT_R(long tableId, long rowId, int start,
2347 int end) throws SystemException {
2348 return findByT_R(tableId, rowId, start, end, null);
2349 }
2350
2351
2366 public List<ExpandoValue> findByT_R(long tableId, long rowId, int start,
2367 int end, OrderByComparator orderByComparator) throws SystemException {
2368 Object[] finderArgs = new Object[] {
2369 tableId, rowId,
2370
2371 String.valueOf(start), String.valueOf(end),
2372 String.valueOf(orderByComparator)
2373 };
2374
2375 List<ExpandoValue> list = (List<ExpandoValue>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_T_R,
2376 finderArgs, this);
2377
2378 if (list == null) {
2379 StringBundler query = null;
2380
2381 if (orderByComparator != null) {
2382 query = new StringBundler(4 +
2383 (orderByComparator.getOrderByFields().length * 3));
2384 }
2385 else {
2386 query = new StringBundler(4);
2387 }
2388
2389 query.append(_SQL_SELECT_EXPANDOVALUE_WHERE);
2390
2391 query.append(_FINDER_COLUMN_T_R_TABLEID_2);
2392
2393 query.append(_FINDER_COLUMN_T_R_ROWID_2);
2394
2395 if (orderByComparator != null) {
2396 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
2397 orderByComparator);
2398 }
2399
2400 else {
2401 query.append(ExpandoValueModelImpl.ORDER_BY_JPQL);
2402 }
2403
2404 String sql = query.toString();
2405
2406 Session session = null;
2407
2408 try {
2409 session = openSession();
2410
2411 Query q = session.createQuery(sql);
2412
2413 QueryPos qPos = QueryPos.getInstance(q);
2414
2415 qPos.add(tableId);
2416
2417 qPos.add(rowId);
2418
2419 list = (List<ExpandoValue>)QueryUtil.list(q, getDialect(),
2420 start, end);
2421 }
2422 catch (Exception e) {
2423 throw processException(e);
2424 }
2425 finally {
2426 if (list == null) {
2427 FinderCacheUtil.removeResult(FINDER_PATH_FIND_BY_T_R,
2428 finderArgs);
2429 }
2430 else {
2431 cacheResult(list);
2432
2433 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_T_R,
2434 finderArgs, list);
2435 }
2436
2437 closeSession(session);
2438 }
2439 }
2440
2441 return list;
2442 }
2443
2444
2458 public ExpandoValue findByT_R_First(long tableId, long rowId,
2459 OrderByComparator orderByComparator)
2460 throws NoSuchValueException, SystemException {
2461 List<ExpandoValue> list = findByT_R(tableId, rowId, 0, 1,
2462 orderByComparator);
2463
2464 if (list.isEmpty()) {
2465 StringBundler msg = new StringBundler(6);
2466
2467 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
2468
2469 msg.append("tableId=");
2470 msg.append(tableId);
2471
2472 msg.append(", rowId=");
2473 msg.append(rowId);
2474
2475 msg.append(StringPool.CLOSE_CURLY_BRACE);
2476
2477 throw new NoSuchValueException(msg.toString());
2478 }
2479 else {
2480 return list.get(0);
2481 }
2482 }
2483
2484
2498 public ExpandoValue findByT_R_Last(long tableId, long rowId,
2499 OrderByComparator orderByComparator)
2500 throws NoSuchValueException, SystemException {
2501 int count = countByT_R(tableId, rowId);
2502
2503 List<ExpandoValue> list = findByT_R(tableId, rowId, count - 1, count,
2504 orderByComparator);
2505
2506 if (list.isEmpty()) {
2507 StringBundler msg = new StringBundler(6);
2508
2509 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
2510
2511 msg.append("tableId=");
2512 msg.append(tableId);
2513
2514 msg.append(", rowId=");
2515 msg.append(rowId);
2516
2517 msg.append(StringPool.CLOSE_CURLY_BRACE);
2518
2519 throw new NoSuchValueException(msg.toString());
2520 }
2521 else {
2522 return list.get(0);
2523 }
2524 }
2525
2526
2541 public ExpandoValue[] findByT_R_PrevAndNext(long valueId, long tableId,
2542 long rowId, OrderByComparator orderByComparator)
2543 throws NoSuchValueException, SystemException {
2544 ExpandoValue expandoValue = findByPrimaryKey(valueId);
2545
2546 Session session = null;
2547
2548 try {
2549 session = openSession();
2550
2551 ExpandoValue[] array = new ExpandoValueImpl[3];
2552
2553 array[0] = getByT_R_PrevAndNext(session, expandoValue, tableId,
2554 rowId, orderByComparator, true);
2555
2556 array[1] = expandoValue;
2557
2558 array[2] = getByT_R_PrevAndNext(session, expandoValue, tableId,
2559 rowId, orderByComparator, false);
2560
2561 return array;
2562 }
2563 catch (Exception e) {
2564 throw processException(e);
2565 }
2566 finally {
2567 closeSession(session);
2568 }
2569 }
2570
2571 protected ExpandoValue getByT_R_PrevAndNext(Session session,
2572 ExpandoValue expandoValue, long tableId, long rowId,
2573 OrderByComparator orderByComparator, boolean previous) {
2574 StringBundler query = null;
2575
2576 if (orderByComparator != null) {
2577 query = new StringBundler(6 +
2578 (orderByComparator.getOrderByFields().length * 6));
2579 }
2580 else {
2581 query = new StringBundler(3);
2582 }
2583
2584 query.append(_SQL_SELECT_EXPANDOVALUE_WHERE);
2585
2586 query.append(_FINDER_COLUMN_T_R_TABLEID_2);
2587
2588 query.append(_FINDER_COLUMN_T_R_ROWID_2);
2589
2590 if (orderByComparator != null) {
2591 String[] orderByFields = orderByComparator.getOrderByFields();
2592
2593 if (orderByFields.length > 0) {
2594 query.append(WHERE_AND);
2595 }
2596
2597 for (int i = 0; i < orderByFields.length; i++) {
2598 query.append(_ORDER_BY_ENTITY_ALIAS);
2599 query.append(orderByFields[i]);
2600
2601 if ((i + 1) < orderByFields.length) {
2602 if (orderByComparator.isAscending() ^ previous) {
2603 query.append(WHERE_GREATER_THAN_HAS_NEXT);
2604 }
2605 else {
2606 query.append(WHERE_LESSER_THAN_HAS_NEXT);
2607 }
2608 }
2609 else {
2610 if (orderByComparator.isAscending() ^ previous) {
2611 query.append(WHERE_GREATER_THAN);
2612 }
2613 else {
2614 query.append(WHERE_LESSER_THAN);
2615 }
2616 }
2617 }
2618
2619 query.append(ORDER_BY_CLAUSE);
2620
2621 for (int i = 0; i < orderByFields.length; i++) {
2622 query.append(_ORDER_BY_ENTITY_ALIAS);
2623 query.append(orderByFields[i]);
2624
2625 if ((i + 1) < orderByFields.length) {
2626 if (orderByComparator.isAscending() ^ previous) {
2627 query.append(ORDER_BY_ASC_HAS_NEXT);
2628 }
2629 else {
2630 query.append(ORDER_BY_DESC_HAS_NEXT);
2631 }
2632 }
2633 else {
2634 if (orderByComparator.isAscending() ^ previous) {
2635 query.append(ORDER_BY_ASC);
2636 }
2637 else {
2638 query.append(ORDER_BY_DESC);
2639 }
2640 }
2641 }
2642 }
2643
2644 else {
2645 query.append(ExpandoValueModelImpl.ORDER_BY_JPQL);
2646 }
2647
2648 String sql = query.toString();
2649
2650 Query q = session.createQuery(sql);
2651
2652 q.setFirstResult(0);
2653 q.setMaxResults(2);
2654
2655 QueryPos qPos = QueryPos.getInstance(q);
2656
2657 qPos.add(tableId);
2658
2659 qPos.add(rowId);
2660
2661 if (orderByComparator != null) {
2662 Object[] values = orderByComparator.getOrderByValues(expandoValue);
2663
2664 for (Object value : values) {
2665 qPos.add(value);
2666 }
2667 }
2668
2669 List<ExpandoValue> list = q.list();
2670
2671 if (list.size() == 2) {
2672 return list.get(1);
2673 }
2674 else {
2675 return null;
2676 }
2677 }
2678
2679
2688 public ExpandoValue findByC_R(long columnId, long rowId)
2689 throws NoSuchValueException, SystemException {
2690 ExpandoValue expandoValue = fetchByC_R(columnId, rowId);
2691
2692 if (expandoValue == null) {
2693 StringBundler msg = new StringBundler(6);
2694
2695 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
2696
2697 msg.append("columnId=");
2698 msg.append(columnId);
2699
2700 msg.append(", rowId=");
2701 msg.append(rowId);
2702
2703 msg.append(StringPool.CLOSE_CURLY_BRACE);
2704
2705 if (_log.isWarnEnabled()) {
2706 _log.warn(msg.toString());
2707 }
2708
2709 throw new NoSuchValueException(msg.toString());
2710 }
2711
2712 return expandoValue;
2713 }
2714
2715
2723 public ExpandoValue fetchByC_R(long columnId, long rowId)
2724 throws SystemException {
2725 return fetchByC_R(columnId, rowId, true);
2726 }
2727
2728
2736 public ExpandoValue fetchByC_R(long columnId, long rowId,
2737 boolean retrieveFromCache) throws SystemException {
2738 Object[] finderArgs = new Object[] { columnId, rowId };
2739
2740 Object result = null;
2741
2742 if (retrieveFromCache) {
2743 result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_C_R,
2744 finderArgs, this);
2745 }
2746
2747 if (result == null) {
2748 StringBundler query = new StringBundler(4);
2749
2750 query.append(_SQL_SELECT_EXPANDOVALUE_WHERE);
2751
2752 query.append(_FINDER_COLUMN_C_R_COLUMNID_2);
2753
2754 query.append(_FINDER_COLUMN_C_R_ROWID_2);
2755
2756 query.append(ExpandoValueModelImpl.ORDER_BY_JPQL);
2757
2758 String sql = query.toString();
2759
2760 Session session = null;
2761
2762 try {
2763 session = openSession();
2764
2765 Query q = session.createQuery(sql);
2766
2767 QueryPos qPos = QueryPos.getInstance(q);
2768
2769 qPos.add(columnId);
2770
2771 qPos.add(rowId);
2772
2773 List<ExpandoValue> list = q.list();
2774
2775 result = list;
2776
2777 ExpandoValue expandoValue = null;
2778
2779 if (list.isEmpty()) {
2780 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_R,
2781 finderArgs, list);
2782 }
2783 else {
2784 expandoValue = list.get(0);
2785
2786 cacheResult(expandoValue);
2787
2788 if ((expandoValue.getColumnId() != columnId) ||
2789 (expandoValue.getRowId() != rowId)) {
2790 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_R,
2791 finderArgs, expandoValue);
2792 }
2793 }
2794
2795 return expandoValue;
2796 }
2797 catch (Exception e) {
2798 throw processException(e);
2799 }
2800 finally {
2801 if (result == null) {
2802 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_C_R,
2803 finderArgs);
2804 }
2805
2806 closeSession(session);
2807 }
2808 }
2809 else {
2810 if (result instanceof List<?>) {
2811 return null;
2812 }
2813 else {
2814 return (ExpandoValue)result;
2815 }
2816 }
2817 }
2818
2819
2827 public List<ExpandoValue> findByC_C(long classNameId, long classPK)
2828 throws SystemException {
2829 return findByC_C(classNameId, classPK, QueryUtil.ALL_POS,
2830 QueryUtil.ALL_POS, null);
2831 }
2832
2833
2847 public List<ExpandoValue> findByC_C(long classNameId, long classPK,
2848 int start, int end) throws SystemException {
2849 return findByC_C(classNameId, classPK, start, end, null);
2850 }
2851
2852
2867 public List<ExpandoValue> findByC_C(long classNameId, long classPK,
2868 int start, int end, OrderByComparator orderByComparator)
2869 throws SystemException {
2870 Object[] finderArgs = new Object[] {
2871 classNameId, classPK,
2872
2873 String.valueOf(start), String.valueOf(end),
2874 String.valueOf(orderByComparator)
2875 };
2876
2877 List<ExpandoValue> list = (List<ExpandoValue>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_C_C,
2878 finderArgs, this);
2879
2880 if (list == null) {
2881 StringBundler query = null;
2882
2883 if (orderByComparator != null) {
2884 query = new StringBundler(4 +
2885 (orderByComparator.getOrderByFields().length * 3));
2886 }
2887 else {
2888 query = new StringBundler(4);
2889 }
2890
2891 query.append(_SQL_SELECT_EXPANDOVALUE_WHERE);
2892
2893 query.append(_FINDER_COLUMN_C_C_CLASSNAMEID_2);
2894
2895 query.append(_FINDER_COLUMN_C_C_CLASSPK_2);
2896
2897 if (orderByComparator != null) {
2898 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
2899 orderByComparator);
2900 }
2901
2902 else {
2903 query.append(ExpandoValueModelImpl.ORDER_BY_JPQL);
2904 }
2905
2906 String sql = query.toString();
2907
2908 Session session = null;
2909
2910 try {
2911 session = openSession();
2912
2913 Query q = session.createQuery(sql);
2914
2915 QueryPos qPos = QueryPos.getInstance(q);
2916
2917 qPos.add(classNameId);
2918
2919 qPos.add(classPK);
2920
2921 list = (List<ExpandoValue>)QueryUtil.list(q, getDialect(),
2922 start, end);
2923 }
2924 catch (Exception e) {
2925 throw processException(e);
2926 }
2927 finally {
2928 if (list == null) {
2929 FinderCacheUtil.removeResult(FINDER_PATH_FIND_BY_C_C,
2930 finderArgs);
2931 }
2932 else {
2933 cacheResult(list);
2934
2935 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_C_C,
2936 finderArgs, list);
2937 }
2938
2939 closeSession(session);
2940 }
2941 }
2942
2943 return list;
2944 }
2945
2946
2960 public ExpandoValue findByC_C_First(long classNameId, long classPK,
2961 OrderByComparator orderByComparator)
2962 throws NoSuchValueException, SystemException {
2963 List<ExpandoValue> list = findByC_C(classNameId, classPK, 0, 1,
2964 orderByComparator);
2965
2966 if (list.isEmpty()) {
2967 StringBundler msg = new StringBundler(6);
2968
2969 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
2970
2971 msg.append("classNameId=");
2972 msg.append(classNameId);
2973
2974 msg.append(", classPK=");
2975 msg.append(classPK);
2976
2977 msg.append(StringPool.CLOSE_CURLY_BRACE);
2978
2979 throw new NoSuchValueException(msg.toString());
2980 }
2981 else {
2982 return list.get(0);
2983 }
2984 }
2985
2986
3000 public ExpandoValue findByC_C_Last(long classNameId, long classPK,
3001 OrderByComparator orderByComparator)
3002 throws NoSuchValueException, SystemException {
3003 int count = countByC_C(classNameId, classPK);
3004
3005 List<ExpandoValue> list = findByC_C(classNameId, classPK, count - 1,
3006 count, orderByComparator);
3007
3008 if (list.isEmpty()) {
3009 StringBundler msg = new StringBundler(6);
3010
3011 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
3012
3013 msg.append("classNameId=");
3014 msg.append(classNameId);
3015
3016 msg.append(", classPK=");
3017 msg.append(classPK);
3018
3019 msg.append(StringPool.CLOSE_CURLY_BRACE);
3020
3021 throw new NoSuchValueException(msg.toString());
3022 }
3023 else {
3024 return list.get(0);
3025 }
3026 }
3027
3028
3043 public ExpandoValue[] findByC_C_PrevAndNext(long valueId, long classNameId,
3044 long classPK, OrderByComparator orderByComparator)
3045 throws NoSuchValueException, SystemException {
3046 ExpandoValue expandoValue = findByPrimaryKey(valueId);
3047
3048 Session session = null;
3049
3050 try {
3051 session = openSession();
3052
3053 ExpandoValue[] array = new ExpandoValueImpl[3];
3054
3055 array[0] = getByC_C_PrevAndNext(session, expandoValue, classNameId,
3056 classPK, orderByComparator, true);
3057
3058 array[1] = expandoValue;
3059
3060 array[2] = getByC_C_PrevAndNext(session, expandoValue, classNameId,
3061 classPK, orderByComparator, false);
3062
3063 return array;
3064 }
3065 catch (Exception e) {
3066 throw processException(e);
3067 }
3068 finally {
3069 closeSession(session);
3070 }
3071 }
3072
3073 protected ExpandoValue getByC_C_PrevAndNext(Session session,
3074 ExpandoValue expandoValue, long classNameId, long classPK,
3075 OrderByComparator orderByComparator, boolean previous) {
3076 StringBundler query = null;
3077
3078 if (orderByComparator != null) {
3079 query = new StringBundler(6 +
3080 (orderByComparator.getOrderByFields().length * 6));
3081 }
3082 else {
3083 query = new StringBundler(3);
3084 }
3085
3086 query.append(_SQL_SELECT_EXPANDOVALUE_WHERE);
3087
3088 query.append(_FINDER_COLUMN_C_C_CLASSNAMEID_2);
3089
3090 query.append(_FINDER_COLUMN_C_C_CLASSPK_2);
3091
3092 if (orderByComparator != null) {
3093 String[] orderByFields = orderByComparator.getOrderByFields();
3094
3095 if (orderByFields.length > 0) {
3096 query.append(WHERE_AND);
3097 }
3098
3099 for (int i = 0; i < orderByFields.length; i++) {
3100 query.append(_ORDER_BY_ENTITY_ALIAS);
3101 query.append(orderByFields[i]);
3102
3103 if ((i + 1) < orderByFields.length) {
3104 if (orderByComparator.isAscending() ^ previous) {
3105 query.append(WHERE_GREATER_THAN_HAS_NEXT);
3106 }
3107 else {
3108 query.append(WHERE_LESSER_THAN_HAS_NEXT);
3109 }
3110 }
3111 else {
3112 if (orderByComparator.isAscending() ^ previous) {
3113 query.append(WHERE_GREATER_THAN);
3114 }
3115 else {
3116 query.append(WHERE_LESSER_THAN);
3117 }
3118 }
3119 }
3120
3121 query.append(ORDER_BY_CLAUSE);
3122
3123 for (int i = 0; i < orderByFields.length; i++) {
3124 query.append(_ORDER_BY_ENTITY_ALIAS);
3125 query.append(orderByFields[i]);
3126
3127 if ((i + 1) < orderByFields.length) {
3128 if (orderByComparator.isAscending() ^ previous) {
3129 query.append(ORDER_BY_ASC_HAS_NEXT);
3130 }
3131 else {
3132 query.append(ORDER_BY_DESC_HAS_NEXT);
3133 }
3134 }
3135 else {
3136 if (orderByComparator.isAscending() ^ previous) {
3137 query.append(ORDER_BY_ASC);
3138 }
3139 else {
3140 query.append(ORDER_BY_DESC);
3141 }
3142 }
3143 }
3144 }
3145
3146 else {
3147 query.append(ExpandoValueModelImpl.ORDER_BY_JPQL);
3148 }
3149
3150 String sql = query.toString();
3151
3152 Query q = session.createQuery(sql);
3153
3154 q.setFirstResult(0);
3155 q.setMaxResults(2);
3156
3157 QueryPos qPos = QueryPos.getInstance(q);
3158
3159 qPos.add(classNameId);
3160
3161 qPos.add(classPK);
3162
3163 if (orderByComparator != null) {
3164 Object[] values = orderByComparator.getOrderByValues(expandoValue);
3165
3166 for (Object value : values) {
3167 qPos.add(value);
3168 }
3169 }
3170
3171 List<ExpandoValue> list = q.list();
3172
3173 if (list.size() == 2) {
3174 return list.get(1);
3175 }
3176 else {
3177 return null;
3178 }
3179 }
3180
3181
3191 public ExpandoValue findByT_C_C(long tableId, long columnId, long classPK)
3192 throws NoSuchValueException, SystemException {
3193 ExpandoValue expandoValue = fetchByT_C_C(tableId, columnId, classPK);
3194
3195 if (expandoValue == null) {
3196 StringBundler msg = new StringBundler(8);
3197
3198 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
3199
3200 msg.append("tableId=");
3201 msg.append(tableId);
3202
3203 msg.append(", columnId=");
3204 msg.append(columnId);
3205
3206 msg.append(", classPK=");
3207 msg.append(classPK);
3208
3209 msg.append(StringPool.CLOSE_CURLY_BRACE);
3210
3211 if (_log.isWarnEnabled()) {
3212 _log.warn(msg.toString());
3213 }
3214
3215 throw new NoSuchValueException(msg.toString());
3216 }
3217
3218 return expandoValue;
3219 }
3220
3221
3230 public ExpandoValue fetchByT_C_C(long tableId, long columnId, long classPK)
3231 throws SystemException {
3232 return fetchByT_C_C(tableId, columnId, classPK, true);
3233 }
3234
3235
3244 public ExpandoValue fetchByT_C_C(long tableId, long columnId, long classPK,
3245 boolean retrieveFromCache) throws SystemException {
3246 Object[] finderArgs = new Object[] { tableId, columnId, classPK };
3247
3248 Object result = null;
3249
3250 if (retrieveFromCache) {
3251 result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_T_C_C,
3252 finderArgs, this);
3253 }
3254
3255 if (result == null) {
3256 StringBundler query = new StringBundler(5);
3257
3258 query.append(_SQL_SELECT_EXPANDOVALUE_WHERE);
3259
3260 query.append(_FINDER_COLUMN_T_C_C_TABLEID_2);
3261
3262 query.append(_FINDER_COLUMN_T_C_C_COLUMNID_2);
3263
3264 query.append(_FINDER_COLUMN_T_C_C_CLASSPK_2);
3265
3266 query.append(ExpandoValueModelImpl.ORDER_BY_JPQL);
3267
3268 String sql = query.toString();
3269
3270 Session session = null;
3271
3272 try {
3273 session = openSession();
3274
3275 Query q = session.createQuery(sql);
3276
3277 QueryPos qPos = QueryPos.getInstance(q);
3278
3279 qPos.add(tableId);
3280
3281 qPos.add(columnId);
3282
3283 qPos.add(classPK);
3284
3285 List<ExpandoValue> list = q.list();
3286
3287 result = list;
3288
3289 ExpandoValue expandoValue = null;
3290
3291 if (list.isEmpty()) {
3292 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_T_C_C,
3293 finderArgs, list);
3294 }
3295 else {
3296 expandoValue = list.get(0);
3297
3298 cacheResult(expandoValue);
3299
3300 if ((expandoValue.getTableId() != tableId) ||
3301 (expandoValue.getColumnId() != columnId) ||
3302 (expandoValue.getClassPK() != classPK)) {
3303 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_T_C_C,
3304 finderArgs, expandoValue);
3305 }
3306 }
3307
3308 return expandoValue;
3309 }
3310 catch (Exception e) {
3311 throw processException(e);
3312 }
3313 finally {
3314 if (result == null) {
3315 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_T_C_C,
3316 finderArgs);
3317 }
3318
3319 closeSession(session);
3320 }
3321 }
3322 else {
3323 if (result instanceof List<?>) {
3324 return null;
3325 }
3326 else {
3327 return (ExpandoValue)result;
3328 }
3329 }
3330 }
3331
3332
3341 public List<ExpandoValue> findByT_C_D(long tableId, long columnId,
3342 String data) throws SystemException {
3343 return findByT_C_D(tableId, columnId, data, QueryUtil.ALL_POS,
3344 QueryUtil.ALL_POS, null);
3345 }
3346
3347
3362 public List<ExpandoValue> findByT_C_D(long tableId, long columnId,
3363 String data, int start, int end) throws SystemException {
3364 return findByT_C_D(tableId, columnId, data, start, end, null);
3365 }
3366
3367
3383 public List<ExpandoValue> findByT_C_D(long tableId, long columnId,
3384 String data, int start, int end, OrderByComparator orderByComparator)
3385 throws SystemException {
3386 Object[] finderArgs = new Object[] {
3387 tableId, columnId, data,
3388
3389 String.valueOf(start), String.valueOf(end),
3390 String.valueOf(orderByComparator)
3391 };
3392
3393 List<ExpandoValue> list = (List<ExpandoValue>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_T_C_D,
3394 finderArgs, this);
3395
3396 if (list == null) {
3397 StringBundler query = null;
3398
3399 if (orderByComparator != null) {
3400 query = new StringBundler(5 +
3401 (orderByComparator.getOrderByFields().length * 3));
3402 }
3403 else {
3404 query = new StringBundler(5);
3405 }
3406
3407 query.append(_SQL_SELECT_EXPANDOVALUE_WHERE);
3408
3409 query.append(_FINDER_COLUMN_T_C_D_TABLEID_2);
3410
3411 query.append(_FINDER_COLUMN_T_C_D_COLUMNID_2);
3412
3413 if (data == null) {
3414 query.append(_FINDER_COLUMN_T_C_D_DATA_1);
3415 }
3416 else {
3417 if (data.equals(StringPool.BLANK)) {
3418 query.append(_FINDER_COLUMN_T_C_D_DATA_3);
3419 }
3420 else {
3421 query.append(_FINDER_COLUMN_T_C_D_DATA_2);
3422 }
3423 }
3424
3425 if (orderByComparator != null) {
3426 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
3427 orderByComparator);
3428 }
3429
3430 else {
3431 query.append(ExpandoValueModelImpl.ORDER_BY_JPQL);
3432 }
3433
3434 String sql = query.toString();
3435
3436 Session session = null;
3437
3438 try {
3439 session = openSession();
3440
3441 Query q = session.createQuery(sql);
3442
3443 QueryPos qPos = QueryPos.getInstance(q);
3444
3445 qPos.add(tableId);
3446
3447 qPos.add(columnId);
3448
3449 if (data != null) {
3450 qPos.add(data);
3451 }
3452
3453 list = (List<ExpandoValue>)QueryUtil.list(q, getDialect(),
3454 start, end);
3455 }
3456 catch (Exception e) {
3457 throw processException(e);
3458 }
3459 finally {
3460 if (list == null) {
3461 FinderCacheUtil.removeResult(FINDER_PATH_FIND_BY_T_C_D,
3462 finderArgs);
3463 }
3464 else {
3465 cacheResult(list);
3466
3467 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_T_C_D,
3468 finderArgs, list);
3469 }
3470
3471 closeSession(session);
3472 }
3473 }
3474
3475 return list;
3476 }
3477
3478
3493 public ExpandoValue findByT_C_D_First(long tableId, long columnId,
3494 String data, OrderByComparator orderByComparator)
3495 throws NoSuchValueException, SystemException {
3496 List<ExpandoValue> list = findByT_C_D(tableId, columnId, data, 0, 1,
3497 orderByComparator);
3498
3499 if (list.isEmpty()) {
3500 StringBundler msg = new StringBundler(8);
3501
3502 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
3503
3504 msg.append("tableId=");
3505 msg.append(tableId);
3506
3507 msg.append(", columnId=");
3508 msg.append(columnId);
3509
3510 msg.append(", data=");
3511 msg.append(data);
3512
3513 msg.append(StringPool.CLOSE_CURLY_BRACE);
3514
3515 throw new NoSuchValueException(msg.toString());
3516 }
3517 else {
3518 return list.get(0);
3519 }
3520 }
3521
3522
3537 public ExpandoValue findByT_C_D_Last(long tableId, long columnId,
3538 String data, OrderByComparator orderByComparator)
3539 throws NoSuchValueException, SystemException {
3540 int count = countByT_C_D(tableId, columnId, data);
3541
3542 List<ExpandoValue> list = findByT_C_D(tableId, columnId, data,
3543 count - 1, count, orderByComparator);
3544
3545 if (list.isEmpty()) {
3546 StringBundler msg = new StringBundler(8);
3547
3548 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
3549
3550 msg.append("tableId=");
3551 msg.append(tableId);
3552
3553 msg.append(", columnId=");
3554 msg.append(columnId);
3555
3556 msg.append(", data=");
3557 msg.append(data);
3558
3559 msg.append(StringPool.CLOSE_CURLY_BRACE);
3560
3561 throw new NoSuchValueException(msg.toString());
3562 }
3563 else {
3564 return list.get(0);
3565 }
3566 }
3567
3568
3584 public ExpandoValue[] findByT_C_D_PrevAndNext(long valueId, long tableId,
3585 long columnId, String data, OrderByComparator orderByComparator)
3586 throws NoSuchValueException, SystemException {
3587 ExpandoValue expandoValue = findByPrimaryKey(valueId);
3588
3589 Session session = null;
3590
3591 try {
3592 session = openSession();
3593
3594 ExpandoValue[] array = new ExpandoValueImpl[3];
3595
3596 array[0] = getByT_C_D_PrevAndNext(session, expandoValue, tableId,
3597 columnId, data, orderByComparator, true);
3598
3599 array[1] = expandoValue;
3600
3601 array[2] = getByT_C_D_PrevAndNext(session, expandoValue, tableId,
3602 columnId, data, orderByComparator, false);
3603
3604 return array;
3605 }
3606 catch (Exception e) {
3607 throw processException(e);
3608 }
3609 finally {
3610 closeSession(session);
3611 }
3612 }
3613
3614 protected ExpandoValue getByT_C_D_PrevAndNext(Session session,
3615 ExpandoValue expandoValue, long tableId, long columnId, String data,
3616 OrderByComparator orderByComparator, boolean previous) {
3617 StringBundler query = null;
3618
3619 if (orderByComparator != null) {
3620 query = new StringBundler(6 +
3621 (orderByComparator.getOrderByFields().length * 6));
3622 }
3623 else {
3624 query = new StringBundler(3);
3625 }
3626
3627 query.append(_SQL_SELECT_EXPANDOVALUE_WHERE);
3628
3629 query.append(_FINDER_COLUMN_T_C_D_TABLEID_2);
3630
3631 query.append(_FINDER_COLUMN_T_C_D_COLUMNID_2);
3632
3633 if (data == null) {
3634 query.append(_FINDER_COLUMN_T_C_D_DATA_1);
3635 }
3636 else {
3637 if (data.equals(StringPool.BLANK)) {
3638 query.append(_FINDER_COLUMN_T_C_D_DATA_3);
3639 }
3640 else {
3641 query.append(_FINDER_COLUMN_T_C_D_DATA_2);
3642 }
3643 }
3644
3645 if (orderByComparator != null) {
3646 String[] orderByFields = orderByComparator.getOrderByFields();
3647
3648 if (orderByFields.length > 0) {
3649 query.append(WHERE_AND);
3650 }
3651
3652 for (int i = 0; i < orderByFields.length; i++) {
3653 query.append(_ORDER_BY_ENTITY_ALIAS);
3654 query.append(orderByFields[i]);
3655
3656 if ((i + 1) < orderByFields.length) {
3657 if (orderByComparator.isAscending() ^ previous) {
3658 query.append(WHERE_GREATER_THAN_HAS_NEXT);
3659 }
3660 else {
3661 query.append(WHERE_LESSER_THAN_HAS_NEXT);
3662 }
3663 }
3664 else {
3665 if (orderByComparator.isAscending() ^ previous) {
3666 query.append(WHERE_GREATER_THAN);
3667 }
3668 else {
3669 query.append(WHERE_LESSER_THAN);
3670 }
3671 }
3672 }
3673
3674 query.append(ORDER_BY_CLAUSE);
3675
3676 for (int i = 0; i < orderByFields.length; i++) {
3677 query.append(_ORDER_BY_ENTITY_ALIAS);
3678 query.append(orderByFields[i]);
3679
3680 if ((i + 1) < orderByFields.length) {
3681 if (orderByComparator.isAscending() ^ previous) {
3682 query.append(ORDER_BY_ASC_HAS_NEXT);
3683 }
3684 else {
3685 query.append(ORDER_BY_DESC_HAS_NEXT);
3686 }
3687 }
3688 else {
3689 if (orderByComparator.isAscending() ^ previous) {
3690 query.append(ORDER_BY_ASC);
3691 }
3692 else {
3693 query.append(ORDER_BY_DESC);
3694 }
3695 }
3696 }
3697 }
3698
3699 else {
3700 query.append(ExpandoValueModelImpl.ORDER_BY_JPQL);
3701 }
3702
3703 String sql = query.toString();
3704
3705 Query q = session.createQuery(sql);
3706
3707 q.setFirstResult(0);
3708 q.setMaxResults(2);
3709
3710 QueryPos qPos = QueryPos.getInstance(q);
3711
3712 qPos.add(tableId);
3713
3714 qPos.add(columnId);
3715
3716 if (data != null) {
3717 qPos.add(data);
3718 }
3719
3720 if (orderByComparator != null) {
3721 Object[] values = orderByComparator.getOrderByValues(expandoValue);
3722
3723 for (Object value : values) {
3724 qPos.add(value);
3725 }
3726 }
3727
3728 List<ExpandoValue> list = q.list();
3729
3730 if (list.size() == 2) {
3731 return list.get(1);
3732 }
3733 else {
3734 return null;
3735 }
3736 }
3737
3738
3744 public List<ExpandoValue> findAll() throws SystemException {
3745 return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
3746 }
3747
3748
3760 public List<ExpandoValue> findAll(int start, int end)
3761 throws SystemException {
3762 return findAll(start, end, null);
3763 }
3764
3765
3778 public List<ExpandoValue> findAll(int start, int end,
3779 OrderByComparator orderByComparator) throws SystemException {
3780 Object[] finderArgs = new Object[] {
3781 String.valueOf(start), String.valueOf(end),
3782 String.valueOf(orderByComparator)
3783 };
3784
3785 List<ExpandoValue> list = (List<ExpandoValue>)FinderCacheUtil.getResult(FINDER_PATH_FIND_ALL,
3786 finderArgs, this);
3787
3788 if (list == null) {
3789 StringBundler query = null;
3790 String sql = null;
3791
3792 if (orderByComparator != null) {
3793 query = new StringBundler(2 +
3794 (orderByComparator.getOrderByFields().length * 3));
3795
3796 query.append(_SQL_SELECT_EXPANDOVALUE);
3797
3798 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
3799 orderByComparator);
3800
3801 sql = query.toString();
3802 }
3803 else {
3804 sql = _SQL_SELECT_EXPANDOVALUE.concat(ExpandoValueModelImpl.ORDER_BY_JPQL);
3805 }
3806
3807 Session session = null;
3808
3809 try {
3810 session = openSession();
3811
3812 Query q = session.createQuery(sql);
3813
3814 if (orderByComparator == null) {
3815 list = (List<ExpandoValue>)QueryUtil.list(q, getDialect(),
3816 start, end, false);
3817
3818 Collections.sort(list);
3819 }
3820 else {
3821 list = (List<ExpandoValue>)QueryUtil.list(q, getDialect(),
3822 start, end);
3823 }
3824 }
3825 catch (Exception e) {
3826 throw processException(e);
3827 }
3828 finally {
3829 if (list == null) {
3830 FinderCacheUtil.removeResult(FINDER_PATH_FIND_ALL,
3831 finderArgs);
3832 }
3833 else {
3834 cacheResult(list);
3835
3836 FinderCacheUtil.putResult(FINDER_PATH_FIND_ALL, finderArgs,
3837 list);
3838 }
3839
3840 closeSession(session);
3841 }
3842 }
3843
3844 return list;
3845 }
3846
3847
3853 public void removeByTableId(long tableId) throws SystemException {
3854 for (ExpandoValue expandoValue : findByTableId(tableId)) {
3855 remove(expandoValue);
3856 }
3857 }
3858
3859
3865 public void removeByColumnId(long columnId) throws SystemException {
3866 for (ExpandoValue expandoValue : findByColumnId(columnId)) {
3867 remove(expandoValue);
3868 }
3869 }
3870
3871
3877 public void removeByRowId(long rowId) throws SystemException {
3878 for (ExpandoValue expandoValue : findByRowId(rowId)) {
3879 remove(expandoValue);
3880 }
3881 }
3882
3883
3890 public void removeByT_C(long tableId, long columnId)
3891 throws SystemException {
3892 for (ExpandoValue expandoValue : findByT_C(tableId, columnId)) {
3893 remove(expandoValue);
3894 }
3895 }
3896
3897
3904 public void removeByT_CPK(long tableId, long classPK)
3905 throws SystemException {
3906 for (ExpandoValue expandoValue : findByT_CPK(tableId, classPK)) {
3907 remove(expandoValue);
3908 }
3909 }
3910
3911
3918 public void removeByT_R(long tableId, long rowId) throws SystemException {
3919 for (ExpandoValue expandoValue : findByT_R(tableId, rowId)) {
3920 remove(expandoValue);
3921 }
3922 }
3923
3924
3931 public void removeByC_R(long columnId, long rowId)
3932 throws NoSuchValueException, SystemException {
3933 ExpandoValue expandoValue = findByC_R(columnId, rowId);
3934
3935 remove(expandoValue);
3936 }
3937
3938
3945 public void removeByC_C(long classNameId, long classPK)
3946 throws SystemException {
3947 for (ExpandoValue expandoValue : findByC_C(classNameId, classPK)) {
3948 remove(expandoValue);
3949 }
3950 }
3951
3952
3960 public void removeByT_C_C(long tableId, long columnId, long classPK)
3961 throws NoSuchValueException, SystemException {
3962 ExpandoValue expandoValue = findByT_C_C(tableId, columnId, classPK);
3963
3964 remove(expandoValue);
3965 }
3966
3967
3975 public void removeByT_C_D(long tableId, long columnId, String data)
3976 throws SystemException {
3977 for (ExpandoValue expandoValue : findByT_C_D(tableId, columnId, data)) {
3978 remove(expandoValue);
3979 }
3980 }
3981
3982
3987 public void removeAll() throws SystemException {
3988 for (ExpandoValue expandoValue : findAll()) {
3989 remove(expandoValue);
3990 }
3991 }
3992
3993
4000 public int countByTableId(long tableId) throws SystemException {
4001 Object[] finderArgs = new Object[] { tableId };
4002
4003 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_TABLEID,
4004 finderArgs, this);
4005
4006 if (count == null) {
4007 StringBundler query = new StringBundler(2);
4008
4009 query.append(_SQL_COUNT_EXPANDOVALUE_WHERE);
4010
4011 query.append(_FINDER_COLUMN_TABLEID_TABLEID_2);
4012
4013 String sql = query.toString();
4014
4015 Session session = null;
4016
4017 try {
4018 session = openSession();
4019
4020 Query q = session.createQuery(sql);
4021
4022 QueryPos qPos = QueryPos.getInstance(q);
4023
4024 qPos.add(tableId);
4025
4026 count = (Long)q.uniqueResult();
4027 }
4028 catch (Exception e) {
4029 throw processException(e);
4030 }
4031 finally {
4032 if (count == null) {
4033 count = Long.valueOf(0);
4034 }
4035
4036 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_TABLEID,
4037 finderArgs, count);
4038
4039 closeSession(session);
4040 }
4041 }
4042
4043 return count.intValue();
4044 }
4045
4046
4053 public int countByColumnId(long columnId) throws SystemException {
4054 Object[] finderArgs = new Object[] { columnId };
4055
4056 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_COLUMNID,
4057 finderArgs, this);
4058
4059 if (count == null) {
4060 StringBundler query = new StringBundler(2);
4061
4062 query.append(_SQL_COUNT_EXPANDOVALUE_WHERE);
4063
4064 query.append(_FINDER_COLUMN_COLUMNID_COLUMNID_2);
4065
4066 String sql = query.toString();
4067
4068 Session session = null;
4069
4070 try {
4071 session = openSession();
4072
4073 Query q = session.createQuery(sql);
4074
4075 QueryPos qPos = QueryPos.getInstance(q);
4076
4077 qPos.add(columnId);
4078
4079 count = (Long)q.uniqueResult();
4080 }
4081 catch (Exception e) {
4082 throw processException(e);
4083 }
4084 finally {
4085 if (count == null) {
4086 count = Long.valueOf(0);
4087 }
4088
4089 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_COLUMNID,
4090 finderArgs, count);
4091
4092 closeSession(session);
4093 }
4094 }
4095
4096 return count.intValue();
4097 }
4098
4099
4106 public int countByRowId(long rowId) throws SystemException {
4107 Object[] finderArgs = new Object[] { rowId };
4108
4109 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_ROWID,
4110 finderArgs, this);
4111
4112 if (count == null) {
4113 StringBundler query = new StringBundler(2);
4114
4115 query.append(_SQL_COUNT_EXPANDOVALUE_WHERE);
4116
4117 query.append(_FINDER_COLUMN_ROWID_ROWID_2);
4118
4119 String sql = query.toString();
4120
4121 Session session = null;
4122
4123 try {
4124 session = openSession();
4125
4126 Query q = session.createQuery(sql);
4127
4128 QueryPos qPos = QueryPos.getInstance(q);
4129
4130 qPos.add(rowId);
4131
4132 count = (Long)q.uniqueResult();
4133 }
4134 catch (Exception e) {
4135 throw processException(e);
4136 }
4137 finally {
4138 if (count == null) {
4139 count = Long.valueOf(0);
4140 }
4141
4142 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_ROWID,
4143 finderArgs, count);
4144
4145 closeSession(session);
4146 }
4147 }
4148
4149 return count.intValue();
4150 }
4151
4152
4160 public int countByT_C(long tableId, long columnId)
4161 throws SystemException {
4162 Object[] finderArgs = new Object[] { tableId, columnId };
4163
4164 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_T_C,
4165 finderArgs, this);
4166
4167 if (count == null) {
4168 StringBundler query = new StringBundler(3);
4169
4170 query.append(_SQL_COUNT_EXPANDOVALUE_WHERE);
4171
4172 query.append(_FINDER_COLUMN_T_C_TABLEID_2);
4173
4174 query.append(_FINDER_COLUMN_T_C_COLUMNID_2);
4175
4176 String sql = query.toString();
4177
4178 Session session = null;
4179
4180 try {
4181 session = openSession();
4182
4183 Query q = session.createQuery(sql);
4184
4185 QueryPos qPos = QueryPos.getInstance(q);
4186
4187 qPos.add(tableId);
4188
4189 qPos.add(columnId);
4190
4191 count = (Long)q.uniqueResult();
4192 }
4193 catch (Exception e) {
4194 throw processException(e);
4195 }
4196 finally {
4197 if (count == null) {
4198 count = Long.valueOf(0);
4199 }
4200
4201 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_T_C, finderArgs,
4202 count);
4203
4204 closeSession(session);
4205 }
4206 }
4207
4208 return count.intValue();
4209 }
4210
4211
4219 public int countByT_CPK(long tableId, long classPK)
4220 throws SystemException {
4221 Object[] finderArgs = new Object[] { tableId, classPK };
4222
4223 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_T_CPK,
4224 finderArgs, this);
4225
4226 if (count == null) {
4227 StringBundler query = new StringBundler(3);
4228
4229 query.append(_SQL_COUNT_EXPANDOVALUE_WHERE);
4230
4231 query.append(_FINDER_COLUMN_T_CPK_TABLEID_2);
4232
4233 query.append(_FINDER_COLUMN_T_CPK_CLASSPK_2);
4234
4235 String sql = query.toString();
4236
4237 Session session = null;
4238
4239 try {
4240 session = openSession();
4241
4242 Query q = session.createQuery(sql);
4243
4244 QueryPos qPos = QueryPos.getInstance(q);
4245
4246 qPos.add(tableId);
4247
4248 qPos.add(classPK);
4249
4250 count = (Long)q.uniqueResult();
4251 }
4252 catch (Exception e) {
4253 throw processException(e);
4254 }
4255 finally {
4256 if (count == null) {
4257 count = Long.valueOf(0);
4258 }
4259
4260 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_T_CPK,
4261 finderArgs, count);
4262
4263 closeSession(session);
4264 }
4265 }
4266
4267 return count.intValue();
4268 }
4269
4270
4278 public int countByT_R(long tableId, long rowId) throws SystemException {
4279 Object[] finderArgs = new Object[] { tableId, rowId };
4280
4281 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_T_R,
4282 finderArgs, this);
4283
4284 if (count == null) {
4285 StringBundler query = new StringBundler(3);
4286
4287 query.append(_SQL_COUNT_EXPANDOVALUE_WHERE);
4288
4289 query.append(_FINDER_COLUMN_T_R_TABLEID_2);
4290
4291 query.append(_FINDER_COLUMN_T_R_ROWID_2);
4292
4293 String sql = query.toString();
4294
4295 Session session = null;
4296
4297 try {
4298 session = openSession();
4299
4300 Query q = session.createQuery(sql);
4301
4302 QueryPos qPos = QueryPos.getInstance(q);
4303
4304 qPos.add(tableId);
4305
4306 qPos.add(rowId);
4307
4308 count = (Long)q.uniqueResult();
4309 }
4310 catch (Exception e) {
4311 throw processException(e);
4312 }
4313 finally {
4314 if (count == null) {
4315 count = Long.valueOf(0);
4316 }
4317
4318 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_T_R, finderArgs,
4319 count);
4320
4321 closeSession(session);
4322 }
4323 }
4324
4325 return count.intValue();
4326 }
4327
4328
4336 public int countByC_R(long columnId, long rowId) throws SystemException {
4337 Object[] finderArgs = new Object[] { columnId, rowId };
4338
4339 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_C_R,
4340 finderArgs, this);
4341
4342 if (count == null) {
4343 StringBundler query = new StringBundler(3);
4344
4345 query.append(_SQL_COUNT_EXPANDOVALUE_WHERE);
4346
4347 query.append(_FINDER_COLUMN_C_R_COLUMNID_2);
4348
4349 query.append(_FINDER_COLUMN_C_R_ROWID_2);
4350
4351 String sql = query.toString();
4352
4353 Session session = null;
4354
4355 try {
4356 session = openSession();
4357
4358 Query q = session.createQuery(sql);
4359
4360 QueryPos qPos = QueryPos.getInstance(q);
4361
4362 qPos.add(columnId);
4363
4364 qPos.add(rowId);
4365
4366 count = (Long)q.uniqueResult();
4367 }
4368 catch (Exception e) {
4369 throw processException(e);
4370 }
4371 finally {
4372 if (count == null) {
4373 count = Long.valueOf(0);
4374 }
4375
4376 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_C_R, finderArgs,
4377 count);
4378
4379 closeSession(session);
4380 }
4381 }
4382
4383 return count.intValue();
4384 }
4385
4386
4394 public int countByC_C(long classNameId, long classPK)
4395 throws SystemException {
4396 Object[] finderArgs = new Object[] { classNameId, classPK };
4397
4398 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_C_C,
4399 finderArgs, this);
4400
4401 if (count == null) {
4402 StringBundler query = new StringBundler(3);
4403
4404 query.append(_SQL_COUNT_EXPANDOVALUE_WHERE);
4405
4406 query.append(_FINDER_COLUMN_C_C_CLASSNAMEID_2);
4407
4408 query.append(_FINDER_COLUMN_C_C_CLASSPK_2);
4409
4410 String sql = query.toString();
4411
4412 Session session = null;
4413
4414 try {
4415 session = openSession();
4416
4417 Query q = session.createQuery(sql);
4418
4419 QueryPos qPos = QueryPos.getInstance(q);
4420
4421 qPos.add(classNameId);
4422
4423 qPos.add(classPK);
4424
4425 count = (Long)q.uniqueResult();
4426 }
4427 catch (Exception e) {
4428 throw processException(e);
4429 }
4430 finally {
4431 if (count == null) {
4432 count = Long.valueOf(0);
4433 }
4434
4435 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_C_C, finderArgs,
4436 count);
4437
4438 closeSession(session);
4439 }
4440 }
4441
4442 return count.intValue();
4443 }
4444
4445
4454 public int countByT_C_C(long tableId, long columnId, long classPK)
4455 throws SystemException {
4456 Object[] finderArgs = new Object[] { tableId, columnId, classPK };
4457
4458 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_T_C_C,
4459 finderArgs, this);
4460
4461 if (count == null) {
4462 StringBundler query = new StringBundler(4);
4463
4464 query.append(_SQL_COUNT_EXPANDOVALUE_WHERE);
4465
4466 query.append(_FINDER_COLUMN_T_C_C_TABLEID_2);
4467
4468 query.append(_FINDER_COLUMN_T_C_C_COLUMNID_2);
4469
4470 query.append(_FINDER_COLUMN_T_C_C_CLASSPK_2);
4471
4472 String sql = query.toString();
4473
4474 Session session = null;
4475
4476 try {
4477 session = openSession();
4478
4479 Query q = session.createQuery(sql);
4480
4481 QueryPos qPos = QueryPos.getInstance(q);
4482
4483 qPos.add(tableId);
4484
4485 qPos.add(columnId);
4486
4487 qPos.add(classPK);
4488
4489 count = (Long)q.uniqueResult();
4490 }
4491 catch (Exception e) {
4492 throw processException(e);
4493 }
4494 finally {
4495 if (count == null) {
4496 count = Long.valueOf(0);
4497 }
4498
4499 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_T_C_C,
4500 finderArgs, count);
4501
4502 closeSession(session);
4503 }
4504 }
4505
4506 return count.intValue();
4507 }
4508
4509
4518 public int countByT_C_D(long tableId, long columnId, String data)
4519 throws SystemException {
4520 Object[] finderArgs = new Object[] { tableId, columnId, data };
4521
4522 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_T_C_D,
4523 finderArgs, this);
4524
4525 if (count == null) {
4526 StringBundler query = new StringBundler(4);
4527
4528 query.append(_SQL_COUNT_EXPANDOVALUE_WHERE);
4529
4530 query.append(_FINDER_COLUMN_T_C_D_TABLEID_2);
4531
4532 query.append(_FINDER_COLUMN_T_C_D_COLUMNID_2);
4533
4534 if (data == null) {
4535 query.append(_FINDER_COLUMN_T_C_D_DATA_1);
4536 }
4537 else {
4538 if (data.equals(StringPool.BLANK)) {
4539 query.append(_FINDER_COLUMN_T_C_D_DATA_3);
4540 }
4541 else {
4542 query.append(_FINDER_COLUMN_T_C_D_DATA_2);
4543 }
4544 }
4545
4546 String sql = query.toString();
4547
4548 Session session = null;
4549
4550 try {
4551 session = openSession();
4552
4553 Query q = session.createQuery(sql);
4554
4555 QueryPos qPos = QueryPos.getInstance(q);
4556
4557 qPos.add(tableId);
4558
4559 qPos.add(columnId);
4560
4561 if (data != null) {
4562 qPos.add(data);
4563 }
4564
4565 count = (Long)q.uniqueResult();
4566 }
4567 catch (Exception e) {
4568 throw processException(e);
4569 }
4570 finally {
4571 if (count == null) {
4572 count = Long.valueOf(0);
4573 }
4574
4575 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_T_C_D,
4576 finderArgs, count);
4577
4578 closeSession(session);
4579 }
4580 }
4581
4582 return count.intValue();
4583 }
4584
4585
4591 public int countAll() throws SystemException {
4592 Object[] finderArgs = new Object[0];
4593
4594 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
4595 finderArgs, this);
4596
4597 if (count == null) {
4598 Session session = null;
4599
4600 try {
4601 session = openSession();
4602
4603 Query q = session.createQuery(_SQL_COUNT_EXPANDOVALUE);
4604
4605 count = (Long)q.uniqueResult();
4606 }
4607 catch (Exception e) {
4608 throw processException(e);
4609 }
4610 finally {
4611 if (count == null) {
4612 count = Long.valueOf(0);
4613 }
4614
4615 FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL, finderArgs,
4616 count);
4617
4618 closeSession(session);
4619 }
4620 }
4621
4622 return count.intValue();
4623 }
4624
4625
4628 public void afterPropertiesSet() {
4629 String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
4630 com.liferay.portal.util.PropsUtil.get(
4631 "value.object.listener.com.liferay.portlet.expando.model.ExpandoValue")));
4632
4633 if (listenerClassNames.length > 0) {
4634 try {
4635 List<ModelListener<ExpandoValue>> listenersList = new ArrayList<ModelListener<ExpandoValue>>();
4636
4637 for (String listenerClassName : listenerClassNames) {
4638 listenersList.add((ModelListener<ExpandoValue>)InstanceFactory.newInstance(
4639 listenerClassName));
4640 }
4641
4642 listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
4643 }
4644 catch (Exception e) {
4645 _log.error(e);
4646 }
4647 }
4648 }
4649
4650 public void destroy() {
4651 EntityCacheUtil.removeCache(ExpandoValueImpl.class.getName());
4652 FinderCacheUtil.removeCache(FINDER_CLASS_NAME_ENTITY);
4653 FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST);
4654 }
4655
4656 @BeanReference(type = ExpandoColumnPersistence.class)
4657 protected ExpandoColumnPersistence expandoColumnPersistence;
4658 @BeanReference(type = ExpandoRowPersistence.class)
4659 protected ExpandoRowPersistence expandoRowPersistence;
4660 @BeanReference(type = ExpandoTablePersistence.class)
4661 protected ExpandoTablePersistence expandoTablePersistence;
4662 @BeanReference(type = ExpandoValuePersistence.class)
4663 protected ExpandoValuePersistence expandoValuePersistence;
4664 @BeanReference(type = ResourcePersistence.class)
4665 protected ResourcePersistence resourcePersistence;
4666 @BeanReference(type = UserPersistence.class)
4667 protected UserPersistence userPersistence;
4668 private static final String _SQL_SELECT_EXPANDOVALUE = "SELECT expandoValue FROM ExpandoValue expandoValue";
4669 private static final String _SQL_SELECT_EXPANDOVALUE_WHERE = "SELECT expandoValue FROM ExpandoValue expandoValue WHERE ";
4670 private static final String _SQL_COUNT_EXPANDOVALUE = "SELECT COUNT(expandoValue) FROM ExpandoValue expandoValue";
4671 private static final String _SQL_COUNT_EXPANDOVALUE_WHERE = "SELECT COUNT(expandoValue) FROM ExpandoValue expandoValue WHERE ";
4672 private static final String _FINDER_COLUMN_TABLEID_TABLEID_2 = "expandoValue.tableId = ?";
4673 private static final String _FINDER_COLUMN_COLUMNID_COLUMNID_2 = "expandoValue.columnId = ?";
4674 private static final String _FINDER_COLUMN_ROWID_ROWID_2 = "expandoValue.rowId = ?";
4675 private static final String _FINDER_COLUMN_T_C_TABLEID_2 = "expandoValue.tableId = ? AND ";
4676 private static final String _FINDER_COLUMN_T_C_COLUMNID_2 = "expandoValue.columnId = ?";
4677 private static final String _FINDER_COLUMN_T_CPK_TABLEID_2 = "expandoValue.tableId = ? AND ";
4678 private static final String _FINDER_COLUMN_T_CPK_CLASSPK_2 = "expandoValue.classPK = ?";
4679 private static final String _FINDER_COLUMN_T_R_TABLEID_2 = "expandoValue.tableId = ? AND ";
4680 private static final String _FINDER_COLUMN_T_R_ROWID_2 = "expandoValue.rowId = ?";
4681 private static final String _FINDER_COLUMN_C_R_COLUMNID_2 = "expandoValue.columnId = ? AND ";
4682 private static final String _FINDER_COLUMN_C_R_ROWID_2 = "expandoValue.rowId = ?";
4683 private static final String _FINDER_COLUMN_C_C_CLASSNAMEID_2 = "expandoValue.classNameId = ? AND ";
4684 private static final String _FINDER_COLUMN_C_C_CLASSPK_2 = "expandoValue.classPK = ?";
4685 private static final String _FINDER_COLUMN_T_C_C_TABLEID_2 = "expandoValue.tableId = ? AND ";
4686 private static final String _FINDER_COLUMN_T_C_C_COLUMNID_2 = "expandoValue.columnId = ? AND ";
4687 private static final String _FINDER_COLUMN_T_C_C_CLASSPK_2 = "expandoValue.classPK = ?";
4688 private static final String _FINDER_COLUMN_T_C_D_TABLEID_2 = "expandoValue.tableId = ? AND ";
4689 private static final String _FINDER_COLUMN_T_C_D_COLUMNID_2 = "expandoValue.columnId = ? AND ";
4690 private static final String _FINDER_COLUMN_T_C_D_DATA_1 = "expandoValue.data IS NULL";
4691 private static final String _FINDER_COLUMN_T_C_D_DATA_2 = "expandoValue.data = ?";
4692 private static final String _FINDER_COLUMN_T_C_D_DATA_3 = "(expandoValue.data IS NULL OR expandoValue.data = ?)";
4693 private static final String _ORDER_BY_ENTITY_ALIAS = "expandoValue.";
4694 private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No ExpandoValue exists with the primary key ";
4695 private static final String _NO_SUCH_ENTITY_WITH_KEY = "No ExpandoValue exists with the key {";
4696 private static Log _log = LogFactoryUtil.getLog(ExpandoValuePersistenceImpl.class);
4697 }