001
014
015 package com.liferay.portal.service.persistence;
016
017 import com.liferay.portal.NoSuchLayoutBranchException;
018 import com.liferay.portal.NoSuchModelException;
019 import com.liferay.portal.kernel.bean.BeanReference;
020 import com.liferay.portal.kernel.cache.CacheRegistryUtil;
021 import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
022 import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
023 import com.liferay.portal.kernel.dao.orm.FinderPath;
024 import com.liferay.portal.kernel.dao.orm.Query;
025 import com.liferay.portal.kernel.dao.orm.QueryPos;
026 import com.liferay.portal.kernel.dao.orm.QueryUtil;
027 import com.liferay.portal.kernel.dao.orm.Session;
028 import com.liferay.portal.kernel.exception.SystemException;
029 import com.liferay.portal.kernel.log.Log;
030 import com.liferay.portal.kernel.log.LogFactoryUtil;
031 import com.liferay.portal.kernel.util.GetterUtil;
032 import com.liferay.portal.kernel.util.InstanceFactory;
033 import com.liferay.portal.kernel.util.OrderByComparator;
034 import com.liferay.portal.kernel.util.StringBundler;
035 import com.liferay.portal.kernel.util.StringPool;
036 import com.liferay.portal.kernel.util.StringUtil;
037 import com.liferay.portal.kernel.util.Validator;
038 import com.liferay.portal.model.CacheModel;
039 import com.liferay.portal.model.LayoutBranch;
040 import com.liferay.portal.model.ModelListener;
041 import com.liferay.portal.model.impl.LayoutBranchImpl;
042 import com.liferay.portal.model.impl.LayoutBranchModelImpl;
043 import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
044
045 import java.io.Serializable;
046
047 import java.util.ArrayList;
048 import java.util.Collections;
049 import java.util.List;
050
051
063 public class LayoutBranchPersistenceImpl extends BasePersistenceImpl<LayoutBranch>
064 implements LayoutBranchPersistence {
065
070 public static final String FINDER_CLASS_NAME_ENTITY = LayoutBranchImpl.class.getName();
071 public static final String FINDER_CLASS_NAME_LIST_WITH_PAGINATION = FINDER_CLASS_NAME_ENTITY +
072 ".List1";
073 public static final String FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION = FINDER_CLASS_NAME_ENTITY +
074 ".List2";
075 public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_BY_LAYOUTSETBRANCHID =
076 new FinderPath(LayoutBranchModelImpl.ENTITY_CACHE_ENABLED,
077 LayoutBranchModelImpl.FINDER_CACHE_ENABLED, LayoutBranchImpl.class,
078 FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findByLayoutSetBranchId",
079 new String[] {
080 Long.class.getName(),
081
082 "java.lang.Integer", "java.lang.Integer",
083 "com.liferay.portal.kernel.util.OrderByComparator"
084 });
085 public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_LAYOUTSETBRANCHID =
086 new FinderPath(LayoutBranchModelImpl.ENTITY_CACHE_ENABLED,
087 LayoutBranchModelImpl.FINDER_CACHE_ENABLED, LayoutBranchImpl.class,
088 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION,
089 "findByLayoutSetBranchId", new String[] { Long.class.getName() },
090 LayoutBranchModelImpl.LAYOUTSETBRANCHID_COLUMN_BITMASK);
091 public static final FinderPath FINDER_PATH_COUNT_BY_LAYOUTSETBRANCHID = new FinderPath(LayoutBranchModelImpl.ENTITY_CACHE_ENABLED,
092 LayoutBranchModelImpl.FINDER_CACHE_ENABLED, Long.class,
093 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION,
094 "countByLayoutSetBranchId", new String[] { Long.class.getName() });
095 public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_BY_L_P = new FinderPath(LayoutBranchModelImpl.ENTITY_CACHE_ENABLED,
096 LayoutBranchModelImpl.FINDER_CACHE_ENABLED, LayoutBranchImpl.class,
097 FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findByL_P",
098 new String[] {
099 Long.class.getName(), Long.class.getName(),
100
101 "java.lang.Integer", "java.lang.Integer",
102 "com.liferay.portal.kernel.util.OrderByComparator"
103 });
104 public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_L_P = new FinderPath(LayoutBranchModelImpl.ENTITY_CACHE_ENABLED,
105 LayoutBranchModelImpl.FINDER_CACHE_ENABLED, LayoutBranchImpl.class,
106 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findByL_P",
107 new String[] { Long.class.getName(), Long.class.getName() },
108 LayoutBranchModelImpl.LAYOUTSETBRANCHID_COLUMN_BITMASK |
109 LayoutBranchModelImpl.PLID_COLUMN_BITMASK);
110 public static final FinderPath FINDER_PATH_COUNT_BY_L_P = new FinderPath(LayoutBranchModelImpl.ENTITY_CACHE_ENABLED,
111 LayoutBranchModelImpl.FINDER_CACHE_ENABLED, Long.class,
112 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByL_P",
113 new String[] { Long.class.getName(), Long.class.getName() });
114 public static final FinderPath FINDER_PATH_FETCH_BY_L_P_N = new FinderPath(LayoutBranchModelImpl.ENTITY_CACHE_ENABLED,
115 LayoutBranchModelImpl.FINDER_CACHE_ENABLED, LayoutBranchImpl.class,
116 FINDER_CLASS_NAME_ENTITY, "fetchByL_P_N",
117 new String[] {
118 Long.class.getName(), Long.class.getName(),
119 String.class.getName()
120 },
121 LayoutBranchModelImpl.LAYOUTSETBRANCHID_COLUMN_BITMASK |
122 LayoutBranchModelImpl.PLID_COLUMN_BITMASK |
123 LayoutBranchModelImpl.NAME_COLUMN_BITMASK);
124 public static final FinderPath FINDER_PATH_COUNT_BY_L_P_N = new FinderPath(LayoutBranchModelImpl.ENTITY_CACHE_ENABLED,
125 LayoutBranchModelImpl.FINDER_CACHE_ENABLED, Long.class,
126 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByL_P_N",
127 new String[] {
128 Long.class.getName(), Long.class.getName(),
129 String.class.getName()
130 });
131 public static final FinderPath FINDER_PATH_FETCH_BY_L_P_M = new FinderPath(LayoutBranchModelImpl.ENTITY_CACHE_ENABLED,
132 LayoutBranchModelImpl.FINDER_CACHE_ENABLED, LayoutBranchImpl.class,
133 FINDER_CLASS_NAME_ENTITY, "fetchByL_P_M",
134 new String[] {
135 Long.class.getName(), Long.class.getName(),
136 Boolean.class.getName()
137 },
138 LayoutBranchModelImpl.LAYOUTSETBRANCHID_COLUMN_BITMASK |
139 LayoutBranchModelImpl.PLID_COLUMN_BITMASK |
140 LayoutBranchModelImpl.MASTER_COLUMN_BITMASK);
141 public static final FinderPath FINDER_PATH_COUNT_BY_L_P_M = new FinderPath(LayoutBranchModelImpl.ENTITY_CACHE_ENABLED,
142 LayoutBranchModelImpl.FINDER_CACHE_ENABLED, Long.class,
143 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByL_P_M",
144 new String[] {
145 Long.class.getName(), Long.class.getName(),
146 Boolean.class.getName()
147 });
148 public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_ALL = new FinderPath(LayoutBranchModelImpl.ENTITY_CACHE_ENABLED,
149 LayoutBranchModelImpl.FINDER_CACHE_ENABLED, LayoutBranchImpl.class,
150 FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findAll", new String[0]);
151 public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL = new FinderPath(LayoutBranchModelImpl.ENTITY_CACHE_ENABLED,
152 LayoutBranchModelImpl.FINDER_CACHE_ENABLED, LayoutBranchImpl.class,
153 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findAll", new String[0]);
154 public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(LayoutBranchModelImpl.ENTITY_CACHE_ENABLED,
155 LayoutBranchModelImpl.FINDER_CACHE_ENABLED, Long.class,
156 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countAll", new String[0]);
157
158
163 public void cacheResult(LayoutBranch layoutBranch) {
164 EntityCacheUtil.putResult(LayoutBranchModelImpl.ENTITY_CACHE_ENABLED,
165 LayoutBranchImpl.class, layoutBranch.getPrimaryKey(), layoutBranch);
166
167 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_L_P_N,
168 new Object[] {
169 Long.valueOf(layoutBranch.getLayoutSetBranchId()),
170 Long.valueOf(layoutBranch.getPlid()),
171
172 layoutBranch.getName()
173 }, layoutBranch);
174
175 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_L_P_M,
176 new Object[] {
177 Long.valueOf(layoutBranch.getLayoutSetBranchId()),
178 Long.valueOf(layoutBranch.getPlid()),
179 Boolean.valueOf(layoutBranch.getMaster())
180 }, layoutBranch);
181
182 layoutBranch.resetOriginalValues();
183 }
184
185
190 public void cacheResult(List<LayoutBranch> layoutBranchs) {
191 for (LayoutBranch layoutBranch : layoutBranchs) {
192 if (EntityCacheUtil.getResult(
193 LayoutBranchModelImpl.ENTITY_CACHE_ENABLED,
194 LayoutBranchImpl.class, layoutBranch.getPrimaryKey()) == null) {
195 cacheResult(layoutBranch);
196 }
197 else {
198 layoutBranch.resetOriginalValues();
199 }
200 }
201 }
202
203
210 @Override
211 public void clearCache() {
212 if (_HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE) {
213 CacheRegistryUtil.clear(LayoutBranchImpl.class.getName());
214 }
215
216 EntityCacheUtil.clearCache(LayoutBranchImpl.class.getName());
217
218 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
219 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
220 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
221 }
222
223
230 @Override
231 public void clearCache(LayoutBranch layoutBranch) {
232 EntityCacheUtil.removeResult(LayoutBranchModelImpl.ENTITY_CACHE_ENABLED,
233 LayoutBranchImpl.class, layoutBranch.getPrimaryKey());
234
235 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
236 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
237
238 clearUniqueFindersCache(layoutBranch);
239 }
240
241 @Override
242 public void clearCache(List<LayoutBranch> layoutBranchs) {
243 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
244 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
245
246 for (LayoutBranch layoutBranch : layoutBranchs) {
247 EntityCacheUtil.removeResult(LayoutBranchModelImpl.ENTITY_CACHE_ENABLED,
248 LayoutBranchImpl.class, layoutBranch.getPrimaryKey());
249
250 clearUniqueFindersCache(layoutBranch);
251 }
252 }
253
254 protected void clearUniqueFindersCache(LayoutBranch layoutBranch) {
255 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_L_P_N,
256 new Object[] {
257 Long.valueOf(layoutBranch.getLayoutSetBranchId()),
258 Long.valueOf(layoutBranch.getPlid()),
259
260 layoutBranch.getName()
261 });
262
263 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_L_P_M,
264 new Object[] {
265 Long.valueOf(layoutBranch.getLayoutSetBranchId()),
266 Long.valueOf(layoutBranch.getPlid()),
267 Boolean.valueOf(layoutBranch.getMaster())
268 });
269 }
270
271
277 public LayoutBranch create(long LayoutBranchId) {
278 LayoutBranch layoutBranch = new LayoutBranchImpl();
279
280 layoutBranch.setNew(true);
281 layoutBranch.setPrimaryKey(LayoutBranchId);
282
283 return layoutBranch;
284 }
285
286
294 public LayoutBranch remove(long LayoutBranchId)
295 throws NoSuchLayoutBranchException, SystemException {
296 return remove(Long.valueOf(LayoutBranchId));
297 }
298
299
307 @Override
308 public LayoutBranch remove(Serializable primaryKey)
309 throws NoSuchLayoutBranchException, SystemException {
310 Session session = null;
311
312 try {
313 session = openSession();
314
315 LayoutBranch layoutBranch = (LayoutBranch)session.get(LayoutBranchImpl.class,
316 primaryKey);
317
318 if (layoutBranch == null) {
319 if (_log.isWarnEnabled()) {
320 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
321 }
322
323 throw new NoSuchLayoutBranchException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
324 primaryKey);
325 }
326
327 return remove(layoutBranch);
328 }
329 catch (NoSuchLayoutBranchException nsee) {
330 throw nsee;
331 }
332 catch (Exception e) {
333 throw processException(e);
334 }
335 finally {
336 closeSession(session);
337 }
338 }
339
340 @Override
341 protected LayoutBranch removeImpl(LayoutBranch layoutBranch)
342 throws SystemException {
343 layoutBranch = toUnwrappedModel(layoutBranch);
344
345 Session session = null;
346
347 try {
348 session = openSession();
349
350 if (layoutBranch.isCachedModel()) {
351 layoutBranch = (LayoutBranch)session.get(LayoutBranchImpl.class,
352 layoutBranch.getPrimaryKeyObj());
353 }
354
355 session.delete(layoutBranch);
356 }
357 catch (Exception e) {
358 throw processException(e);
359 }
360 finally {
361 closeSession(session);
362 }
363
364 clearCache(layoutBranch);
365
366 return layoutBranch;
367 }
368
369 @Override
370 public LayoutBranch updateImpl(
371 com.liferay.portal.model.LayoutBranch layoutBranch)
372 throws SystemException {
373 layoutBranch = toUnwrappedModel(layoutBranch);
374
375 boolean isNew = layoutBranch.isNew();
376
377 LayoutBranchModelImpl layoutBranchModelImpl = (LayoutBranchModelImpl)layoutBranch;
378
379 Session session = null;
380
381 try {
382 session = openSession();
383
384 if (layoutBranch.isNew()) {
385 session.save(layoutBranch);
386
387 layoutBranch.setNew(false);
388 }
389 else {
390 session.merge(layoutBranch);
391 }
392 }
393 catch (Exception e) {
394 throw processException(e);
395 }
396 finally {
397 closeSession(session);
398 }
399
400 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
401
402 if (isNew || !LayoutBranchModelImpl.COLUMN_BITMASK_ENABLED) {
403 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
404 }
405
406 else {
407 if ((layoutBranchModelImpl.getColumnBitmask() &
408 FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_LAYOUTSETBRANCHID.getColumnBitmask()) != 0) {
409 Object[] args = new Object[] {
410 Long.valueOf(layoutBranchModelImpl.getOriginalLayoutSetBranchId())
411 };
412
413 FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_LAYOUTSETBRANCHID,
414 args);
415 FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_LAYOUTSETBRANCHID,
416 args);
417
418 args = new Object[] {
419 Long.valueOf(layoutBranchModelImpl.getLayoutSetBranchId())
420 };
421
422 FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_LAYOUTSETBRANCHID,
423 args);
424 FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_LAYOUTSETBRANCHID,
425 args);
426 }
427
428 if ((layoutBranchModelImpl.getColumnBitmask() &
429 FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_L_P.getColumnBitmask()) != 0) {
430 Object[] args = new Object[] {
431 Long.valueOf(layoutBranchModelImpl.getOriginalLayoutSetBranchId()),
432 Long.valueOf(layoutBranchModelImpl.getOriginalPlid())
433 };
434
435 FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_L_P, args);
436 FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_L_P,
437 args);
438
439 args = new Object[] {
440 Long.valueOf(layoutBranchModelImpl.getLayoutSetBranchId()),
441 Long.valueOf(layoutBranchModelImpl.getPlid())
442 };
443
444 FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_L_P, args);
445 FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_L_P,
446 args);
447 }
448 }
449
450 EntityCacheUtil.putResult(LayoutBranchModelImpl.ENTITY_CACHE_ENABLED,
451 LayoutBranchImpl.class, layoutBranch.getPrimaryKey(), layoutBranch);
452
453 if (isNew) {
454 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_L_P_N,
455 new Object[] {
456 Long.valueOf(layoutBranch.getLayoutSetBranchId()),
457 Long.valueOf(layoutBranch.getPlid()),
458
459 layoutBranch.getName()
460 }, layoutBranch);
461
462 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_L_P_M,
463 new Object[] {
464 Long.valueOf(layoutBranch.getLayoutSetBranchId()),
465 Long.valueOf(layoutBranch.getPlid()),
466 Boolean.valueOf(layoutBranch.getMaster())
467 }, layoutBranch);
468 }
469 else {
470 if ((layoutBranchModelImpl.getColumnBitmask() &
471 FINDER_PATH_FETCH_BY_L_P_N.getColumnBitmask()) != 0) {
472 Object[] args = new Object[] {
473 Long.valueOf(layoutBranchModelImpl.getOriginalLayoutSetBranchId()),
474 Long.valueOf(layoutBranchModelImpl.getOriginalPlid()),
475
476 layoutBranchModelImpl.getOriginalName()
477 };
478
479 FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_L_P_N, args);
480
481 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_L_P_N, args);
482
483 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_L_P_N,
484 new Object[] {
485 Long.valueOf(layoutBranch.getLayoutSetBranchId()),
486 Long.valueOf(layoutBranch.getPlid()),
487
488 layoutBranch.getName()
489 }, layoutBranch);
490 }
491
492 if ((layoutBranchModelImpl.getColumnBitmask() &
493 FINDER_PATH_FETCH_BY_L_P_M.getColumnBitmask()) != 0) {
494 Object[] args = new Object[] {
495 Long.valueOf(layoutBranchModelImpl.getOriginalLayoutSetBranchId()),
496 Long.valueOf(layoutBranchModelImpl.getOriginalPlid()),
497 Boolean.valueOf(layoutBranchModelImpl.getOriginalMaster())
498 };
499
500 FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_L_P_M, args);
501
502 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_L_P_M, args);
503
504 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_L_P_M,
505 new Object[] {
506 Long.valueOf(layoutBranch.getLayoutSetBranchId()),
507 Long.valueOf(layoutBranch.getPlid()),
508 Boolean.valueOf(layoutBranch.getMaster())
509 }, layoutBranch);
510 }
511 }
512
513 return layoutBranch;
514 }
515
516 protected LayoutBranch toUnwrappedModel(LayoutBranch layoutBranch) {
517 if (layoutBranch instanceof LayoutBranchImpl) {
518 return layoutBranch;
519 }
520
521 LayoutBranchImpl layoutBranchImpl = new LayoutBranchImpl();
522
523 layoutBranchImpl.setNew(layoutBranch.isNew());
524 layoutBranchImpl.setPrimaryKey(layoutBranch.getPrimaryKey());
525
526 layoutBranchImpl.setLayoutBranchId(layoutBranch.getLayoutBranchId());
527 layoutBranchImpl.setGroupId(layoutBranch.getGroupId());
528 layoutBranchImpl.setCompanyId(layoutBranch.getCompanyId());
529 layoutBranchImpl.setUserId(layoutBranch.getUserId());
530 layoutBranchImpl.setUserName(layoutBranch.getUserName());
531 layoutBranchImpl.setLayoutSetBranchId(layoutBranch.getLayoutSetBranchId());
532 layoutBranchImpl.setPlid(layoutBranch.getPlid());
533 layoutBranchImpl.setName(layoutBranch.getName());
534 layoutBranchImpl.setDescription(layoutBranch.getDescription());
535 layoutBranchImpl.setMaster(layoutBranch.isMaster());
536
537 return layoutBranchImpl;
538 }
539
540
548 @Override
549 public LayoutBranch findByPrimaryKey(Serializable primaryKey)
550 throws NoSuchModelException, SystemException {
551 return findByPrimaryKey(((Long)primaryKey).longValue());
552 }
553
554
562 public LayoutBranch findByPrimaryKey(long LayoutBranchId)
563 throws NoSuchLayoutBranchException, SystemException {
564 LayoutBranch layoutBranch = fetchByPrimaryKey(LayoutBranchId);
565
566 if (layoutBranch == null) {
567 if (_log.isWarnEnabled()) {
568 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + LayoutBranchId);
569 }
570
571 throw new NoSuchLayoutBranchException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
572 LayoutBranchId);
573 }
574
575 return layoutBranch;
576 }
577
578
585 @Override
586 public LayoutBranch fetchByPrimaryKey(Serializable primaryKey)
587 throws SystemException {
588 return fetchByPrimaryKey(((Long)primaryKey).longValue());
589 }
590
591
598 public LayoutBranch fetchByPrimaryKey(long LayoutBranchId)
599 throws SystemException {
600 LayoutBranch layoutBranch = (LayoutBranch)EntityCacheUtil.getResult(LayoutBranchModelImpl.ENTITY_CACHE_ENABLED,
601 LayoutBranchImpl.class, LayoutBranchId);
602
603 if (layoutBranch == _nullLayoutBranch) {
604 return null;
605 }
606
607 if (layoutBranch == null) {
608 Session session = null;
609
610 boolean hasException = false;
611
612 try {
613 session = openSession();
614
615 layoutBranch = (LayoutBranch)session.get(LayoutBranchImpl.class,
616 Long.valueOf(LayoutBranchId));
617 }
618 catch (Exception e) {
619 hasException = true;
620
621 throw processException(e);
622 }
623 finally {
624 if (layoutBranch != null) {
625 cacheResult(layoutBranch);
626 }
627 else if (!hasException) {
628 EntityCacheUtil.putResult(LayoutBranchModelImpl.ENTITY_CACHE_ENABLED,
629 LayoutBranchImpl.class, LayoutBranchId,
630 _nullLayoutBranch);
631 }
632
633 closeSession(session);
634 }
635 }
636
637 return layoutBranch;
638 }
639
640
647 public List<LayoutBranch> findByLayoutSetBranchId(long layoutSetBranchId)
648 throws SystemException {
649 return findByLayoutSetBranchId(layoutSetBranchId, QueryUtil.ALL_POS,
650 QueryUtil.ALL_POS, null);
651 }
652
653
666 public List<LayoutBranch> findByLayoutSetBranchId(long layoutSetBranchId,
667 int start, int end) throws SystemException {
668 return findByLayoutSetBranchId(layoutSetBranchId, start, end, null);
669 }
670
671
685 public List<LayoutBranch> findByLayoutSetBranchId(long layoutSetBranchId,
686 int start, int end, OrderByComparator orderByComparator)
687 throws SystemException {
688 FinderPath finderPath = null;
689 Object[] finderArgs = null;
690
691 if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
692 (orderByComparator == null)) {
693 finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_LAYOUTSETBRANCHID;
694 finderArgs = new Object[] { layoutSetBranchId };
695 }
696 else {
697 finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_LAYOUTSETBRANCHID;
698 finderArgs = new Object[] {
699 layoutSetBranchId,
700
701 start, end, orderByComparator
702 };
703 }
704
705 List<LayoutBranch> list = (List<LayoutBranch>)FinderCacheUtil.getResult(finderPath,
706 finderArgs, this);
707
708 if ((list != null) && !list.isEmpty()) {
709 for (LayoutBranch layoutBranch : list) {
710 if ((layoutSetBranchId != layoutBranch.getLayoutSetBranchId())) {
711 list = null;
712
713 break;
714 }
715 }
716 }
717
718 if (list == null) {
719 StringBundler query = null;
720
721 if (orderByComparator != null) {
722 query = new StringBundler(3 +
723 (orderByComparator.getOrderByFields().length * 3));
724 }
725 else {
726 query = new StringBundler(2);
727 }
728
729 query.append(_SQL_SELECT_LAYOUTBRANCH_WHERE);
730
731 query.append(_FINDER_COLUMN_LAYOUTSETBRANCHID_LAYOUTSETBRANCHID_2);
732
733 if (orderByComparator != null) {
734 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
735 orderByComparator);
736 }
737
738 String sql = query.toString();
739
740 Session session = null;
741
742 try {
743 session = openSession();
744
745 Query q = session.createQuery(sql);
746
747 QueryPos qPos = QueryPos.getInstance(q);
748
749 qPos.add(layoutSetBranchId);
750
751 list = (List<LayoutBranch>)QueryUtil.list(q, getDialect(),
752 start, end);
753 }
754 catch (Exception e) {
755 throw processException(e);
756 }
757 finally {
758 if (list == null) {
759 FinderCacheUtil.removeResult(finderPath, finderArgs);
760 }
761 else {
762 cacheResult(list);
763
764 FinderCacheUtil.putResult(finderPath, finderArgs, list);
765 }
766
767 closeSession(session);
768 }
769 }
770
771 return list;
772 }
773
774
783 public LayoutBranch findByLayoutSetBranchId_First(long layoutSetBranchId,
784 OrderByComparator orderByComparator)
785 throws NoSuchLayoutBranchException, SystemException {
786 LayoutBranch layoutBranch = fetchByLayoutSetBranchId_First(layoutSetBranchId,
787 orderByComparator);
788
789 if (layoutBranch != null) {
790 return layoutBranch;
791 }
792
793 StringBundler msg = new StringBundler(4);
794
795 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
796
797 msg.append("layoutSetBranchId=");
798 msg.append(layoutSetBranchId);
799
800 msg.append(StringPool.CLOSE_CURLY_BRACE);
801
802 throw new NoSuchLayoutBranchException(msg.toString());
803 }
804
805
813 public LayoutBranch fetchByLayoutSetBranchId_First(long layoutSetBranchId,
814 OrderByComparator orderByComparator) throws SystemException {
815 List<LayoutBranch> list = findByLayoutSetBranchId(layoutSetBranchId, 0,
816 1, orderByComparator);
817
818 if (!list.isEmpty()) {
819 return list.get(0);
820 }
821
822 return null;
823 }
824
825
834 public LayoutBranch findByLayoutSetBranchId_Last(long layoutSetBranchId,
835 OrderByComparator orderByComparator)
836 throws NoSuchLayoutBranchException, SystemException {
837 LayoutBranch layoutBranch = fetchByLayoutSetBranchId_Last(layoutSetBranchId,
838 orderByComparator);
839
840 if (layoutBranch != null) {
841 return layoutBranch;
842 }
843
844 StringBundler msg = new StringBundler(4);
845
846 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
847
848 msg.append("layoutSetBranchId=");
849 msg.append(layoutSetBranchId);
850
851 msg.append(StringPool.CLOSE_CURLY_BRACE);
852
853 throw new NoSuchLayoutBranchException(msg.toString());
854 }
855
856
864 public LayoutBranch fetchByLayoutSetBranchId_Last(long layoutSetBranchId,
865 OrderByComparator orderByComparator) throws SystemException {
866 int count = countByLayoutSetBranchId(layoutSetBranchId);
867
868 List<LayoutBranch> list = findByLayoutSetBranchId(layoutSetBranchId,
869 count - 1, count, orderByComparator);
870
871 if (!list.isEmpty()) {
872 return list.get(0);
873 }
874
875 return null;
876 }
877
878
888 public LayoutBranch[] findByLayoutSetBranchId_PrevAndNext(
889 long LayoutBranchId, long layoutSetBranchId,
890 OrderByComparator orderByComparator)
891 throws NoSuchLayoutBranchException, SystemException {
892 LayoutBranch layoutBranch = findByPrimaryKey(LayoutBranchId);
893
894 Session session = null;
895
896 try {
897 session = openSession();
898
899 LayoutBranch[] array = new LayoutBranchImpl[3];
900
901 array[0] = getByLayoutSetBranchId_PrevAndNext(session,
902 layoutBranch, layoutSetBranchId, orderByComparator, true);
903
904 array[1] = layoutBranch;
905
906 array[2] = getByLayoutSetBranchId_PrevAndNext(session,
907 layoutBranch, layoutSetBranchId, orderByComparator, false);
908
909 return array;
910 }
911 catch (Exception e) {
912 throw processException(e);
913 }
914 finally {
915 closeSession(session);
916 }
917 }
918
919 protected LayoutBranch getByLayoutSetBranchId_PrevAndNext(Session session,
920 LayoutBranch layoutBranch, long layoutSetBranchId,
921 OrderByComparator orderByComparator, boolean previous) {
922 StringBundler query = null;
923
924 if (orderByComparator != null) {
925 query = new StringBundler(6 +
926 (orderByComparator.getOrderByFields().length * 6));
927 }
928 else {
929 query = new StringBundler(3);
930 }
931
932 query.append(_SQL_SELECT_LAYOUTBRANCH_WHERE);
933
934 query.append(_FINDER_COLUMN_LAYOUTSETBRANCHID_LAYOUTSETBRANCHID_2);
935
936 if (orderByComparator != null) {
937 String[] orderByConditionFields = orderByComparator.getOrderByConditionFields();
938
939 if (orderByConditionFields.length > 0) {
940 query.append(WHERE_AND);
941 }
942
943 for (int i = 0; i < orderByConditionFields.length; i++) {
944 query.append(_ORDER_BY_ENTITY_ALIAS);
945 query.append(orderByConditionFields[i]);
946
947 if ((i + 1) < orderByConditionFields.length) {
948 if (orderByComparator.isAscending() ^ previous) {
949 query.append(WHERE_GREATER_THAN_HAS_NEXT);
950 }
951 else {
952 query.append(WHERE_LESSER_THAN_HAS_NEXT);
953 }
954 }
955 else {
956 if (orderByComparator.isAscending() ^ previous) {
957 query.append(WHERE_GREATER_THAN);
958 }
959 else {
960 query.append(WHERE_LESSER_THAN);
961 }
962 }
963 }
964
965 query.append(ORDER_BY_CLAUSE);
966
967 String[] orderByFields = orderByComparator.getOrderByFields();
968
969 for (int i = 0; i < orderByFields.length; i++) {
970 query.append(_ORDER_BY_ENTITY_ALIAS);
971 query.append(orderByFields[i]);
972
973 if ((i + 1) < orderByFields.length) {
974 if (orderByComparator.isAscending() ^ previous) {
975 query.append(ORDER_BY_ASC_HAS_NEXT);
976 }
977 else {
978 query.append(ORDER_BY_DESC_HAS_NEXT);
979 }
980 }
981 else {
982 if (orderByComparator.isAscending() ^ previous) {
983 query.append(ORDER_BY_ASC);
984 }
985 else {
986 query.append(ORDER_BY_DESC);
987 }
988 }
989 }
990 }
991
992 String sql = query.toString();
993
994 Query q = session.createQuery(sql);
995
996 q.setFirstResult(0);
997 q.setMaxResults(2);
998
999 QueryPos qPos = QueryPos.getInstance(q);
1000
1001 qPos.add(layoutSetBranchId);
1002
1003 if (orderByComparator != null) {
1004 Object[] values = orderByComparator.getOrderByConditionValues(layoutBranch);
1005
1006 for (Object value : values) {
1007 qPos.add(value);
1008 }
1009 }
1010
1011 List<LayoutBranch> list = q.list();
1012
1013 if (list.size() == 2) {
1014 return list.get(1);
1015 }
1016 else {
1017 return null;
1018 }
1019 }
1020
1021
1029 public List<LayoutBranch> findByL_P(long layoutSetBranchId, long plid)
1030 throws SystemException {
1031 return findByL_P(layoutSetBranchId, plid, QueryUtil.ALL_POS,
1032 QueryUtil.ALL_POS, null);
1033 }
1034
1035
1049 public List<LayoutBranch> findByL_P(long layoutSetBranchId, long plid,
1050 int start, int end) throws SystemException {
1051 return findByL_P(layoutSetBranchId, plid, start, end, null);
1052 }
1053
1054
1069 public List<LayoutBranch> findByL_P(long layoutSetBranchId, long plid,
1070 int start, int end, OrderByComparator orderByComparator)
1071 throws SystemException {
1072 FinderPath finderPath = null;
1073 Object[] finderArgs = null;
1074
1075 if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
1076 (orderByComparator == null)) {
1077 finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_L_P;
1078 finderArgs = new Object[] { layoutSetBranchId, plid };
1079 }
1080 else {
1081 finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_L_P;
1082 finderArgs = new Object[] {
1083 layoutSetBranchId, plid,
1084
1085 start, end, orderByComparator
1086 };
1087 }
1088
1089 List<LayoutBranch> list = (List<LayoutBranch>)FinderCacheUtil.getResult(finderPath,
1090 finderArgs, this);
1091
1092 if ((list != null) && !list.isEmpty()) {
1093 for (LayoutBranch layoutBranch : list) {
1094 if ((layoutSetBranchId != layoutBranch.getLayoutSetBranchId()) ||
1095 (plid != layoutBranch.getPlid())) {
1096 list = null;
1097
1098 break;
1099 }
1100 }
1101 }
1102
1103 if (list == null) {
1104 StringBundler query = null;
1105
1106 if (orderByComparator != null) {
1107 query = new StringBundler(4 +
1108 (orderByComparator.getOrderByFields().length * 3));
1109 }
1110 else {
1111 query = new StringBundler(3);
1112 }
1113
1114 query.append(_SQL_SELECT_LAYOUTBRANCH_WHERE);
1115
1116 query.append(_FINDER_COLUMN_L_P_LAYOUTSETBRANCHID_2);
1117
1118 query.append(_FINDER_COLUMN_L_P_PLID_2);
1119
1120 if (orderByComparator != null) {
1121 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
1122 orderByComparator);
1123 }
1124
1125 String sql = query.toString();
1126
1127 Session session = null;
1128
1129 try {
1130 session = openSession();
1131
1132 Query q = session.createQuery(sql);
1133
1134 QueryPos qPos = QueryPos.getInstance(q);
1135
1136 qPos.add(layoutSetBranchId);
1137
1138 qPos.add(plid);
1139
1140 list = (List<LayoutBranch>)QueryUtil.list(q, getDialect(),
1141 start, end);
1142 }
1143 catch (Exception e) {
1144 throw processException(e);
1145 }
1146 finally {
1147 if (list == null) {
1148 FinderCacheUtil.removeResult(finderPath, finderArgs);
1149 }
1150 else {
1151 cacheResult(list);
1152
1153 FinderCacheUtil.putResult(finderPath, finderArgs, list);
1154 }
1155
1156 closeSession(session);
1157 }
1158 }
1159
1160 return list;
1161 }
1162
1163
1173 public LayoutBranch findByL_P_First(long layoutSetBranchId, long plid,
1174 OrderByComparator orderByComparator)
1175 throws NoSuchLayoutBranchException, SystemException {
1176 LayoutBranch layoutBranch = fetchByL_P_First(layoutSetBranchId, plid,
1177 orderByComparator);
1178
1179 if (layoutBranch != null) {
1180 return layoutBranch;
1181 }
1182
1183 StringBundler msg = new StringBundler(6);
1184
1185 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1186
1187 msg.append("layoutSetBranchId=");
1188 msg.append(layoutSetBranchId);
1189
1190 msg.append(", plid=");
1191 msg.append(plid);
1192
1193 msg.append(StringPool.CLOSE_CURLY_BRACE);
1194
1195 throw new NoSuchLayoutBranchException(msg.toString());
1196 }
1197
1198
1207 public LayoutBranch fetchByL_P_First(long layoutSetBranchId, long plid,
1208 OrderByComparator orderByComparator) throws SystemException {
1209 List<LayoutBranch> list = findByL_P(layoutSetBranchId, plid, 0, 1,
1210 orderByComparator);
1211
1212 if (!list.isEmpty()) {
1213 return list.get(0);
1214 }
1215
1216 return null;
1217 }
1218
1219
1229 public LayoutBranch findByL_P_Last(long layoutSetBranchId, long plid,
1230 OrderByComparator orderByComparator)
1231 throws NoSuchLayoutBranchException, SystemException {
1232 LayoutBranch layoutBranch = fetchByL_P_Last(layoutSetBranchId, plid,
1233 orderByComparator);
1234
1235 if (layoutBranch != null) {
1236 return layoutBranch;
1237 }
1238
1239 StringBundler msg = new StringBundler(6);
1240
1241 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1242
1243 msg.append("layoutSetBranchId=");
1244 msg.append(layoutSetBranchId);
1245
1246 msg.append(", plid=");
1247 msg.append(plid);
1248
1249 msg.append(StringPool.CLOSE_CURLY_BRACE);
1250
1251 throw new NoSuchLayoutBranchException(msg.toString());
1252 }
1253
1254
1263 public LayoutBranch fetchByL_P_Last(long layoutSetBranchId, long plid,
1264 OrderByComparator orderByComparator) throws SystemException {
1265 int count = countByL_P(layoutSetBranchId, plid);
1266
1267 List<LayoutBranch> list = findByL_P(layoutSetBranchId, plid, count - 1,
1268 count, orderByComparator);
1269
1270 if (!list.isEmpty()) {
1271 return list.get(0);
1272 }
1273
1274 return null;
1275 }
1276
1277
1288 public LayoutBranch[] findByL_P_PrevAndNext(long LayoutBranchId,
1289 long layoutSetBranchId, long plid, OrderByComparator orderByComparator)
1290 throws NoSuchLayoutBranchException, SystemException {
1291 LayoutBranch layoutBranch = findByPrimaryKey(LayoutBranchId);
1292
1293 Session session = null;
1294
1295 try {
1296 session = openSession();
1297
1298 LayoutBranch[] array = new LayoutBranchImpl[3];
1299
1300 array[0] = getByL_P_PrevAndNext(session, layoutBranch,
1301 layoutSetBranchId, plid, orderByComparator, true);
1302
1303 array[1] = layoutBranch;
1304
1305 array[2] = getByL_P_PrevAndNext(session, layoutBranch,
1306 layoutSetBranchId, plid, orderByComparator, false);
1307
1308 return array;
1309 }
1310 catch (Exception e) {
1311 throw processException(e);
1312 }
1313 finally {
1314 closeSession(session);
1315 }
1316 }
1317
1318 protected LayoutBranch getByL_P_PrevAndNext(Session session,
1319 LayoutBranch layoutBranch, long layoutSetBranchId, long plid,
1320 OrderByComparator orderByComparator, boolean previous) {
1321 StringBundler query = null;
1322
1323 if (orderByComparator != null) {
1324 query = new StringBundler(6 +
1325 (orderByComparator.getOrderByFields().length * 6));
1326 }
1327 else {
1328 query = new StringBundler(3);
1329 }
1330
1331 query.append(_SQL_SELECT_LAYOUTBRANCH_WHERE);
1332
1333 query.append(_FINDER_COLUMN_L_P_LAYOUTSETBRANCHID_2);
1334
1335 query.append(_FINDER_COLUMN_L_P_PLID_2);
1336
1337 if (orderByComparator != null) {
1338 String[] orderByConditionFields = orderByComparator.getOrderByConditionFields();
1339
1340 if (orderByConditionFields.length > 0) {
1341 query.append(WHERE_AND);
1342 }
1343
1344 for (int i = 0; i < orderByConditionFields.length; i++) {
1345 query.append(_ORDER_BY_ENTITY_ALIAS);
1346 query.append(orderByConditionFields[i]);
1347
1348 if ((i + 1) < orderByConditionFields.length) {
1349 if (orderByComparator.isAscending() ^ previous) {
1350 query.append(WHERE_GREATER_THAN_HAS_NEXT);
1351 }
1352 else {
1353 query.append(WHERE_LESSER_THAN_HAS_NEXT);
1354 }
1355 }
1356 else {
1357 if (orderByComparator.isAscending() ^ previous) {
1358 query.append(WHERE_GREATER_THAN);
1359 }
1360 else {
1361 query.append(WHERE_LESSER_THAN);
1362 }
1363 }
1364 }
1365
1366 query.append(ORDER_BY_CLAUSE);
1367
1368 String[] orderByFields = orderByComparator.getOrderByFields();
1369
1370 for (int i = 0; i < orderByFields.length; i++) {
1371 query.append(_ORDER_BY_ENTITY_ALIAS);
1372 query.append(orderByFields[i]);
1373
1374 if ((i + 1) < orderByFields.length) {
1375 if (orderByComparator.isAscending() ^ previous) {
1376 query.append(ORDER_BY_ASC_HAS_NEXT);
1377 }
1378 else {
1379 query.append(ORDER_BY_DESC_HAS_NEXT);
1380 }
1381 }
1382 else {
1383 if (orderByComparator.isAscending() ^ previous) {
1384 query.append(ORDER_BY_ASC);
1385 }
1386 else {
1387 query.append(ORDER_BY_DESC);
1388 }
1389 }
1390 }
1391 }
1392
1393 String sql = query.toString();
1394
1395 Query q = session.createQuery(sql);
1396
1397 q.setFirstResult(0);
1398 q.setMaxResults(2);
1399
1400 QueryPos qPos = QueryPos.getInstance(q);
1401
1402 qPos.add(layoutSetBranchId);
1403
1404 qPos.add(plid);
1405
1406 if (orderByComparator != null) {
1407 Object[] values = orderByComparator.getOrderByConditionValues(layoutBranch);
1408
1409 for (Object value : values) {
1410 qPos.add(value);
1411 }
1412 }
1413
1414 List<LayoutBranch> list = q.list();
1415
1416 if (list.size() == 2) {
1417 return list.get(1);
1418 }
1419 else {
1420 return null;
1421 }
1422 }
1423
1424
1434 public LayoutBranch findByL_P_N(long layoutSetBranchId, long plid,
1435 String name) throws NoSuchLayoutBranchException, SystemException {
1436 LayoutBranch layoutBranch = fetchByL_P_N(layoutSetBranchId, plid, name);
1437
1438 if (layoutBranch == null) {
1439 StringBundler msg = new StringBundler(8);
1440
1441 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1442
1443 msg.append("layoutSetBranchId=");
1444 msg.append(layoutSetBranchId);
1445
1446 msg.append(", plid=");
1447 msg.append(plid);
1448
1449 msg.append(", name=");
1450 msg.append(name);
1451
1452 msg.append(StringPool.CLOSE_CURLY_BRACE);
1453
1454 if (_log.isWarnEnabled()) {
1455 _log.warn(msg.toString());
1456 }
1457
1458 throw new NoSuchLayoutBranchException(msg.toString());
1459 }
1460
1461 return layoutBranch;
1462 }
1463
1464
1473 public LayoutBranch fetchByL_P_N(long layoutSetBranchId, long plid,
1474 String name) throws SystemException {
1475 return fetchByL_P_N(layoutSetBranchId, plid, name, true);
1476 }
1477
1478
1488 public LayoutBranch fetchByL_P_N(long layoutSetBranchId, long plid,
1489 String name, boolean retrieveFromCache) throws SystemException {
1490 Object[] finderArgs = new Object[] { layoutSetBranchId, plid, name };
1491
1492 Object result = null;
1493
1494 if (retrieveFromCache) {
1495 result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_L_P_N,
1496 finderArgs, this);
1497 }
1498
1499 if (result instanceof LayoutBranch) {
1500 LayoutBranch layoutBranch = (LayoutBranch)result;
1501
1502 if ((layoutSetBranchId != layoutBranch.getLayoutSetBranchId()) ||
1503 (plid != layoutBranch.getPlid()) ||
1504 !Validator.equals(name, layoutBranch.getName())) {
1505 result = null;
1506 }
1507 }
1508
1509 if (result == null) {
1510 StringBundler query = new StringBundler(4);
1511
1512 query.append(_SQL_SELECT_LAYOUTBRANCH_WHERE);
1513
1514 query.append(_FINDER_COLUMN_L_P_N_LAYOUTSETBRANCHID_2);
1515
1516 query.append(_FINDER_COLUMN_L_P_N_PLID_2);
1517
1518 if (name == null) {
1519 query.append(_FINDER_COLUMN_L_P_N_NAME_1);
1520 }
1521 else {
1522 if (name.equals(StringPool.BLANK)) {
1523 query.append(_FINDER_COLUMN_L_P_N_NAME_3);
1524 }
1525 else {
1526 query.append(_FINDER_COLUMN_L_P_N_NAME_2);
1527 }
1528 }
1529
1530 String sql = query.toString();
1531
1532 Session session = null;
1533
1534 try {
1535 session = openSession();
1536
1537 Query q = session.createQuery(sql);
1538
1539 QueryPos qPos = QueryPos.getInstance(q);
1540
1541 qPos.add(layoutSetBranchId);
1542
1543 qPos.add(plid);
1544
1545 if (name != null) {
1546 qPos.add(name);
1547 }
1548
1549 List<LayoutBranch> list = q.list();
1550
1551 result = list;
1552
1553 LayoutBranch layoutBranch = null;
1554
1555 if (list.isEmpty()) {
1556 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_L_P_N,
1557 finderArgs, list);
1558 }
1559 else {
1560 layoutBranch = list.get(0);
1561
1562 cacheResult(layoutBranch);
1563
1564 if ((layoutBranch.getLayoutSetBranchId() != layoutSetBranchId) ||
1565 (layoutBranch.getPlid() != plid) ||
1566 (layoutBranch.getName() == null) ||
1567 !layoutBranch.getName().equals(name)) {
1568 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_L_P_N,
1569 finderArgs, layoutBranch);
1570 }
1571 }
1572
1573 return layoutBranch;
1574 }
1575 catch (Exception e) {
1576 throw processException(e);
1577 }
1578 finally {
1579 if (result == null) {
1580 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_L_P_N,
1581 finderArgs);
1582 }
1583
1584 closeSession(session);
1585 }
1586 }
1587 else {
1588 if (result instanceof List<?>) {
1589 return null;
1590 }
1591 else {
1592 return (LayoutBranch)result;
1593 }
1594 }
1595 }
1596
1597
1607 public LayoutBranch findByL_P_M(long layoutSetBranchId, long plid,
1608 boolean master) throws NoSuchLayoutBranchException, SystemException {
1609 LayoutBranch layoutBranch = fetchByL_P_M(layoutSetBranchId, plid, master);
1610
1611 if (layoutBranch == null) {
1612 StringBundler msg = new StringBundler(8);
1613
1614 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1615
1616 msg.append("layoutSetBranchId=");
1617 msg.append(layoutSetBranchId);
1618
1619 msg.append(", plid=");
1620 msg.append(plid);
1621
1622 msg.append(", master=");
1623 msg.append(master);
1624
1625 msg.append(StringPool.CLOSE_CURLY_BRACE);
1626
1627 if (_log.isWarnEnabled()) {
1628 _log.warn(msg.toString());
1629 }
1630
1631 throw new NoSuchLayoutBranchException(msg.toString());
1632 }
1633
1634 return layoutBranch;
1635 }
1636
1637
1646 public LayoutBranch fetchByL_P_M(long layoutSetBranchId, long plid,
1647 boolean master) throws SystemException {
1648 return fetchByL_P_M(layoutSetBranchId, plid, master, true);
1649 }
1650
1651
1661 public LayoutBranch fetchByL_P_M(long layoutSetBranchId, long plid,
1662 boolean master, boolean retrieveFromCache) throws SystemException {
1663 Object[] finderArgs = new Object[] { layoutSetBranchId, plid, master };
1664
1665 Object result = null;
1666
1667 if (retrieveFromCache) {
1668 result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_L_P_M,
1669 finderArgs, this);
1670 }
1671
1672 if (result instanceof LayoutBranch) {
1673 LayoutBranch layoutBranch = (LayoutBranch)result;
1674
1675 if ((layoutSetBranchId != layoutBranch.getLayoutSetBranchId()) ||
1676 (plid != layoutBranch.getPlid()) ||
1677 (master != layoutBranch.getMaster())) {
1678 result = null;
1679 }
1680 }
1681
1682 if (result == null) {
1683 StringBundler query = new StringBundler(4);
1684
1685 query.append(_SQL_SELECT_LAYOUTBRANCH_WHERE);
1686
1687 query.append(_FINDER_COLUMN_L_P_M_LAYOUTSETBRANCHID_2);
1688
1689 query.append(_FINDER_COLUMN_L_P_M_PLID_2);
1690
1691 query.append(_FINDER_COLUMN_L_P_M_MASTER_2);
1692
1693 String sql = query.toString();
1694
1695 Session session = null;
1696
1697 try {
1698 session = openSession();
1699
1700 Query q = session.createQuery(sql);
1701
1702 QueryPos qPos = QueryPos.getInstance(q);
1703
1704 qPos.add(layoutSetBranchId);
1705
1706 qPos.add(plid);
1707
1708 qPos.add(master);
1709
1710 List<LayoutBranch> list = q.list();
1711
1712 result = list;
1713
1714 LayoutBranch layoutBranch = null;
1715
1716 if (list.isEmpty()) {
1717 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_L_P_M,
1718 finderArgs, list);
1719 }
1720 else {
1721 layoutBranch = list.get(0);
1722
1723 cacheResult(layoutBranch);
1724
1725 if ((layoutBranch.getLayoutSetBranchId() != layoutSetBranchId) ||
1726 (layoutBranch.getPlid() != plid) ||
1727 (layoutBranch.getMaster() != master)) {
1728 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_L_P_M,
1729 finderArgs, layoutBranch);
1730 }
1731 }
1732
1733 return layoutBranch;
1734 }
1735 catch (Exception e) {
1736 throw processException(e);
1737 }
1738 finally {
1739 if (result == null) {
1740 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_L_P_M,
1741 finderArgs);
1742 }
1743
1744 closeSession(session);
1745 }
1746 }
1747 else {
1748 if (result instanceof List<?>) {
1749 return null;
1750 }
1751 else {
1752 return (LayoutBranch)result;
1753 }
1754 }
1755 }
1756
1757
1763 public List<LayoutBranch> findAll() throws SystemException {
1764 return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
1765 }
1766
1767
1779 public List<LayoutBranch> findAll(int start, int end)
1780 throws SystemException {
1781 return findAll(start, end, null);
1782 }
1783
1784
1797 public List<LayoutBranch> findAll(int start, int end,
1798 OrderByComparator orderByComparator) throws SystemException {
1799 FinderPath finderPath = null;
1800 Object[] finderArgs = new Object[] { start, end, orderByComparator };
1801
1802 if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
1803 (orderByComparator == null)) {
1804 finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL;
1805 finderArgs = FINDER_ARGS_EMPTY;
1806 }
1807 else {
1808 finderPath = FINDER_PATH_WITH_PAGINATION_FIND_ALL;
1809 finderArgs = new Object[] { start, end, orderByComparator };
1810 }
1811
1812 List<LayoutBranch> list = (List<LayoutBranch>)FinderCacheUtil.getResult(finderPath,
1813 finderArgs, this);
1814
1815 if (list == null) {
1816 StringBundler query = null;
1817 String sql = null;
1818
1819 if (orderByComparator != null) {
1820 query = new StringBundler(2 +
1821 (orderByComparator.getOrderByFields().length * 3));
1822
1823 query.append(_SQL_SELECT_LAYOUTBRANCH);
1824
1825 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
1826 orderByComparator);
1827
1828 sql = query.toString();
1829 }
1830 else {
1831 sql = _SQL_SELECT_LAYOUTBRANCH;
1832 }
1833
1834 Session session = null;
1835
1836 try {
1837 session = openSession();
1838
1839 Query q = session.createQuery(sql);
1840
1841 if (orderByComparator == null) {
1842 list = (List<LayoutBranch>)QueryUtil.list(q, getDialect(),
1843 start, end, false);
1844
1845 Collections.sort(list);
1846 }
1847 else {
1848 list = (List<LayoutBranch>)QueryUtil.list(q, getDialect(),
1849 start, end);
1850 }
1851 }
1852 catch (Exception e) {
1853 throw processException(e);
1854 }
1855 finally {
1856 if (list == null) {
1857 FinderCacheUtil.removeResult(finderPath, finderArgs);
1858 }
1859 else {
1860 cacheResult(list);
1861
1862 FinderCacheUtil.putResult(finderPath, finderArgs, list);
1863 }
1864
1865 closeSession(session);
1866 }
1867 }
1868
1869 return list;
1870 }
1871
1872
1878 public void removeByLayoutSetBranchId(long layoutSetBranchId)
1879 throws SystemException {
1880 for (LayoutBranch layoutBranch : findByLayoutSetBranchId(
1881 layoutSetBranchId)) {
1882 remove(layoutBranch);
1883 }
1884 }
1885
1886
1893 public void removeByL_P(long layoutSetBranchId, long plid)
1894 throws SystemException {
1895 for (LayoutBranch layoutBranch : findByL_P(layoutSetBranchId, plid)) {
1896 remove(layoutBranch);
1897 }
1898 }
1899
1900
1909 public LayoutBranch removeByL_P_N(long layoutSetBranchId, long plid,
1910 String name) throws NoSuchLayoutBranchException, SystemException {
1911 LayoutBranch layoutBranch = findByL_P_N(layoutSetBranchId, plid, name);
1912
1913 return remove(layoutBranch);
1914 }
1915
1916
1925 public LayoutBranch removeByL_P_M(long layoutSetBranchId, long plid,
1926 boolean master) throws NoSuchLayoutBranchException, SystemException {
1927 LayoutBranch layoutBranch = findByL_P_M(layoutSetBranchId, plid, master);
1928
1929 return remove(layoutBranch);
1930 }
1931
1932
1937 public void removeAll() throws SystemException {
1938 for (LayoutBranch layoutBranch : findAll()) {
1939 remove(layoutBranch);
1940 }
1941 }
1942
1943
1950 public int countByLayoutSetBranchId(long layoutSetBranchId)
1951 throws SystemException {
1952 Object[] finderArgs = new Object[] { layoutSetBranchId };
1953
1954 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_LAYOUTSETBRANCHID,
1955 finderArgs, this);
1956
1957 if (count == null) {
1958 StringBundler query = new StringBundler(2);
1959
1960 query.append(_SQL_COUNT_LAYOUTBRANCH_WHERE);
1961
1962 query.append(_FINDER_COLUMN_LAYOUTSETBRANCHID_LAYOUTSETBRANCHID_2);
1963
1964 String sql = query.toString();
1965
1966 Session session = null;
1967
1968 try {
1969 session = openSession();
1970
1971 Query q = session.createQuery(sql);
1972
1973 QueryPos qPos = QueryPos.getInstance(q);
1974
1975 qPos.add(layoutSetBranchId);
1976
1977 count = (Long)q.uniqueResult();
1978 }
1979 catch (Exception e) {
1980 throw processException(e);
1981 }
1982 finally {
1983 if (count == null) {
1984 count = Long.valueOf(0);
1985 }
1986
1987 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_LAYOUTSETBRANCHID,
1988 finderArgs, count);
1989
1990 closeSession(session);
1991 }
1992 }
1993
1994 return count.intValue();
1995 }
1996
1997
2005 public int countByL_P(long layoutSetBranchId, long plid)
2006 throws SystemException {
2007 Object[] finderArgs = new Object[] { layoutSetBranchId, plid };
2008
2009 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_L_P,
2010 finderArgs, this);
2011
2012 if (count == null) {
2013 StringBundler query = new StringBundler(3);
2014
2015 query.append(_SQL_COUNT_LAYOUTBRANCH_WHERE);
2016
2017 query.append(_FINDER_COLUMN_L_P_LAYOUTSETBRANCHID_2);
2018
2019 query.append(_FINDER_COLUMN_L_P_PLID_2);
2020
2021 String sql = query.toString();
2022
2023 Session session = null;
2024
2025 try {
2026 session = openSession();
2027
2028 Query q = session.createQuery(sql);
2029
2030 QueryPos qPos = QueryPos.getInstance(q);
2031
2032 qPos.add(layoutSetBranchId);
2033
2034 qPos.add(plid);
2035
2036 count = (Long)q.uniqueResult();
2037 }
2038 catch (Exception e) {
2039 throw processException(e);
2040 }
2041 finally {
2042 if (count == null) {
2043 count = Long.valueOf(0);
2044 }
2045
2046 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_L_P, finderArgs,
2047 count);
2048
2049 closeSession(session);
2050 }
2051 }
2052
2053 return count.intValue();
2054 }
2055
2056
2065 public int countByL_P_N(long layoutSetBranchId, long plid, String name)
2066 throws SystemException {
2067 Object[] finderArgs = new Object[] { layoutSetBranchId, plid, name };
2068
2069 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_L_P_N,
2070 finderArgs, this);
2071
2072 if (count == null) {
2073 StringBundler query = new StringBundler(4);
2074
2075 query.append(_SQL_COUNT_LAYOUTBRANCH_WHERE);
2076
2077 query.append(_FINDER_COLUMN_L_P_N_LAYOUTSETBRANCHID_2);
2078
2079 query.append(_FINDER_COLUMN_L_P_N_PLID_2);
2080
2081 if (name == null) {
2082 query.append(_FINDER_COLUMN_L_P_N_NAME_1);
2083 }
2084 else {
2085 if (name.equals(StringPool.BLANK)) {
2086 query.append(_FINDER_COLUMN_L_P_N_NAME_3);
2087 }
2088 else {
2089 query.append(_FINDER_COLUMN_L_P_N_NAME_2);
2090 }
2091 }
2092
2093 String sql = query.toString();
2094
2095 Session session = null;
2096
2097 try {
2098 session = openSession();
2099
2100 Query q = session.createQuery(sql);
2101
2102 QueryPos qPos = QueryPos.getInstance(q);
2103
2104 qPos.add(layoutSetBranchId);
2105
2106 qPos.add(plid);
2107
2108 if (name != null) {
2109 qPos.add(name);
2110 }
2111
2112 count = (Long)q.uniqueResult();
2113 }
2114 catch (Exception e) {
2115 throw processException(e);
2116 }
2117 finally {
2118 if (count == null) {
2119 count = Long.valueOf(0);
2120 }
2121
2122 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_L_P_N,
2123 finderArgs, count);
2124
2125 closeSession(session);
2126 }
2127 }
2128
2129 return count.intValue();
2130 }
2131
2132
2141 public int countByL_P_M(long layoutSetBranchId, long plid, boolean master)
2142 throws SystemException {
2143 Object[] finderArgs = new Object[] { layoutSetBranchId, plid, master };
2144
2145 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_L_P_M,
2146 finderArgs, this);
2147
2148 if (count == null) {
2149 StringBundler query = new StringBundler(4);
2150
2151 query.append(_SQL_COUNT_LAYOUTBRANCH_WHERE);
2152
2153 query.append(_FINDER_COLUMN_L_P_M_LAYOUTSETBRANCHID_2);
2154
2155 query.append(_FINDER_COLUMN_L_P_M_PLID_2);
2156
2157 query.append(_FINDER_COLUMN_L_P_M_MASTER_2);
2158
2159 String sql = query.toString();
2160
2161 Session session = null;
2162
2163 try {
2164 session = openSession();
2165
2166 Query q = session.createQuery(sql);
2167
2168 QueryPos qPos = QueryPos.getInstance(q);
2169
2170 qPos.add(layoutSetBranchId);
2171
2172 qPos.add(plid);
2173
2174 qPos.add(master);
2175
2176 count = (Long)q.uniqueResult();
2177 }
2178 catch (Exception e) {
2179 throw processException(e);
2180 }
2181 finally {
2182 if (count == null) {
2183 count = Long.valueOf(0);
2184 }
2185
2186 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_L_P_M,
2187 finderArgs, count);
2188
2189 closeSession(session);
2190 }
2191 }
2192
2193 return count.intValue();
2194 }
2195
2196
2202 public int countAll() throws SystemException {
2203 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
2204 FINDER_ARGS_EMPTY, this);
2205
2206 if (count == null) {
2207 Session session = null;
2208
2209 try {
2210 session = openSession();
2211
2212 Query q = session.createQuery(_SQL_COUNT_LAYOUTBRANCH);
2213
2214 count = (Long)q.uniqueResult();
2215 }
2216 catch (Exception e) {
2217 throw processException(e);
2218 }
2219 finally {
2220 if (count == null) {
2221 count = Long.valueOf(0);
2222 }
2223
2224 FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL,
2225 FINDER_ARGS_EMPTY, count);
2226
2227 closeSession(session);
2228 }
2229 }
2230
2231 return count.intValue();
2232 }
2233
2234
2237 public void afterPropertiesSet() {
2238 String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
2239 com.liferay.portal.util.PropsUtil.get(
2240 "value.object.listener.com.liferay.portal.model.LayoutBranch")));
2241
2242 if (listenerClassNames.length > 0) {
2243 try {
2244 List<ModelListener<LayoutBranch>> listenersList = new ArrayList<ModelListener<LayoutBranch>>();
2245
2246 for (String listenerClassName : listenerClassNames) {
2247 listenersList.add((ModelListener<LayoutBranch>)InstanceFactory.newInstance(
2248 listenerClassName));
2249 }
2250
2251 listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
2252 }
2253 catch (Exception e) {
2254 _log.error(e);
2255 }
2256 }
2257 }
2258
2259 public void destroy() {
2260 EntityCacheUtil.removeCache(LayoutBranchImpl.class.getName());
2261 FinderCacheUtil.removeCache(FINDER_CLASS_NAME_ENTITY);
2262 FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
2263 }
2264
2265 @BeanReference(type = AccountPersistence.class)
2266 protected AccountPersistence accountPersistence;
2267 @BeanReference(type = AddressPersistence.class)
2268 protected AddressPersistence addressPersistence;
2269 @BeanReference(type = BrowserTrackerPersistence.class)
2270 protected BrowserTrackerPersistence browserTrackerPersistence;
2271 @BeanReference(type = ClassNamePersistence.class)
2272 protected ClassNamePersistence classNamePersistence;
2273 @BeanReference(type = ClusterGroupPersistence.class)
2274 protected ClusterGroupPersistence clusterGroupPersistence;
2275 @BeanReference(type = CompanyPersistence.class)
2276 protected CompanyPersistence companyPersistence;
2277 @BeanReference(type = ContactPersistence.class)
2278 protected ContactPersistence contactPersistence;
2279 @BeanReference(type = CountryPersistence.class)
2280 protected CountryPersistence countryPersistence;
2281 @BeanReference(type = EmailAddressPersistence.class)
2282 protected EmailAddressPersistence emailAddressPersistence;
2283 @BeanReference(type = GroupPersistence.class)
2284 protected GroupPersistence groupPersistence;
2285 @BeanReference(type = ImagePersistence.class)
2286 protected ImagePersistence imagePersistence;
2287 @BeanReference(type = LayoutPersistence.class)
2288 protected LayoutPersistence layoutPersistence;
2289 @BeanReference(type = LayoutBranchPersistence.class)
2290 protected LayoutBranchPersistence layoutBranchPersistence;
2291 @BeanReference(type = LayoutPrototypePersistence.class)
2292 protected LayoutPrototypePersistence layoutPrototypePersistence;
2293 @BeanReference(type = LayoutRevisionPersistence.class)
2294 protected LayoutRevisionPersistence layoutRevisionPersistence;
2295 @BeanReference(type = LayoutSetPersistence.class)
2296 protected LayoutSetPersistence layoutSetPersistence;
2297 @BeanReference(type = LayoutSetBranchPersistence.class)
2298 protected LayoutSetBranchPersistence layoutSetBranchPersistence;
2299 @BeanReference(type = LayoutSetPrototypePersistence.class)
2300 protected LayoutSetPrototypePersistence layoutSetPrototypePersistence;
2301 @BeanReference(type = ListTypePersistence.class)
2302 protected ListTypePersistence listTypePersistence;
2303 @BeanReference(type = LockPersistence.class)
2304 protected LockPersistence lockPersistence;
2305 @BeanReference(type = MembershipRequestPersistence.class)
2306 protected MembershipRequestPersistence membershipRequestPersistence;
2307 @BeanReference(type = OrganizationPersistence.class)
2308 protected OrganizationPersistence organizationPersistence;
2309 @BeanReference(type = OrgGroupRolePersistence.class)
2310 protected OrgGroupRolePersistence orgGroupRolePersistence;
2311 @BeanReference(type = OrgLaborPersistence.class)
2312 protected OrgLaborPersistence orgLaborPersistence;
2313 @BeanReference(type = PasswordPolicyPersistence.class)
2314 protected PasswordPolicyPersistence passwordPolicyPersistence;
2315 @BeanReference(type = PasswordPolicyRelPersistence.class)
2316 protected PasswordPolicyRelPersistence passwordPolicyRelPersistence;
2317 @BeanReference(type = PasswordTrackerPersistence.class)
2318 protected PasswordTrackerPersistence passwordTrackerPersistence;
2319 @BeanReference(type = PhonePersistence.class)
2320 protected PhonePersistence phonePersistence;
2321 @BeanReference(type = PluginSettingPersistence.class)
2322 protected PluginSettingPersistence pluginSettingPersistence;
2323 @BeanReference(type = PortalPreferencesPersistence.class)
2324 protected PortalPreferencesPersistence portalPreferencesPersistence;
2325 @BeanReference(type = PortletPersistence.class)
2326 protected PortletPersistence portletPersistence;
2327 @BeanReference(type = PortletItemPersistence.class)
2328 protected PortletItemPersistence portletItemPersistence;
2329 @BeanReference(type = PortletPreferencesPersistence.class)
2330 protected PortletPreferencesPersistence portletPreferencesPersistence;
2331 @BeanReference(type = RegionPersistence.class)
2332 protected RegionPersistence regionPersistence;
2333 @BeanReference(type = ReleasePersistence.class)
2334 protected ReleasePersistence releasePersistence;
2335 @BeanReference(type = RepositoryPersistence.class)
2336 protected RepositoryPersistence repositoryPersistence;
2337 @BeanReference(type = RepositoryEntryPersistence.class)
2338 protected RepositoryEntryPersistence repositoryEntryPersistence;
2339 @BeanReference(type = ResourceActionPersistence.class)
2340 protected ResourceActionPersistence resourceActionPersistence;
2341 @BeanReference(type = ResourceBlockPersistence.class)
2342 protected ResourceBlockPersistence resourceBlockPersistence;
2343 @BeanReference(type = ResourceBlockPermissionPersistence.class)
2344 protected ResourceBlockPermissionPersistence resourceBlockPermissionPersistence;
2345 @BeanReference(type = ResourcePermissionPersistence.class)
2346 protected ResourcePermissionPersistence resourcePermissionPersistence;
2347 @BeanReference(type = ResourceTypePermissionPersistence.class)
2348 protected ResourceTypePermissionPersistence resourceTypePermissionPersistence;
2349 @BeanReference(type = RolePersistence.class)
2350 protected RolePersistence rolePersistence;
2351 @BeanReference(type = ServiceComponentPersistence.class)
2352 protected ServiceComponentPersistence serviceComponentPersistence;
2353 @BeanReference(type = ShardPersistence.class)
2354 protected ShardPersistence shardPersistence;
2355 @BeanReference(type = SubscriptionPersistence.class)
2356 protected SubscriptionPersistence subscriptionPersistence;
2357 @BeanReference(type = TeamPersistence.class)
2358 protected TeamPersistence teamPersistence;
2359 @BeanReference(type = TicketPersistence.class)
2360 protected TicketPersistence ticketPersistence;
2361 @BeanReference(type = UserPersistence.class)
2362 protected UserPersistence userPersistence;
2363 @BeanReference(type = UserGroupPersistence.class)
2364 protected UserGroupPersistence userGroupPersistence;
2365 @BeanReference(type = UserGroupGroupRolePersistence.class)
2366 protected UserGroupGroupRolePersistence userGroupGroupRolePersistence;
2367 @BeanReference(type = UserGroupRolePersistence.class)
2368 protected UserGroupRolePersistence userGroupRolePersistence;
2369 @BeanReference(type = UserIdMapperPersistence.class)
2370 protected UserIdMapperPersistence userIdMapperPersistence;
2371 @BeanReference(type = UserNotificationEventPersistence.class)
2372 protected UserNotificationEventPersistence userNotificationEventPersistence;
2373 @BeanReference(type = UserTrackerPersistence.class)
2374 protected UserTrackerPersistence userTrackerPersistence;
2375 @BeanReference(type = UserTrackerPathPersistence.class)
2376 protected UserTrackerPathPersistence userTrackerPathPersistence;
2377 @BeanReference(type = VirtualHostPersistence.class)
2378 protected VirtualHostPersistence virtualHostPersistence;
2379 @BeanReference(type = WebDAVPropsPersistence.class)
2380 protected WebDAVPropsPersistence webDAVPropsPersistence;
2381 @BeanReference(type = WebsitePersistence.class)
2382 protected WebsitePersistence websitePersistence;
2383 @BeanReference(type = WorkflowDefinitionLinkPersistence.class)
2384 protected WorkflowDefinitionLinkPersistence workflowDefinitionLinkPersistence;
2385 @BeanReference(type = WorkflowInstanceLinkPersistence.class)
2386 protected WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence;
2387 private static final String _SQL_SELECT_LAYOUTBRANCH = "SELECT layoutBranch FROM LayoutBranch layoutBranch";
2388 private static final String _SQL_SELECT_LAYOUTBRANCH_WHERE = "SELECT layoutBranch FROM LayoutBranch layoutBranch WHERE ";
2389 private static final String _SQL_COUNT_LAYOUTBRANCH = "SELECT COUNT(layoutBranch) FROM LayoutBranch layoutBranch";
2390 private static final String _SQL_COUNT_LAYOUTBRANCH_WHERE = "SELECT COUNT(layoutBranch) FROM LayoutBranch layoutBranch WHERE ";
2391 private static final String _FINDER_COLUMN_LAYOUTSETBRANCHID_LAYOUTSETBRANCHID_2 =
2392 "layoutBranch.layoutSetBranchId = ?";
2393 private static final String _FINDER_COLUMN_L_P_LAYOUTSETBRANCHID_2 = "layoutBranch.layoutSetBranchId = ? AND ";
2394 private static final String _FINDER_COLUMN_L_P_PLID_2 = "layoutBranch.plid = ?";
2395 private static final String _FINDER_COLUMN_L_P_N_LAYOUTSETBRANCHID_2 = "layoutBranch.layoutSetBranchId = ? AND ";
2396 private static final String _FINDER_COLUMN_L_P_N_PLID_2 = "layoutBranch.plid = ? AND ";
2397 private static final String _FINDER_COLUMN_L_P_N_NAME_1 = "layoutBranch.name IS NULL";
2398 private static final String _FINDER_COLUMN_L_P_N_NAME_2 = "layoutBranch.name = ?";
2399 private static final String _FINDER_COLUMN_L_P_N_NAME_3 = "(layoutBranch.name IS NULL OR layoutBranch.name = ?)";
2400 private static final String _FINDER_COLUMN_L_P_M_LAYOUTSETBRANCHID_2 = "layoutBranch.layoutSetBranchId = ? AND ";
2401 private static final String _FINDER_COLUMN_L_P_M_PLID_2 = "layoutBranch.plid = ? AND ";
2402 private static final String _FINDER_COLUMN_L_P_M_MASTER_2 = "layoutBranch.master = ?";
2403 private static final String _ORDER_BY_ENTITY_ALIAS = "layoutBranch.";
2404 private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No LayoutBranch exists with the primary key ";
2405 private static final String _NO_SUCH_ENTITY_WITH_KEY = "No LayoutBranch exists with the key {";
2406 private static final boolean _HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE = com.liferay.portal.util.PropsValues.HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE;
2407 private static Log _log = LogFactoryUtil.getLog(LayoutBranchPersistenceImpl.class);
2408 private static LayoutBranch _nullLayoutBranch = new LayoutBranchImpl() {
2409 @Override
2410 public Object clone() {
2411 return this;
2412 }
2413
2414 @Override
2415 public CacheModel<LayoutBranch> toCacheModel() {
2416 return _nullLayoutBranchCacheModel;
2417 }
2418 };
2419
2420 private static CacheModel<LayoutBranch> _nullLayoutBranchCacheModel = new CacheModel<LayoutBranch>() {
2421 public LayoutBranch toEntityModel() {
2422 return _nullLayoutBranch;
2423 }
2424 };
2425 }