001
014
015 package com.liferay.portlet.asset.service.persistence;
016
017 import com.liferay.portal.NoSuchModelException;
018 import com.liferay.portal.kernel.bean.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.CacheModel;
037 import com.liferay.portal.model.ModelListener;
038 import com.liferay.portal.service.persistence.BatchSessionUtil;
039 import com.liferay.portal.service.persistence.ResourcePersistence;
040 import com.liferay.portal.service.persistence.UserPersistence;
041 import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
042
043 import com.liferay.portlet.asset.NoSuchCategoryPropertyException;
044 import com.liferay.portlet.asset.model.AssetCategoryProperty;
045 import com.liferay.portlet.asset.model.impl.AssetCategoryPropertyImpl;
046 import com.liferay.portlet.asset.model.impl.AssetCategoryPropertyModelImpl;
047
048 import java.io.Serializable;
049
050 import java.util.ArrayList;
051 import java.util.Collections;
052 import java.util.List;
053
054
066 public class AssetCategoryPropertyPersistenceImpl extends BasePersistenceImpl<AssetCategoryProperty>
067 implements AssetCategoryPropertyPersistence {
068
073 public static final String FINDER_CLASS_NAME_ENTITY = AssetCategoryPropertyImpl.class.getName();
074 public static final String FINDER_CLASS_NAME_LIST_WITH_PAGINATION = FINDER_CLASS_NAME_ENTITY +
075 ".List1";
076 public static final String FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION = FINDER_CLASS_NAME_ENTITY +
077 ".List2";
078 public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_BY_COMPANYID =
079 new FinderPath(AssetCategoryPropertyModelImpl.ENTITY_CACHE_ENABLED,
080 AssetCategoryPropertyModelImpl.FINDER_CACHE_ENABLED,
081 AssetCategoryPropertyImpl.class,
082 FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findByCompanyId",
083 new String[] {
084 Long.class.getName(),
085
086 "java.lang.Integer", "java.lang.Integer",
087 "com.liferay.portal.kernel.util.OrderByComparator"
088 });
089 public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_COMPANYID =
090 new FinderPath(AssetCategoryPropertyModelImpl.ENTITY_CACHE_ENABLED,
091 AssetCategoryPropertyModelImpl.FINDER_CACHE_ENABLED,
092 AssetCategoryPropertyImpl.class,
093 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findByCompanyId",
094 new String[] { Long.class.getName() },
095 AssetCategoryPropertyModelImpl.COMPANYID_COLUMN_BITMASK);
096 public static final FinderPath FINDER_PATH_COUNT_BY_COMPANYID = new FinderPath(AssetCategoryPropertyModelImpl.ENTITY_CACHE_ENABLED,
097 AssetCategoryPropertyModelImpl.FINDER_CACHE_ENABLED, Long.class,
098 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByCompanyId",
099 new String[] { Long.class.getName() });
100 public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_BY_CATEGORYID =
101 new FinderPath(AssetCategoryPropertyModelImpl.ENTITY_CACHE_ENABLED,
102 AssetCategoryPropertyModelImpl.FINDER_CACHE_ENABLED,
103 AssetCategoryPropertyImpl.class,
104 FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findByCategoryId",
105 new String[] {
106 Long.class.getName(),
107
108 "java.lang.Integer", "java.lang.Integer",
109 "com.liferay.portal.kernel.util.OrderByComparator"
110 });
111 public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_CATEGORYID =
112 new FinderPath(AssetCategoryPropertyModelImpl.ENTITY_CACHE_ENABLED,
113 AssetCategoryPropertyModelImpl.FINDER_CACHE_ENABLED,
114 AssetCategoryPropertyImpl.class,
115 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findByCategoryId",
116 new String[] { Long.class.getName() },
117 AssetCategoryPropertyModelImpl.CATEGORYID_COLUMN_BITMASK);
118 public static final FinderPath FINDER_PATH_COUNT_BY_CATEGORYID = new FinderPath(AssetCategoryPropertyModelImpl.ENTITY_CACHE_ENABLED,
119 AssetCategoryPropertyModelImpl.FINDER_CACHE_ENABLED, Long.class,
120 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByCategoryId",
121 new String[] { Long.class.getName() });
122 public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_BY_C_K = new FinderPath(AssetCategoryPropertyModelImpl.ENTITY_CACHE_ENABLED,
123 AssetCategoryPropertyModelImpl.FINDER_CACHE_ENABLED,
124 AssetCategoryPropertyImpl.class,
125 FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findByC_K",
126 new String[] {
127 Long.class.getName(), String.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_WITHOUT_PAGINATION_FIND_BY_C_K = new FinderPath(AssetCategoryPropertyModelImpl.ENTITY_CACHE_ENABLED,
133 AssetCategoryPropertyModelImpl.FINDER_CACHE_ENABLED,
134 AssetCategoryPropertyImpl.class,
135 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findByC_K",
136 new String[] { Long.class.getName(), String.class.getName() },
137 AssetCategoryPropertyModelImpl.COMPANYID_COLUMN_BITMASK |
138 AssetCategoryPropertyModelImpl.KEY_COLUMN_BITMASK);
139 public static final FinderPath FINDER_PATH_COUNT_BY_C_K = new FinderPath(AssetCategoryPropertyModelImpl.ENTITY_CACHE_ENABLED,
140 AssetCategoryPropertyModelImpl.FINDER_CACHE_ENABLED, Long.class,
141 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByC_K",
142 new String[] { Long.class.getName(), String.class.getName() });
143 public static final FinderPath FINDER_PATH_FETCH_BY_CA_K = new FinderPath(AssetCategoryPropertyModelImpl.ENTITY_CACHE_ENABLED,
144 AssetCategoryPropertyModelImpl.FINDER_CACHE_ENABLED,
145 AssetCategoryPropertyImpl.class, FINDER_CLASS_NAME_ENTITY,
146 "fetchByCA_K",
147 new String[] { Long.class.getName(), String.class.getName() },
148 AssetCategoryPropertyModelImpl.CATEGORYID_COLUMN_BITMASK |
149 AssetCategoryPropertyModelImpl.KEY_COLUMN_BITMASK);
150 public static final FinderPath FINDER_PATH_COUNT_BY_CA_K = new FinderPath(AssetCategoryPropertyModelImpl.ENTITY_CACHE_ENABLED,
151 AssetCategoryPropertyModelImpl.FINDER_CACHE_ENABLED, Long.class,
152 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByCA_K",
153 new String[] { Long.class.getName(), String.class.getName() });
154 public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_ALL = new FinderPath(AssetCategoryPropertyModelImpl.ENTITY_CACHE_ENABLED,
155 AssetCategoryPropertyModelImpl.FINDER_CACHE_ENABLED,
156 AssetCategoryPropertyImpl.class,
157 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findAll", new String[0]);
158 public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL = new FinderPath(AssetCategoryPropertyModelImpl.ENTITY_CACHE_ENABLED,
159 AssetCategoryPropertyModelImpl.FINDER_CACHE_ENABLED,
160 AssetCategoryPropertyImpl.class,
161 FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findAll", new String[0]);
162 public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(AssetCategoryPropertyModelImpl.ENTITY_CACHE_ENABLED,
163 AssetCategoryPropertyModelImpl.FINDER_CACHE_ENABLED, Long.class,
164 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countAll", new String[0]);
165
166
171 public void cacheResult(AssetCategoryProperty assetCategoryProperty) {
172 EntityCacheUtil.putResult(AssetCategoryPropertyModelImpl.ENTITY_CACHE_ENABLED,
173 AssetCategoryPropertyImpl.class,
174 assetCategoryProperty.getPrimaryKey(), assetCategoryProperty);
175
176 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_CA_K,
177 new Object[] {
178 Long.valueOf(assetCategoryProperty.getCategoryId()),
179
180 assetCategoryProperty.getKey()
181 }, assetCategoryProperty);
182
183 assetCategoryProperty.resetOriginalValues();
184 }
185
186
191 public void cacheResult(List<AssetCategoryProperty> assetCategoryProperties) {
192 for (AssetCategoryProperty assetCategoryProperty : assetCategoryProperties) {
193 if (EntityCacheUtil.getResult(
194 AssetCategoryPropertyModelImpl.ENTITY_CACHE_ENABLED,
195 AssetCategoryPropertyImpl.class,
196 assetCategoryProperty.getPrimaryKey()) == null) {
197 cacheResult(assetCategoryProperty);
198 }
199 else {
200 assetCategoryProperty.resetOriginalValues();
201 }
202 }
203 }
204
205
212 @Override
213 public void clearCache() {
214 if (_HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE) {
215 CacheRegistryUtil.clear(AssetCategoryPropertyImpl.class.getName());
216 }
217
218 EntityCacheUtil.clearCache(AssetCategoryPropertyImpl.class.getName());
219
220 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
221 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
222 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
223 }
224
225
232 @Override
233 public void clearCache(AssetCategoryProperty assetCategoryProperty) {
234 EntityCacheUtil.removeResult(AssetCategoryPropertyModelImpl.ENTITY_CACHE_ENABLED,
235 AssetCategoryPropertyImpl.class,
236 assetCategoryProperty.getPrimaryKey());
237
238 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
239 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
240
241 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_CA_K,
242 new Object[] {
243 Long.valueOf(assetCategoryProperty.getCategoryId()),
244
245 assetCategoryProperty.getKey()
246 });
247 }
248
249
255 public AssetCategoryProperty create(long categoryPropertyId) {
256 AssetCategoryProperty assetCategoryProperty = new AssetCategoryPropertyImpl();
257
258 assetCategoryProperty.setNew(true);
259 assetCategoryProperty.setPrimaryKey(categoryPropertyId);
260
261 return assetCategoryProperty;
262 }
263
264
272 @Override
273 public AssetCategoryProperty remove(Serializable primaryKey)
274 throws NoSuchModelException, SystemException {
275 return remove(((Long)primaryKey).longValue());
276 }
277
278
286 public AssetCategoryProperty remove(long categoryPropertyId)
287 throws NoSuchCategoryPropertyException, SystemException {
288 Session session = null;
289
290 try {
291 session = openSession();
292
293 AssetCategoryProperty assetCategoryProperty = (AssetCategoryProperty)session.get(AssetCategoryPropertyImpl.class,
294 Long.valueOf(categoryPropertyId));
295
296 if (assetCategoryProperty == null) {
297 if (_log.isWarnEnabled()) {
298 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
299 categoryPropertyId);
300 }
301
302 throw new NoSuchCategoryPropertyException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
303 categoryPropertyId);
304 }
305
306 return assetCategoryPropertyPersistence.remove(assetCategoryProperty);
307 }
308 catch (NoSuchCategoryPropertyException nsee) {
309 throw nsee;
310 }
311 catch (Exception e) {
312 throw processException(e);
313 }
314 finally {
315 closeSession(session);
316 }
317 }
318
319
326 @Override
327 public AssetCategoryProperty remove(
328 AssetCategoryProperty assetCategoryProperty) throws SystemException {
329 return super.remove(assetCategoryProperty);
330 }
331
332 @Override
333 protected AssetCategoryProperty removeImpl(
334 AssetCategoryProperty assetCategoryProperty) throws SystemException {
335 assetCategoryProperty = toUnwrappedModel(assetCategoryProperty);
336
337 Session session = null;
338
339 try {
340 session = openSession();
341
342 BatchSessionUtil.delete(session, assetCategoryProperty);
343 }
344 catch (Exception e) {
345 throw processException(e);
346 }
347 finally {
348 closeSession(session);
349 }
350
351 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
352 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
353
354 AssetCategoryPropertyModelImpl assetCategoryPropertyModelImpl = (AssetCategoryPropertyModelImpl)assetCategoryProperty;
355
356 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_CA_K,
357 new Object[] {
358 Long.valueOf(assetCategoryPropertyModelImpl.getCategoryId()),
359
360 assetCategoryPropertyModelImpl.getKey()
361 });
362
363 EntityCacheUtil.removeResult(AssetCategoryPropertyModelImpl.ENTITY_CACHE_ENABLED,
364 AssetCategoryPropertyImpl.class,
365 assetCategoryProperty.getPrimaryKey());
366
367 return assetCategoryProperty;
368 }
369
370 @Override
371 public AssetCategoryProperty updateImpl(
372 com.liferay.portlet.asset.model.AssetCategoryProperty assetCategoryProperty,
373 boolean merge) throws SystemException {
374 assetCategoryProperty = toUnwrappedModel(assetCategoryProperty);
375
376 boolean isNew = assetCategoryProperty.isNew();
377
378 AssetCategoryPropertyModelImpl assetCategoryPropertyModelImpl = (AssetCategoryPropertyModelImpl)assetCategoryProperty;
379
380 Session session = null;
381
382 try {
383 session = openSession();
384
385 BatchSessionUtil.update(session, assetCategoryProperty, merge);
386
387 assetCategoryProperty.setNew(false);
388 }
389 catch (Exception e) {
390 throw processException(e);
391 }
392 finally {
393 closeSession(session);
394 }
395
396 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
397
398 if (isNew || !AssetCategoryPropertyModelImpl.COLUMN_BITMASK_ENABLED) {
399 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
400 }
401
402 else {
403 if ((assetCategoryPropertyModelImpl.getColumnBitmask() &
404 FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_COMPANYID.getColumnBitmask()) != 0) {
405 Object[] args = new Object[] {
406 Long.valueOf(assetCategoryPropertyModelImpl.getOriginalCompanyId())
407 };
408
409 FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_COMPANYID,
410 args);
411 FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_COMPANYID,
412 args);
413
414 args = new Object[] {
415 Long.valueOf(assetCategoryPropertyModelImpl.getCompanyId())
416 };
417
418 FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_COMPANYID,
419 args);
420 FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_COMPANYID,
421 args);
422 }
423
424 if ((assetCategoryPropertyModelImpl.getColumnBitmask() &
425 FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_CATEGORYID.getColumnBitmask()) != 0) {
426 Object[] args = new Object[] {
427 Long.valueOf(assetCategoryPropertyModelImpl.getOriginalCategoryId())
428 };
429
430 FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_CATEGORYID,
431 args);
432 FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_CATEGORYID,
433 args);
434
435 args = new Object[] {
436 Long.valueOf(assetCategoryPropertyModelImpl.getCategoryId())
437 };
438
439 FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_CATEGORYID,
440 args);
441 FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_CATEGORYID,
442 args);
443 }
444
445 if ((assetCategoryPropertyModelImpl.getColumnBitmask() &
446 FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_C_K.getColumnBitmask()) != 0) {
447 Object[] args = new Object[] {
448 Long.valueOf(assetCategoryPropertyModelImpl.getOriginalCompanyId()),
449
450 assetCategoryPropertyModelImpl.getOriginalKey()
451 };
452
453 FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_C_K, args);
454 FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_C_K,
455 args);
456
457 args = new Object[] {
458 Long.valueOf(assetCategoryPropertyModelImpl.getCompanyId()),
459
460 assetCategoryPropertyModelImpl.getKey()
461 };
462
463 FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_C_K, args);
464 FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_C_K,
465 args);
466 }
467 }
468
469 EntityCacheUtil.putResult(AssetCategoryPropertyModelImpl.ENTITY_CACHE_ENABLED,
470 AssetCategoryPropertyImpl.class,
471 assetCategoryProperty.getPrimaryKey(), assetCategoryProperty);
472
473 if (isNew) {
474 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_CA_K,
475 new Object[] {
476 Long.valueOf(assetCategoryProperty.getCategoryId()),
477
478 assetCategoryProperty.getKey()
479 }, assetCategoryProperty);
480 }
481 else {
482 if ((assetCategoryPropertyModelImpl.getColumnBitmask() &
483 FINDER_PATH_FETCH_BY_CA_K.getColumnBitmask()) != 0) {
484 Object[] args = new Object[] {
485 Long.valueOf(assetCategoryPropertyModelImpl.getOriginalCategoryId()),
486
487 assetCategoryPropertyModelImpl.getOriginalKey()
488 };
489
490 FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_CA_K, args);
491 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_CA_K, args);
492
493 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_CA_K,
494 new Object[] {
495 Long.valueOf(assetCategoryProperty.getCategoryId()),
496
497 assetCategoryProperty.getKey()
498 }, assetCategoryProperty);
499 }
500 }
501
502 return assetCategoryProperty;
503 }
504
505 protected AssetCategoryProperty toUnwrappedModel(
506 AssetCategoryProperty assetCategoryProperty) {
507 if (assetCategoryProperty instanceof AssetCategoryPropertyImpl) {
508 return assetCategoryProperty;
509 }
510
511 AssetCategoryPropertyImpl assetCategoryPropertyImpl = new AssetCategoryPropertyImpl();
512
513 assetCategoryPropertyImpl.setNew(assetCategoryProperty.isNew());
514 assetCategoryPropertyImpl.setPrimaryKey(assetCategoryProperty.getPrimaryKey());
515
516 assetCategoryPropertyImpl.setCategoryPropertyId(assetCategoryProperty.getCategoryPropertyId());
517 assetCategoryPropertyImpl.setCompanyId(assetCategoryProperty.getCompanyId());
518 assetCategoryPropertyImpl.setUserId(assetCategoryProperty.getUserId());
519 assetCategoryPropertyImpl.setUserName(assetCategoryProperty.getUserName());
520 assetCategoryPropertyImpl.setCreateDate(assetCategoryProperty.getCreateDate());
521 assetCategoryPropertyImpl.setModifiedDate(assetCategoryProperty.getModifiedDate());
522 assetCategoryPropertyImpl.setCategoryId(assetCategoryProperty.getCategoryId());
523 assetCategoryPropertyImpl.setKey(assetCategoryProperty.getKey());
524 assetCategoryPropertyImpl.setValue(assetCategoryProperty.getValue());
525
526 return assetCategoryPropertyImpl;
527 }
528
529
537 @Override
538 public AssetCategoryProperty findByPrimaryKey(Serializable primaryKey)
539 throws NoSuchModelException, SystemException {
540 return findByPrimaryKey(((Long)primaryKey).longValue());
541 }
542
543
551 public AssetCategoryProperty findByPrimaryKey(long categoryPropertyId)
552 throws NoSuchCategoryPropertyException, SystemException {
553 AssetCategoryProperty assetCategoryProperty = fetchByPrimaryKey(categoryPropertyId);
554
555 if (assetCategoryProperty == null) {
556 if (_log.isWarnEnabled()) {
557 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
558 categoryPropertyId);
559 }
560
561 throw new NoSuchCategoryPropertyException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
562 categoryPropertyId);
563 }
564
565 return assetCategoryProperty;
566 }
567
568
575 @Override
576 public AssetCategoryProperty fetchByPrimaryKey(Serializable primaryKey)
577 throws SystemException {
578 return fetchByPrimaryKey(((Long)primaryKey).longValue());
579 }
580
581
588 public AssetCategoryProperty fetchByPrimaryKey(long categoryPropertyId)
589 throws SystemException {
590 AssetCategoryProperty assetCategoryProperty = (AssetCategoryProperty)EntityCacheUtil.getResult(AssetCategoryPropertyModelImpl.ENTITY_CACHE_ENABLED,
591 AssetCategoryPropertyImpl.class, categoryPropertyId);
592
593 if (assetCategoryProperty == _nullAssetCategoryProperty) {
594 return null;
595 }
596
597 if (assetCategoryProperty == null) {
598 Session session = null;
599
600 boolean hasException = false;
601
602 try {
603 session = openSession();
604
605 assetCategoryProperty = (AssetCategoryProperty)session.get(AssetCategoryPropertyImpl.class,
606 Long.valueOf(categoryPropertyId));
607 }
608 catch (Exception e) {
609 hasException = true;
610
611 throw processException(e);
612 }
613 finally {
614 if (assetCategoryProperty != null) {
615 cacheResult(assetCategoryProperty);
616 }
617 else if (!hasException) {
618 EntityCacheUtil.putResult(AssetCategoryPropertyModelImpl.ENTITY_CACHE_ENABLED,
619 AssetCategoryPropertyImpl.class, categoryPropertyId,
620 _nullAssetCategoryProperty);
621 }
622
623 closeSession(session);
624 }
625 }
626
627 return assetCategoryProperty;
628 }
629
630
637 public List<AssetCategoryProperty> findByCompanyId(long companyId)
638 throws SystemException {
639 return findByCompanyId(companyId, QueryUtil.ALL_POS, QueryUtil.ALL_POS,
640 null);
641 }
642
643
656 public List<AssetCategoryProperty> findByCompanyId(long companyId,
657 int start, int end) throws SystemException {
658 return findByCompanyId(companyId, start, end, null);
659 }
660
661
675 public List<AssetCategoryProperty> findByCompanyId(long companyId,
676 int start, int end, OrderByComparator orderByComparator)
677 throws SystemException {
678 FinderPath finderPath = null;
679 Object[] finderArgs = null;
680
681 if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
682 (orderByComparator == null)) {
683 finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_COMPANYID;
684 finderArgs = new Object[] { companyId };
685 }
686 else {
687 finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_COMPANYID;
688 finderArgs = new Object[] { companyId, start, end, orderByComparator };
689 }
690
691 List<AssetCategoryProperty> list = (List<AssetCategoryProperty>)FinderCacheUtil.getResult(finderPath,
692 finderArgs, this);
693
694 if (list == null) {
695 StringBundler query = null;
696
697 if (orderByComparator != null) {
698 query = new StringBundler(3 +
699 (orderByComparator.getOrderByFields().length * 3));
700 }
701 else {
702 query = new StringBundler(3);
703 }
704
705 query.append(_SQL_SELECT_ASSETCATEGORYPROPERTY_WHERE);
706
707 query.append(_FINDER_COLUMN_COMPANYID_COMPANYID_2);
708
709 if (orderByComparator != null) {
710 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
711 orderByComparator);
712 }
713
714 else {
715 query.append(AssetCategoryPropertyModelImpl.ORDER_BY_JPQL);
716 }
717
718 String sql = query.toString();
719
720 Session session = null;
721
722 try {
723 session = openSession();
724
725 Query q = session.createQuery(sql);
726
727 QueryPos qPos = QueryPos.getInstance(q);
728
729 qPos.add(companyId);
730
731 list = (List<AssetCategoryProperty>)QueryUtil.list(q,
732 getDialect(), start, end);
733 }
734 catch (Exception e) {
735 throw processException(e);
736 }
737 finally {
738 if (list == null) {
739 FinderCacheUtil.removeResult(finderPath, finderArgs);
740 }
741 else {
742 cacheResult(list);
743
744 FinderCacheUtil.putResult(finderPath, finderArgs, list);
745 }
746
747 closeSession(session);
748 }
749 }
750
751 return list;
752 }
753
754
767 public AssetCategoryProperty findByCompanyId_First(long companyId,
768 OrderByComparator orderByComparator)
769 throws NoSuchCategoryPropertyException, SystemException {
770 List<AssetCategoryProperty> list = findByCompanyId(companyId, 0, 1,
771 orderByComparator);
772
773 if (list.isEmpty()) {
774 StringBundler msg = new StringBundler(4);
775
776 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
777
778 msg.append("companyId=");
779 msg.append(companyId);
780
781 msg.append(StringPool.CLOSE_CURLY_BRACE);
782
783 throw new NoSuchCategoryPropertyException(msg.toString());
784 }
785 else {
786 return list.get(0);
787 }
788 }
789
790
803 public AssetCategoryProperty findByCompanyId_Last(long companyId,
804 OrderByComparator orderByComparator)
805 throws NoSuchCategoryPropertyException, SystemException {
806 int count = countByCompanyId(companyId);
807
808 List<AssetCategoryProperty> list = findByCompanyId(companyId,
809 count - 1, count, orderByComparator);
810
811 if (list.isEmpty()) {
812 StringBundler msg = new StringBundler(4);
813
814 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
815
816 msg.append("companyId=");
817 msg.append(companyId);
818
819 msg.append(StringPool.CLOSE_CURLY_BRACE);
820
821 throw new NoSuchCategoryPropertyException(msg.toString());
822 }
823 else {
824 return list.get(0);
825 }
826 }
827
828
842 public AssetCategoryProperty[] findByCompanyId_PrevAndNext(
843 long categoryPropertyId, long companyId,
844 OrderByComparator orderByComparator)
845 throws NoSuchCategoryPropertyException, SystemException {
846 AssetCategoryProperty assetCategoryProperty = findByPrimaryKey(categoryPropertyId);
847
848 Session session = null;
849
850 try {
851 session = openSession();
852
853 AssetCategoryProperty[] array = new AssetCategoryPropertyImpl[3];
854
855 array[0] = getByCompanyId_PrevAndNext(session,
856 assetCategoryProperty, companyId, orderByComparator, true);
857
858 array[1] = assetCategoryProperty;
859
860 array[2] = getByCompanyId_PrevAndNext(session,
861 assetCategoryProperty, companyId, orderByComparator, false);
862
863 return array;
864 }
865 catch (Exception e) {
866 throw processException(e);
867 }
868 finally {
869 closeSession(session);
870 }
871 }
872
873 protected AssetCategoryProperty getByCompanyId_PrevAndNext(
874 Session session, AssetCategoryProperty assetCategoryProperty,
875 long companyId, OrderByComparator orderByComparator, boolean previous) {
876 StringBundler query = null;
877
878 if (orderByComparator != null) {
879 query = new StringBundler(6 +
880 (orderByComparator.getOrderByFields().length * 6));
881 }
882 else {
883 query = new StringBundler(3);
884 }
885
886 query.append(_SQL_SELECT_ASSETCATEGORYPROPERTY_WHERE);
887
888 query.append(_FINDER_COLUMN_COMPANYID_COMPANYID_2);
889
890 if (orderByComparator != null) {
891 String[] orderByConditionFields = orderByComparator.getOrderByConditionFields();
892
893 if (orderByConditionFields.length > 0) {
894 query.append(WHERE_AND);
895 }
896
897 for (int i = 0; i < orderByConditionFields.length; i++) {
898 query.append(_ORDER_BY_ENTITY_ALIAS);
899 query.append(orderByConditionFields[i]);
900
901 if ((i + 1) < orderByConditionFields.length) {
902 if (orderByComparator.isAscending() ^ previous) {
903 query.append(WHERE_GREATER_THAN_HAS_NEXT);
904 }
905 else {
906 query.append(WHERE_LESSER_THAN_HAS_NEXT);
907 }
908 }
909 else {
910 if (orderByComparator.isAscending() ^ previous) {
911 query.append(WHERE_GREATER_THAN);
912 }
913 else {
914 query.append(WHERE_LESSER_THAN);
915 }
916 }
917 }
918
919 query.append(ORDER_BY_CLAUSE);
920
921 String[] orderByFields = orderByComparator.getOrderByFields();
922
923 for (int i = 0; i < orderByFields.length; i++) {
924 query.append(_ORDER_BY_ENTITY_ALIAS);
925 query.append(orderByFields[i]);
926
927 if ((i + 1) < orderByFields.length) {
928 if (orderByComparator.isAscending() ^ previous) {
929 query.append(ORDER_BY_ASC_HAS_NEXT);
930 }
931 else {
932 query.append(ORDER_BY_DESC_HAS_NEXT);
933 }
934 }
935 else {
936 if (orderByComparator.isAscending() ^ previous) {
937 query.append(ORDER_BY_ASC);
938 }
939 else {
940 query.append(ORDER_BY_DESC);
941 }
942 }
943 }
944 }
945
946 else {
947 query.append(AssetCategoryPropertyModelImpl.ORDER_BY_JPQL);
948 }
949
950 String sql = query.toString();
951
952 Query q = session.createQuery(sql);
953
954 q.setFirstResult(0);
955 q.setMaxResults(2);
956
957 QueryPos qPos = QueryPos.getInstance(q);
958
959 qPos.add(companyId);
960
961 if (orderByComparator != null) {
962 Object[] values = orderByComparator.getOrderByConditionValues(assetCategoryProperty);
963
964 for (Object value : values) {
965 qPos.add(value);
966 }
967 }
968
969 List<AssetCategoryProperty> list = q.list();
970
971 if (list.size() == 2) {
972 return list.get(1);
973 }
974 else {
975 return null;
976 }
977 }
978
979
986 public List<AssetCategoryProperty> findByCategoryId(long categoryId)
987 throws SystemException {
988 return findByCategoryId(categoryId, QueryUtil.ALL_POS,
989 QueryUtil.ALL_POS, null);
990 }
991
992
1005 public List<AssetCategoryProperty> findByCategoryId(long categoryId,
1006 int start, int end) throws SystemException {
1007 return findByCategoryId(categoryId, start, end, null);
1008 }
1009
1010
1024 public List<AssetCategoryProperty> findByCategoryId(long categoryId,
1025 int start, int end, OrderByComparator orderByComparator)
1026 throws SystemException {
1027 FinderPath finderPath = null;
1028 Object[] finderArgs = null;
1029
1030 if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
1031 (orderByComparator == null)) {
1032 finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_CATEGORYID;
1033 finderArgs = new Object[] { categoryId };
1034 }
1035 else {
1036 finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_CATEGORYID;
1037 finderArgs = new Object[] { categoryId, start, end, orderByComparator };
1038 }
1039
1040 List<AssetCategoryProperty> list = (List<AssetCategoryProperty>)FinderCacheUtil.getResult(finderPath,
1041 finderArgs, this);
1042
1043 if (list == null) {
1044 StringBundler query = null;
1045
1046 if (orderByComparator != null) {
1047 query = new StringBundler(3 +
1048 (orderByComparator.getOrderByFields().length * 3));
1049 }
1050 else {
1051 query = new StringBundler(3);
1052 }
1053
1054 query.append(_SQL_SELECT_ASSETCATEGORYPROPERTY_WHERE);
1055
1056 query.append(_FINDER_COLUMN_CATEGORYID_CATEGORYID_2);
1057
1058 if (orderByComparator != null) {
1059 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
1060 orderByComparator);
1061 }
1062
1063 else {
1064 query.append(AssetCategoryPropertyModelImpl.ORDER_BY_JPQL);
1065 }
1066
1067 String sql = query.toString();
1068
1069 Session session = null;
1070
1071 try {
1072 session = openSession();
1073
1074 Query q = session.createQuery(sql);
1075
1076 QueryPos qPos = QueryPos.getInstance(q);
1077
1078 qPos.add(categoryId);
1079
1080 list = (List<AssetCategoryProperty>)QueryUtil.list(q,
1081 getDialect(), start, end);
1082 }
1083 catch (Exception e) {
1084 throw processException(e);
1085 }
1086 finally {
1087 if (list == null) {
1088 FinderCacheUtil.removeResult(finderPath, finderArgs);
1089 }
1090 else {
1091 cacheResult(list);
1092
1093 FinderCacheUtil.putResult(finderPath, finderArgs, list);
1094 }
1095
1096 closeSession(session);
1097 }
1098 }
1099
1100 return list;
1101 }
1102
1103
1116 public AssetCategoryProperty findByCategoryId_First(long categoryId,
1117 OrderByComparator orderByComparator)
1118 throws NoSuchCategoryPropertyException, SystemException {
1119 List<AssetCategoryProperty> list = findByCategoryId(categoryId, 0, 1,
1120 orderByComparator);
1121
1122 if (list.isEmpty()) {
1123 StringBundler msg = new StringBundler(4);
1124
1125 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1126
1127 msg.append("categoryId=");
1128 msg.append(categoryId);
1129
1130 msg.append(StringPool.CLOSE_CURLY_BRACE);
1131
1132 throw new NoSuchCategoryPropertyException(msg.toString());
1133 }
1134 else {
1135 return list.get(0);
1136 }
1137 }
1138
1139
1152 public AssetCategoryProperty findByCategoryId_Last(long categoryId,
1153 OrderByComparator orderByComparator)
1154 throws NoSuchCategoryPropertyException, SystemException {
1155 int count = countByCategoryId(categoryId);
1156
1157 List<AssetCategoryProperty> list = findByCategoryId(categoryId,
1158 count - 1, count, orderByComparator);
1159
1160 if (list.isEmpty()) {
1161 StringBundler msg = new StringBundler(4);
1162
1163 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1164
1165 msg.append("categoryId=");
1166 msg.append(categoryId);
1167
1168 msg.append(StringPool.CLOSE_CURLY_BRACE);
1169
1170 throw new NoSuchCategoryPropertyException(msg.toString());
1171 }
1172 else {
1173 return list.get(0);
1174 }
1175 }
1176
1177
1191 public AssetCategoryProperty[] findByCategoryId_PrevAndNext(
1192 long categoryPropertyId, long categoryId,
1193 OrderByComparator orderByComparator)
1194 throws NoSuchCategoryPropertyException, SystemException {
1195 AssetCategoryProperty assetCategoryProperty = findByPrimaryKey(categoryPropertyId);
1196
1197 Session session = null;
1198
1199 try {
1200 session = openSession();
1201
1202 AssetCategoryProperty[] array = new AssetCategoryPropertyImpl[3];
1203
1204 array[0] = getByCategoryId_PrevAndNext(session,
1205 assetCategoryProperty, categoryId, orderByComparator, true);
1206
1207 array[1] = assetCategoryProperty;
1208
1209 array[2] = getByCategoryId_PrevAndNext(session,
1210 assetCategoryProperty, categoryId, orderByComparator, false);
1211
1212 return array;
1213 }
1214 catch (Exception e) {
1215 throw processException(e);
1216 }
1217 finally {
1218 closeSession(session);
1219 }
1220 }
1221
1222 protected AssetCategoryProperty getByCategoryId_PrevAndNext(
1223 Session session, AssetCategoryProperty assetCategoryProperty,
1224 long categoryId, OrderByComparator orderByComparator, boolean previous) {
1225 StringBundler query = null;
1226
1227 if (orderByComparator != null) {
1228 query = new StringBundler(6 +
1229 (orderByComparator.getOrderByFields().length * 6));
1230 }
1231 else {
1232 query = new StringBundler(3);
1233 }
1234
1235 query.append(_SQL_SELECT_ASSETCATEGORYPROPERTY_WHERE);
1236
1237 query.append(_FINDER_COLUMN_CATEGORYID_CATEGORYID_2);
1238
1239 if (orderByComparator != null) {
1240 String[] orderByConditionFields = orderByComparator.getOrderByConditionFields();
1241
1242 if (orderByConditionFields.length > 0) {
1243 query.append(WHERE_AND);
1244 }
1245
1246 for (int i = 0; i < orderByConditionFields.length; i++) {
1247 query.append(_ORDER_BY_ENTITY_ALIAS);
1248 query.append(orderByConditionFields[i]);
1249
1250 if ((i + 1) < orderByConditionFields.length) {
1251 if (orderByComparator.isAscending() ^ previous) {
1252 query.append(WHERE_GREATER_THAN_HAS_NEXT);
1253 }
1254 else {
1255 query.append(WHERE_LESSER_THAN_HAS_NEXT);
1256 }
1257 }
1258 else {
1259 if (orderByComparator.isAscending() ^ previous) {
1260 query.append(WHERE_GREATER_THAN);
1261 }
1262 else {
1263 query.append(WHERE_LESSER_THAN);
1264 }
1265 }
1266 }
1267
1268 query.append(ORDER_BY_CLAUSE);
1269
1270 String[] orderByFields = orderByComparator.getOrderByFields();
1271
1272 for (int i = 0; i < orderByFields.length; i++) {
1273 query.append(_ORDER_BY_ENTITY_ALIAS);
1274 query.append(orderByFields[i]);
1275
1276 if ((i + 1) < orderByFields.length) {
1277 if (orderByComparator.isAscending() ^ previous) {
1278 query.append(ORDER_BY_ASC_HAS_NEXT);
1279 }
1280 else {
1281 query.append(ORDER_BY_DESC_HAS_NEXT);
1282 }
1283 }
1284 else {
1285 if (orderByComparator.isAscending() ^ previous) {
1286 query.append(ORDER_BY_ASC);
1287 }
1288 else {
1289 query.append(ORDER_BY_DESC);
1290 }
1291 }
1292 }
1293 }
1294
1295 else {
1296 query.append(AssetCategoryPropertyModelImpl.ORDER_BY_JPQL);
1297 }
1298
1299 String sql = query.toString();
1300
1301 Query q = session.createQuery(sql);
1302
1303 q.setFirstResult(0);
1304 q.setMaxResults(2);
1305
1306 QueryPos qPos = QueryPos.getInstance(q);
1307
1308 qPos.add(categoryId);
1309
1310 if (orderByComparator != null) {
1311 Object[] values = orderByComparator.getOrderByConditionValues(assetCategoryProperty);
1312
1313 for (Object value : values) {
1314 qPos.add(value);
1315 }
1316 }
1317
1318 List<AssetCategoryProperty> list = q.list();
1319
1320 if (list.size() == 2) {
1321 return list.get(1);
1322 }
1323 else {
1324 return null;
1325 }
1326 }
1327
1328
1336 public List<AssetCategoryProperty> findByC_K(long companyId, String key)
1337 throws SystemException {
1338 return findByC_K(companyId, key, QueryUtil.ALL_POS, QueryUtil.ALL_POS,
1339 null);
1340 }
1341
1342
1356 public List<AssetCategoryProperty> findByC_K(long companyId, String key,
1357 int start, int end) throws SystemException {
1358 return findByC_K(companyId, key, start, end, null);
1359 }
1360
1361
1376 public List<AssetCategoryProperty> findByC_K(long companyId, String key,
1377 int start, int end, OrderByComparator orderByComparator)
1378 throws SystemException {
1379 FinderPath finderPath = null;
1380 Object[] finderArgs = null;
1381
1382 if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
1383 (orderByComparator == null)) {
1384 finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_C_K;
1385 finderArgs = new Object[] { companyId, key };
1386 }
1387 else {
1388 finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_C_K;
1389 finderArgs = new Object[] {
1390 companyId, key,
1391
1392 start, end, orderByComparator
1393 };
1394 }
1395
1396 List<AssetCategoryProperty> list = (List<AssetCategoryProperty>)FinderCacheUtil.getResult(finderPath,
1397 finderArgs, this);
1398
1399 if (list == null) {
1400 StringBundler query = null;
1401
1402 if (orderByComparator != null) {
1403 query = new StringBundler(4 +
1404 (orderByComparator.getOrderByFields().length * 3));
1405 }
1406 else {
1407 query = new StringBundler(4);
1408 }
1409
1410 query.append(_SQL_SELECT_ASSETCATEGORYPROPERTY_WHERE);
1411
1412 query.append(_FINDER_COLUMN_C_K_COMPANYID_2);
1413
1414 if (key == null) {
1415 query.append(_FINDER_COLUMN_C_K_KEY_1);
1416 }
1417 else {
1418 if (key.equals(StringPool.BLANK)) {
1419 query.append(_FINDER_COLUMN_C_K_KEY_3);
1420 }
1421 else {
1422 query.append(_FINDER_COLUMN_C_K_KEY_2);
1423 }
1424 }
1425
1426 if (orderByComparator != null) {
1427 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
1428 orderByComparator);
1429 }
1430
1431 else {
1432 query.append(AssetCategoryPropertyModelImpl.ORDER_BY_JPQL);
1433 }
1434
1435 String sql = query.toString();
1436
1437 Session session = null;
1438
1439 try {
1440 session = openSession();
1441
1442 Query q = session.createQuery(sql);
1443
1444 QueryPos qPos = QueryPos.getInstance(q);
1445
1446 qPos.add(companyId);
1447
1448 if (key != null) {
1449 qPos.add(key);
1450 }
1451
1452 list = (List<AssetCategoryProperty>)QueryUtil.list(q,
1453 getDialect(), start, end);
1454 }
1455 catch (Exception e) {
1456 throw processException(e);
1457 }
1458 finally {
1459 if (list == null) {
1460 FinderCacheUtil.removeResult(finderPath, finderArgs);
1461 }
1462 else {
1463 cacheResult(list);
1464
1465 FinderCacheUtil.putResult(finderPath, finderArgs, list);
1466 }
1467
1468 closeSession(session);
1469 }
1470 }
1471
1472 return list;
1473 }
1474
1475
1489 public AssetCategoryProperty findByC_K_First(long companyId, String key,
1490 OrderByComparator orderByComparator)
1491 throws NoSuchCategoryPropertyException, SystemException {
1492 List<AssetCategoryProperty> list = findByC_K(companyId, key, 0, 1,
1493 orderByComparator);
1494
1495 if (list.isEmpty()) {
1496 StringBundler msg = new StringBundler(6);
1497
1498 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1499
1500 msg.append("companyId=");
1501 msg.append(companyId);
1502
1503 msg.append(", key=");
1504 msg.append(key);
1505
1506 msg.append(StringPool.CLOSE_CURLY_BRACE);
1507
1508 throw new NoSuchCategoryPropertyException(msg.toString());
1509 }
1510 else {
1511 return list.get(0);
1512 }
1513 }
1514
1515
1529 public AssetCategoryProperty findByC_K_Last(long companyId, String key,
1530 OrderByComparator orderByComparator)
1531 throws NoSuchCategoryPropertyException, SystemException {
1532 int count = countByC_K(companyId, key);
1533
1534 List<AssetCategoryProperty> list = findByC_K(companyId, key, count - 1,
1535 count, orderByComparator);
1536
1537 if (list.isEmpty()) {
1538 StringBundler msg = new StringBundler(6);
1539
1540 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1541
1542 msg.append("companyId=");
1543 msg.append(companyId);
1544
1545 msg.append(", key=");
1546 msg.append(key);
1547
1548 msg.append(StringPool.CLOSE_CURLY_BRACE);
1549
1550 throw new NoSuchCategoryPropertyException(msg.toString());
1551 }
1552 else {
1553 return list.get(0);
1554 }
1555 }
1556
1557
1572 public AssetCategoryProperty[] findByC_K_PrevAndNext(
1573 long categoryPropertyId, long companyId, String key,
1574 OrderByComparator orderByComparator)
1575 throws NoSuchCategoryPropertyException, SystemException {
1576 AssetCategoryProperty assetCategoryProperty = findByPrimaryKey(categoryPropertyId);
1577
1578 Session session = null;
1579
1580 try {
1581 session = openSession();
1582
1583 AssetCategoryProperty[] array = new AssetCategoryPropertyImpl[3];
1584
1585 array[0] = getByC_K_PrevAndNext(session, assetCategoryProperty,
1586 companyId, key, orderByComparator, true);
1587
1588 array[1] = assetCategoryProperty;
1589
1590 array[2] = getByC_K_PrevAndNext(session, assetCategoryProperty,
1591 companyId, key, orderByComparator, false);
1592
1593 return array;
1594 }
1595 catch (Exception e) {
1596 throw processException(e);
1597 }
1598 finally {
1599 closeSession(session);
1600 }
1601 }
1602
1603 protected AssetCategoryProperty getByC_K_PrevAndNext(Session session,
1604 AssetCategoryProperty assetCategoryProperty, long companyId,
1605 String key, OrderByComparator orderByComparator, boolean previous) {
1606 StringBundler query = null;
1607
1608 if (orderByComparator != null) {
1609 query = new StringBundler(6 +
1610 (orderByComparator.getOrderByFields().length * 6));
1611 }
1612 else {
1613 query = new StringBundler(3);
1614 }
1615
1616 query.append(_SQL_SELECT_ASSETCATEGORYPROPERTY_WHERE);
1617
1618 query.append(_FINDER_COLUMN_C_K_COMPANYID_2);
1619
1620 if (key == null) {
1621 query.append(_FINDER_COLUMN_C_K_KEY_1);
1622 }
1623 else {
1624 if (key.equals(StringPool.BLANK)) {
1625 query.append(_FINDER_COLUMN_C_K_KEY_3);
1626 }
1627 else {
1628 query.append(_FINDER_COLUMN_C_K_KEY_2);
1629 }
1630 }
1631
1632 if (orderByComparator != null) {
1633 String[] orderByConditionFields = orderByComparator.getOrderByConditionFields();
1634
1635 if (orderByConditionFields.length > 0) {
1636 query.append(WHERE_AND);
1637 }
1638
1639 for (int i = 0; i < orderByConditionFields.length; i++) {
1640 query.append(_ORDER_BY_ENTITY_ALIAS);
1641 query.append(orderByConditionFields[i]);
1642
1643 if ((i + 1) < orderByConditionFields.length) {
1644 if (orderByComparator.isAscending() ^ previous) {
1645 query.append(WHERE_GREATER_THAN_HAS_NEXT);
1646 }
1647 else {
1648 query.append(WHERE_LESSER_THAN_HAS_NEXT);
1649 }
1650 }
1651 else {
1652 if (orderByComparator.isAscending() ^ previous) {
1653 query.append(WHERE_GREATER_THAN);
1654 }
1655 else {
1656 query.append(WHERE_LESSER_THAN);
1657 }
1658 }
1659 }
1660
1661 query.append(ORDER_BY_CLAUSE);
1662
1663 String[] orderByFields = orderByComparator.getOrderByFields();
1664
1665 for (int i = 0; i < orderByFields.length; i++) {
1666 query.append(_ORDER_BY_ENTITY_ALIAS);
1667 query.append(orderByFields[i]);
1668
1669 if ((i + 1) < orderByFields.length) {
1670 if (orderByComparator.isAscending() ^ previous) {
1671 query.append(ORDER_BY_ASC_HAS_NEXT);
1672 }
1673 else {
1674 query.append(ORDER_BY_DESC_HAS_NEXT);
1675 }
1676 }
1677 else {
1678 if (orderByComparator.isAscending() ^ previous) {
1679 query.append(ORDER_BY_ASC);
1680 }
1681 else {
1682 query.append(ORDER_BY_DESC);
1683 }
1684 }
1685 }
1686 }
1687
1688 else {
1689 query.append(AssetCategoryPropertyModelImpl.ORDER_BY_JPQL);
1690 }
1691
1692 String sql = query.toString();
1693
1694 Query q = session.createQuery(sql);
1695
1696 q.setFirstResult(0);
1697 q.setMaxResults(2);
1698
1699 QueryPos qPos = QueryPos.getInstance(q);
1700
1701 qPos.add(companyId);
1702
1703 if (key != null) {
1704 qPos.add(key);
1705 }
1706
1707 if (orderByComparator != null) {
1708 Object[] values = orderByComparator.getOrderByConditionValues(assetCategoryProperty);
1709
1710 for (Object value : values) {
1711 qPos.add(value);
1712 }
1713 }
1714
1715 List<AssetCategoryProperty> list = q.list();
1716
1717 if (list.size() == 2) {
1718 return list.get(1);
1719 }
1720 else {
1721 return null;
1722 }
1723 }
1724
1725
1734 public AssetCategoryProperty findByCA_K(long categoryId, String key)
1735 throws NoSuchCategoryPropertyException, SystemException {
1736 AssetCategoryProperty assetCategoryProperty = fetchByCA_K(categoryId,
1737 key);
1738
1739 if (assetCategoryProperty == null) {
1740 StringBundler msg = new StringBundler(6);
1741
1742 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1743
1744 msg.append("categoryId=");
1745 msg.append(categoryId);
1746
1747 msg.append(", key=");
1748 msg.append(key);
1749
1750 msg.append(StringPool.CLOSE_CURLY_BRACE);
1751
1752 if (_log.isWarnEnabled()) {
1753 _log.warn(msg.toString());
1754 }
1755
1756 throw new NoSuchCategoryPropertyException(msg.toString());
1757 }
1758
1759 return assetCategoryProperty;
1760 }
1761
1762
1770 public AssetCategoryProperty fetchByCA_K(long categoryId, String key)
1771 throws SystemException {
1772 return fetchByCA_K(categoryId, key, true);
1773 }
1774
1775
1784 public AssetCategoryProperty fetchByCA_K(long categoryId, String key,
1785 boolean retrieveFromCache) throws SystemException {
1786 Object[] finderArgs = new Object[] { categoryId, key };
1787
1788 Object result = null;
1789
1790 if (retrieveFromCache) {
1791 result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_CA_K,
1792 finderArgs, this);
1793 }
1794
1795 if (result == null) {
1796 StringBundler query = new StringBundler(4);
1797
1798 query.append(_SQL_SELECT_ASSETCATEGORYPROPERTY_WHERE);
1799
1800 query.append(_FINDER_COLUMN_CA_K_CATEGORYID_2);
1801
1802 if (key == null) {
1803 query.append(_FINDER_COLUMN_CA_K_KEY_1);
1804 }
1805 else {
1806 if (key.equals(StringPool.BLANK)) {
1807 query.append(_FINDER_COLUMN_CA_K_KEY_3);
1808 }
1809 else {
1810 query.append(_FINDER_COLUMN_CA_K_KEY_2);
1811 }
1812 }
1813
1814 query.append(AssetCategoryPropertyModelImpl.ORDER_BY_JPQL);
1815
1816 String sql = query.toString();
1817
1818 Session session = null;
1819
1820 try {
1821 session = openSession();
1822
1823 Query q = session.createQuery(sql);
1824
1825 QueryPos qPos = QueryPos.getInstance(q);
1826
1827 qPos.add(categoryId);
1828
1829 if (key != null) {
1830 qPos.add(key);
1831 }
1832
1833 List<AssetCategoryProperty> list = q.list();
1834
1835 result = list;
1836
1837 AssetCategoryProperty assetCategoryProperty = null;
1838
1839 if (list.isEmpty()) {
1840 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_CA_K,
1841 finderArgs, list);
1842 }
1843 else {
1844 assetCategoryProperty = list.get(0);
1845
1846 cacheResult(assetCategoryProperty);
1847
1848 if ((assetCategoryProperty.getCategoryId() != categoryId) ||
1849 (assetCategoryProperty.getKey() == null) ||
1850 !assetCategoryProperty.getKey().equals(key)) {
1851 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_CA_K,
1852 finderArgs, assetCategoryProperty);
1853 }
1854 }
1855
1856 return assetCategoryProperty;
1857 }
1858 catch (Exception e) {
1859 throw processException(e);
1860 }
1861 finally {
1862 if (result == null) {
1863 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_CA_K,
1864 finderArgs);
1865 }
1866
1867 closeSession(session);
1868 }
1869 }
1870 else {
1871 if (result instanceof List<?>) {
1872 return null;
1873 }
1874 else {
1875 return (AssetCategoryProperty)result;
1876 }
1877 }
1878 }
1879
1880
1886 public List<AssetCategoryProperty> findAll() throws SystemException {
1887 return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
1888 }
1889
1890
1902 public List<AssetCategoryProperty> findAll(int start, int end)
1903 throws SystemException {
1904 return findAll(start, end, null);
1905 }
1906
1907
1920 public List<AssetCategoryProperty> findAll(int start, int end,
1921 OrderByComparator orderByComparator) throws SystemException {
1922 FinderPath finderPath = null;
1923 Object[] finderArgs = new Object[] { start, end, orderByComparator };
1924
1925 if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
1926 (orderByComparator == null)) {
1927 finderPath = FINDER_PATH_WITH_PAGINATION_FIND_ALL;
1928 finderArgs = FINDER_ARGS_EMPTY;
1929 }
1930 else {
1931 finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL;
1932 finderArgs = new Object[] { start, end, orderByComparator };
1933 }
1934
1935 List<AssetCategoryProperty> list = (List<AssetCategoryProperty>)FinderCacheUtil.getResult(finderPath,
1936 finderArgs, this);
1937
1938 if (list == null) {
1939 StringBundler query = null;
1940 String sql = null;
1941
1942 if (orderByComparator != null) {
1943 query = new StringBundler(2 +
1944 (orderByComparator.getOrderByFields().length * 3));
1945
1946 query.append(_SQL_SELECT_ASSETCATEGORYPROPERTY);
1947
1948 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
1949 orderByComparator);
1950
1951 sql = query.toString();
1952 }
1953 else {
1954 sql = _SQL_SELECT_ASSETCATEGORYPROPERTY.concat(AssetCategoryPropertyModelImpl.ORDER_BY_JPQL);
1955 }
1956
1957 Session session = null;
1958
1959 try {
1960 session = openSession();
1961
1962 Query q = session.createQuery(sql);
1963
1964 if (orderByComparator == null) {
1965 list = (List<AssetCategoryProperty>)QueryUtil.list(q,
1966 getDialect(), start, end, false);
1967
1968 Collections.sort(list);
1969 }
1970 else {
1971 list = (List<AssetCategoryProperty>)QueryUtil.list(q,
1972 getDialect(), start, end);
1973 }
1974 }
1975 catch (Exception e) {
1976 throw processException(e);
1977 }
1978 finally {
1979 if (list == null) {
1980 FinderCacheUtil.removeResult(finderPath, finderArgs);
1981 }
1982 else {
1983 cacheResult(list);
1984
1985 FinderCacheUtil.putResult(finderPath, finderArgs, list);
1986 }
1987
1988 closeSession(session);
1989 }
1990 }
1991
1992 return list;
1993 }
1994
1995
2001 public void removeByCompanyId(long companyId) throws SystemException {
2002 for (AssetCategoryProperty assetCategoryProperty : findByCompanyId(
2003 companyId)) {
2004 assetCategoryPropertyPersistence.remove(assetCategoryProperty);
2005 }
2006 }
2007
2008
2014 public void removeByCategoryId(long categoryId) throws SystemException {
2015 for (AssetCategoryProperty assetCategoryProperty : findByCategoryId(
2016 categoryId)) {
2017 assetCategoryPropertyPersistence.remove(assetCategoryProperty);
2018 }
2019 }
2020
2021
2028 public void removeByC_K(long companyId, String key)
2029 throws SystemException {
2030 for (AssetCategoryProperty assetCategoryProperty : findByC_K(
2031 companyId, key)) {
2032 assetCategoryPropertyPersistence.remove(assetCategoryProperty);
2033 }
2034 }
2035
2036
2043 public void removeByCA_K(long categoryId, String key)
2044 throws NoSuchCategoryPropertyException, SystemException {
2045 AssetCategoryProperty assetCategoryProperty = findByCA_K(categoryId, key);
2046
2047 assetCategoryPropertyPersistence.remove(assetCategoryProperty);
2048 }
2049
2050
2055 public void removeAll() throws SystemException {
2056 for (AssetCategoryProperty assetCategoryProperty : findAll()) {
2057 assetCategoryPropertyPersistence.remove(assetCategoryProperty);
2058 }
2059 }
2060
2061
2068 public int countByCompanyId(long companyId) throws SystemException {
2069 Object[] finderArgs = new Object[] { companyId };
2070
2071 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_COMPANYID,
2072 finderArgs, this);
2073
2074 if (count == null) {
2075 StringBundler query = new StringBundler(2);
2076
2077 query.append(_SQL_COUNT_ASSETCATEGORYPROPERTY_WHERE);
2078
2079 query.append(_FINDER_COLUMN_COMPANYID_COMPANYID_2);
2080
2081 String sql = query.toString();
2082
2083 Session session = null;
2084
2085 try {
2086 session = openSession();
2087
2088 Query q = session.createQuery(sql);
2089
2090 QueryPos qPos = QueryPos.getInstance(q);
2091
2092 qPos.add(companyId);
2093
2094 count = (Long)q.uniqueResult();
2095 }
2096 catch (Exception e) {
2097 throw processException(e);
2098 }
2099 finally {
2100 if (count == null) {
2101 count = Long.valueOf(0);
2102 }
2103
2104 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_COMPANYID,
2105 finderArgs, count);
2106
2107 closeSession(session);
2108 }
2109 }
2110
2111 return count.intValue();
2112 }
2113
2114
2121 public int countByCategoryId(long categoryId) throws SystemException {
2122 Object[] finderArgs = new Object[] { categoryId };
2123
2124 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_CATEGORYID,
2125 finderArgs, this);
2126
2127 if (count == null) {
2128 StringBundler query = new StringBundler(2);
2129
2130 query.append(_SQL_COUNT_ASSETCATEGORYPROPERTY_WHERE);
2131
2132 query.append(_FINDER_COLUMN_CATEGORYID_CATEGORYID_2);
2133
2134 String sql = query.toString();
2135
2136 Session session = null;
2137
2138 try {
2139 session = openSession();
2140
2141 Query q = session.createQuery(sql);
2142
2143 QueryPos qPos = QueryPos.getInstance(q);
2144
2145 qPos.add(categoryId);
2146
2147 count = (Long)q.uniqueResult();
2148 }
2149 catch (Exception e) {
2150 throw processException(e);
2151 }
2152 finally {
2153 if (count == null) {
2154 count = Long.valueOf(0);
2155 }
2156
2157 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_CATEGORYID,
2158 finderArgs, count);
2159
2160 closeSession(session);
2161 }
2162 }
2163
2164 return count.intValue();
2165 }
2166
2167
2175 public int countByC_K(long companyId, String key) throws SystemException {
2176 Object[] finderArgs = new Object[] { companyId, key };
2177
2178 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_C_K,
2179 finderArgs, this);
2180
2181 if (count == null) {
2182 StringBundler query = new StringBundler(3);
2183
2184 query.append(_SQL_COUNT_ASSETCATEGORYPROPERTY_WHERE);
2185
2186 query.append(_FINDER_COLUMN_C_K_COMPANYID_2);
2187
2188 if (key == null) {
2189 query.append(_FINDER_COLUMN_C_K_KEY_1);
2190 }
2191 else {
2192 if (key.equals(StringPool.BLANK)) {
2193 query.append(_FINDER_COLUMN_C_K_KEY_3);
2194 }
2195 else {
2196 query.append(_FINDER_COLUMN_C_K_KEY_2);
2197 }
2198 }
2199
2200 String sql = query.toString();
2201
2202 Session session = null;
2203
2204 try {
2205 session = openSession();
2206
2207 Query q = session.createQuery(sql);
2208
2209 QueryPos qPos = QueryPos.getInstance(q);
2210
2211 qPos.add(companyId);
2212
2213 if (key != null) {
2214 qPos.add(key);
2215 }
2216
2217 count = (Long)q.uniqueResult();
2218 }
2219 catch (Exception e) {
2220 throw processException(e);
2221 }
2222 finally {
2223 if (count == null) {
2224 count = Long.valueOf(0);
2225 }
2226
2227 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_C_K, finderArgs,
2228 count);
2229
2230 closeSession(session);
2231 }
2232 }
2233
2234 return count.intValue();
2235 }
2236
2237
2245 public int countByCA_K(long categoryId, String key)
2246 throws SystemException {
2247 Object[] finderArgs = new Object[] { categoryId, key };
2248
2249 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_CA_K,
2250 finderArgs, this);
2251
2252 if (count == null) {
2253 StringBundler query = new StringBundler(3);
2254
2255 query.append(_SQL_COUNT_ASSETCATEGORYPROPERTY_WHERE);
2256
2257 query.append(_FINDER_COLUMN_CA_K_CATEGORYID_2);
2258
2259 if (key == null) {
2260 query.append(_FINDER_COLUMN_CA_K_KEY_1);
2261 }
2262 else {
2263 if (key.equals(StringPool.BLANK)) {
2264 query.append(_FINDER_COLUMN_CA_K_KEY_3);
2265 }
2266 else {
2267 query.append(_FINDER_COLUMN_CA_K_KEY_2);
2268 }
2269 }
2270
2271 String sql = query.toString();
2272
2273 Session session = null;
2274
2275 try {
2276 session = openSession();
2277
2278 Query q = session.createQuery(sql);
2279
2280 QueryPos qPos = QueryPos.getInstance(q);
2281
2282 qPos.add(categoryId);
2283
2284 if (key != null) {
2285 qPos.add(key);
2286 }
2287
2288 count = (Long)q.uniqueResult();
2289 }
2290 catch (Exception e) {
2291 throw processException(e);
2292 }
2293 finally {
2294 if (count == null) {
2295 count = Long.valueOf(0);
2296 }
2297
2298 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_CA_K,
2299 finderArgs, count);
2300
2301 closeSession(session);
2302 }
2303 }
2304
2305 return count.intValue();
2306 }
2307
2308
2314 public int countAll() throws SystemException {
2315 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
2316 FINDER_ARGS_EMPTY, this);
2317
2318 if (count == null) {
2319 Session session = null;
2320
2321 try {
2322 session = openSession();
2323
2324 Query q = session.createQuery(_SQL_COUNT_ASSETCATEGORYPROPERTY);
2325
2326 count = (Long)q.uniqueResult();
2327 }
2328 catch (Exception e) {
2329 throw processException(e);
2330 }
2331 finally {
2332 if (count == null) {
2333 count = Long.valueOf(0);
2334 }
2335
2336 FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL,
2337 FINDER_ARGS_EMPTY, count);
2338
2339 closeSession(session);
2340 }
2341 }
2342
2343 return count.intValue();
2344 }
2345
2346
2349 public void afterPropertiesSet() {
2350 String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
2351 com.liferay.portal.util.PropsUtil.get(
2352 "value.object.listener.com.liferay.portlet.asset.model.AssetCategoryProperty")));
2353
2354 if (listenerClassNames.length > 0) {
2355 try {
2356 List<ModelListener<AssetCategoryProperty>> listenersList = new ArrayList<ModelListener<AssetCategoryProperty>>();
2357
2358 for (String listenerClassName : listenerClassNames) {
2359 listenersList.add((ModelListener<AssetCategoryProperty>)InstanceFactory.newInstance(
2360 listenerClassName));
2361 }
2362
2363 listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
2364 }
2365 catch (Exception e) {
2366 _log.error(e);
2367 }
2368 }
2369 }
2370
2371 public void destroy() {
2372 EntityCacheUtil.removeCache(AssetCategoryPropertyImpl.class.getName());
2373 FinderCacheUtil.removeCache(FINDER_CLASS_NAME_ENTITY);
2374 FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
2375 }
2376
2377 @BeanReference(type = AssetCategoryPersistence.class)
2378 protected AssetCategoryPersistence assetCategoryPersistence;
2379 @BeanReference(type = AssetCategoryPropertyPersistence.class)
2380 protected AssetCategoryPropertyPersistence assetCategoryPropertyPersistence;
2381 @BeanReference(type = AssetEntryPersistence.class)
2382 protected AssetEntryPersistence assetEntryPersistence;
2383 @BeanReference(type = AssetLinkPersistence.class)
2384 protected AssetLinkPersistence assetLinkPersistence;
2385 @BeanReference(type = AssetTagPersistence.class)
2386 protected AssetTagPersistence assetTagPersistence;
2387 @BeanReference(type = AssetTagPropertyPersistence.class)
2388 protected AssetTagPropertyPersistence assetTagPropertyPersistence;
2389 @BeanReference(type = AssetTagStatsPersistence.class)
2390 protected AssetTagStatsPersistence assetTagStatsPersistence;
2391 @BeanReference(type = AssetVocabularyPersistence.class)
2392 protected AssetVocabularyPersistence assetVocabularyPersistence;
2393 @BeanReference(type = ResourcePersistence.class)
2394 protected ResourcePersistence resourcePersistence;
2395 @BeanReference(type = UserPersistence.class)
2396 protected UserPersistence userPersistence;
2397 private static final String _SQL_SELECT_ASSETCATEGORYPROPERTY = "SELECT assetCategoryProperty FROM AssetCategoryProperty assetCategoryProperty";
2398 private static final String _SQL_SELECT_ASSETCATEGORYPROPERTY_WHERE = "SELECT assetCategoryProperty FROM AssetCategoryProperty assetCategoryProperty WHERE ";
2399 private static final String _SQL_COUNT_ASSETCATEGORYPROPERTY = "SELECT COUNT(assetCategoryProperty) FROM AssetCategoryProperty assetCategoryProperty";
2400 private static final String _SQL_COUNT_ASSETCATEGORYPROPERTY_WHERE = "SELECT COUNT(assetCategoryProperty) FROM AssetCategoryProperty assetCategoryProperty WHERE ";
2401 private static final String _FINDER_COLUMN_COMPANYID_COMPANYID_2 = "assetCategoryProperty.companyId = ?";
2402 private static final String _FINDER_COLUMN_CATEGORYID_CATEGORYID_2 = "assetCategoryProperty.categoryId = ?";
2403 private static final String _FINDER_COLUMN_C_K_COMPANYID_2 = "assetCategoryProperty.companyId = ? AND ";
2404 private static final String _FINDER_COLUMN_C_K_KEY_1 = "assetCategoryProperty.key IS NULL";
2405 private static final String _FINDER_COLUMN_C_K_KEY_2 = "assetCategoryProperty.key = ?";
2406 private static final String _FINDER_COLUMN_C_K_KEY_3 = "(assetCategoryProperty.key IS NULL OR assetCategoryProperty.key = ?)";
2407 private static final String _FINDER_COLUMN_CA_K_CATEGORYID_2 = "assetCategoryProperty.categoryId = ? AND ";
2408 private static final String _FINDER_COLUMN_CA_K_KEY_1 = "assetCategoryProperty.key IS NULL";
2409 private static final String _FINDER_COLUMN_CA_K_KEY_2 = "assetCategoryProperty.key = ?";
2410 private static final String _FINDER_COLUMN_CA_K_KEY_3 = "(assetCategoryProperty.key IS NULL OR assetCategoryProperty.key = ?)";
2411 private static final String _ORDER_BY_ENTITY_ALIAS = "assetCategoryProperty.";
2412 private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No AssetCategoryProperty exists with the primary key ";
2413 private static final String _NO_SUCH_ENTITY_WITH_KEY = "No AssetCategoryProperty exists with the key {";
2414 private static final boolean _HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE = com.liferay.portal.util.PropsValues.HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE;
2415 private static Log _log = LogFactoryUtil.getLog(AssetCategoryPropertyPersistenceImpl.class);
2416 private static AssetCategoryProperty _nullAssetCategoryProperty = new AssetCategoryPropertyImpl() {
2417 @Override
2418 public Object clone() {
2419 return this;
2420 }
2421
2422 @Override
2423 public CacheModel<AssetCategoryProperty> toCacheModel() {
2424 return _nullAssetCategoryPropertyCacheModel;
2425 }
2426 };
2427
2428 private static CacheModel<AssetCategoryProperty> _nullAssetCategoryPropertyCacheModel =
2429 new CacheModel<AssetCategoryProperty>() {
2430 public AssetCategoryProperty toEntityModel() {
2431 return _nullAssetCategoryProperty;
2432 }
2433 };
2434 }