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 BatchSessionUtil.delete(session, layoutBranch);
351 }
352 catch (Exception e) {
353 throw processException(e);
354 }
355 finally {
356 closeSession(session);
357 }
358
359 clearCache(layoutBranch);
360
361 return layoutBranch;
362 }
363
364 @Override
365 public LayoutBranch updateImpl(
366 com.liferay.portal.model.LayoutBranch layoutBranch, boolean merge)
367 throws SystemException {
368 layoutBranch = toUnwrappedModel(layoutBranch);
369
370 boolean isNew = layoutBranch.isNew();
371
372 LayoutBranchModelImpl layoutBranchModelImpl = (LayoutBranchModelImpl)layoutBranch;
373
374 Session session = null;
375
376 try {
377 session = openSession();
378
379 BatchSessionUtil.update(session, layoutBranch, merge);
380
381 layoutBranch.setNew(false);
382 }
383 catch (Exception e) {
384 throw processException(e);
385 }
386 finally {
387 closeSession(session);
388 }
389
390 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
391
392 if (isNew || !LayoutBranchModelImpl.COLUMN_BITMASK_ENABLED) {
393 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
394 }
395
396 else {
397 if ((layoutBranchModelImpl.getColumnBitmask() &
398 FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_LAYOUTSETBRANCHID.getColumnBitmask()) != 0) {
399 Object[] args = new Object[] {
400 Long.valueOf(layoutBranchModelImpl.getOriginalLayoutSetBranchId())
401 };
402
403 FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_LAYOUTSETBRANCHID,
404 args);
405 FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_LAYOUTSETBRANCHID,
406 args);
407
408 args = new Object[] {
409 Long.valueOf(layoutBranchModelImpl.getLayoutSetBranchId())
410 };
411
412 FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_LAYOUTSETBRANCHID,
413 args);
414 FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_LAYOUTSETBRANCHID,
415 args);
416 }
417
418 if ((layoutBranchModelImpl.getColumnBitmask() &
419 FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_L_P.getColumnBitmask()) != 0) {
420 Object[] args = new Object[] {
421 Long.valueOf(layoutBranchModelImpl.getOriginalLayoutSetBranchId()),
422 Long.valueOf(layoutBranchModelImpl.getOriginalPlid())
423 };
424
425 FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_L_P, args);
426 FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_L_P,
427 args);
428
429 args = new Object[] {
430 Long.valueOf(layoutBranchModelImpl.getLayoutSetBranchId()),
431 Long.valueOf(layoutBranchModelImpl.getPlid())
432 };
433
434 FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_L_P, args);
435 FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_L_P,
436 args);
437 }
438 }
439
440 EntityCacheUtil.putResult(LayoutBranchModelImpl.ENTITY_CACHE_ENABLED,
441 LayoutBranchImpl.class, layoutBranch.getPrimaryKey(), layoutBranch);
442
443 if (isNew) {
444 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_L_P_N,
445 new Object[] {
446 Long.valueOf(layoutBranch.getLayoutSetBranchId()),
447 Long.valueOf(layoutBranch.getPlid()),
448
449 layoutBranch.getName()
450 }, layoutBranch);
451
452 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_L_P_M,
453 new Object[] {
454 Long.valueOf(layoutBranch.getLayoutSetBranchId()),
455 Long.valueOf(layoutBranch.getPlid()),
456 Boolean.valueOf(layoutBranch.getMaster())
457 }, layoutBranch);
458 }
459 else {
460 if ((layoutBranchModelImpl.getColumnBitmask() &
461 FINDER_PATH_FETCH_BY_L_P_N.getColumnBitmask()) != 0) {
462 Object[] args = new Object[] {
463 Long.valueOf(layoutBranchModelImpl.getOriginalLayoutSetBranchId()),
464 Long.valueOf(layoutBranchModelImpl.getOriginalPlid()),
465
466 layoutBranchModelImpl.getOriginalName()
467 };
468
469 FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_L_P_N, args);
470
471 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_L_P_N, args);
472
473 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_L_P_N,
474 new Object[] {
475 Long.valueOf(layoutBranch.getLayoutSetBranchId()),
476 Long.valueOf(layoutBranch.getPlid()),
477
478 layoutBranch.getName()
479 }, layoutBranch);
480 }
481
482 if ((layoutBranchModelImpl.getColumnBitmask() &
483 FINDER_PATH_FETCH_BY_L_P_M.getColumnBitmask()) != 0) {
484 Object[] args = new Object[] {
485 Long.valueOf(layoutBranchModelImpl.getOriginalLayoutSetBranchId()),
486 Long.valueOf(layoutBranchModelImpl.getOriginalPlid()),
487 Boolean.valueOf(layoutBranchModelImpl.getOriginalMaster())
488 };
489
490 FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_L_P_M, args);
491
492 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_L_P_M, args);
493
494 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_L_P_M,
495 new Object[] {
496 Long.valueOf(layoutBranch.getLayoutSetBranchId()),
497 Long.valueOf(layoutBranch.getPlid()),
498 Boolean.valueOf(layoutBranch.getMaster())
499 }, layoutBranch);
500 }
501 }
502
503 return layoutBranch;
504 }
505
506 protected LayoutBranch toUnwrappedModel(LayoutBranch layoutBranch) {
507 if (layoutBranch instanceof LayoutBranchImpl) {
508 return layoutBranch;
509 }
510
511 LayoutBranchImpl layoutBranchImpl = new LayoutBranchImpl();
512
513 layoutBranchImpl.setNew(layoutBranch.isNew());
514 layoutBranchImpl.setPrimaryKey(layoutBranch.getPrimaryKey());
515
516 layoutBranchImpl.setLayoutBranchId(layoutBranch.getLayoutBranchId());
517 layoutBranchImpl.setGroupId(layoutBranch.getGroupId());
518 layoutBranchImpl.setCompanyId(layoutBranch.getCompanyId());
519 layoutBranchImpl.setUserId(layoutBranch.getUserId());
520 layoutBranchImpl.setUserName(layoutBranch.getUserName());
521 layoutBranchImpl.setLayoutSetBranchId(layoutBranch.getLayoutSetBranchId());
522 layoutBranchImpl.setPlid(layoutBranch.getPlid());
523 layoutBranchImpl.setName(layoutBranch.getName());
524 layoutBranchImpl.setDescription(layoutBranch.getDescription());
525 layoutBranchImpl.setMaster(layoutBranch.isMaster());
526
527 return layoutBranchImpl;
528 }
529
530
538 @Override
539 public LayoutBranch findByPrimaryKey(Serializable primaryKey)
540 throws NoSuchModelException, SystemException {
541 return findByPrimaryKey(((Long)primaryKey).longValue());
542 }
543
544
552 public LayoutBranch findByPrimaryKey(long LayoutBranchId)
553 throws NoSuchLayoutBranchException, SystemException {
554 LayoutBranch layoutBranch = fetchByPrimaryKey(LayoutBranchId);
555
556 if (layoutBranch == null) {
557 if (_log.isWarnEnabled()) {
558 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + LayoutBranchId);
559 }
560
561 throw new NoSuchLayoutBranchException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
562 LayoutBranchId);
563 }
564
565 return layoutBranch;
566 }
567
568
575 @Override
576 public LayoutBranch fetchByPrimaryKey(Serializable primaryKey)
577 throws SystemException {
578 return fetchByPrimaryKey(((Long)primaryKey).longValue());
579 }
580
581
588 public LayoutBranch fetchByPrimaryKey(long LayoutBranchId)
589 throws SystemException {
590 LayoutBranch layoutBranch = (LayoutBranch)EntityCacheUtil.getResult(LayoutBranchModelImpl.ENTITY_CACHE_ENABLED,
591 LayoutBranchImpl.class, LayoutBranchId);
592
593 if (layoutBranch == _nullLayoutBranch) {
594 return null;
595 }
596
597 if (layoutBranch == null) {
598 Session session = null;
599
600 boolean hasException = false;
601
602 try {
603 session = openSession();
604
605 layoutBranch = (LayoutBranch)session.get(LayoutBranchImpl.class,
606 Long.valueOf(LayoutBranchId));
607 }
608 catch (Exception e) {
609 hasException = true;
610
611 throw processException(e);
612 }
613 finally {
614 if (layoutBranch != null) {
615 cacheResult(layoutBranch);
616 }
617 else if (!hasException) {
618 EntityCacheUtil.putResult(LayoutBranchModelImpl.ENTITY_CACHE_ENABLED,
619 LayoutBranchImpl.class, LayoutBranchId,
620 _nullLayoutBranch);
621 }
622
623 closeSession(session);
624 }
625 }
626
627 return layoutBranch;
628 }
629
630
637 public List<LayoutBranch> findByLayoutSetBranchId(long layoutSetBranchId)
638 throws SystemException {
639 return findByLayoutSetBranchId(layoutSetBranchId, QueryUtil.ALL_POS,
640 QueryUtil.ALL_POS, null);
641 }
642
643
656 public List<LayoutBranch> findByLayoutSetBranchId(long layoutSetBranchId,
657 int start, int end) throws SystemException {
658 return findByLayoutSetBranchId(layoutSetBranchId, start, end, null);
659 }
660
661
675 public List<LayoutBranch> findByLayoutSetBranchId(long layoutSetBranchId,
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_LAYOUTSETBRANCHID;
684 finderArgs = new Object[] { layoutSetBranchId };
685 }
686 else {
687 finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_LAYOUTSETBRANCHID;
688 finderArgs = new Object[] {
689 layoutSetBranchId,
690
691 start, end, orderByComparator
692 };
693 }
694
695 List<LayoutBranch> list = (List<LayoutBranch>)FinderCacheUtil.getResult(finderPath,
696 finderArgs, this);
697
698 if ((list != null) && !list.isEmpty()) {
699 for (LayoutBranch layoutBranch : list) {
700 if ((layoutSetBranchId != layoutBranch.getLayoutSetBranchId())) {
701 list = null;
702
703 break;
704 }
705 }
706 }
707
708 if (list == null) {
709 StringBundler query = null;
710
711 if (orderByComparator != null) {
712 query = new StringBundler(3 +
713 (orderByComparator.getOrderByFields().length * 3));
714 }
715 else {
716 query = new StringBundler(2);
717 }
718
719 query.append(_SQL_SELECT_LAYOUTBRANCH_WHERE);
720
721 query.append(_FINDER_COLUMN_LAYOUTSETBRANCHID_LAYOUTSETBRANCHID_2);
722
723 if (orderByComparator != null) {
724 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
725 orderByComparator);
726 }
727
728 String sql = query.toString();
729
730 Session session = null;
731
732 try {
733 session = openSession();
734
735 Query q = session.createQuery(sql);
736
737 QueryPos qPos = QueryPos.getInstance(q);
738
739 qPos.add(layoutSetBranchId);
740
741 list = (List<LayoutBranch>)QueryUtil.list(q, getDialect(),
742 start, end);
743 }
744 catch (Exception e) {
745 throw processException(e);
746 }
747 finally {
748 if (list == null) {
749 FinderCacheUtil.removeResult(finderPath, finderArgs);
750 }
751 else {
752 cacheResult(list);
753
754 FinderCacheUtil.putResult(finderPath, finderArgs, list);
755 }
756
757 closeSession(session);
758 }
759 }
760
761 return list;
762 }
763
764
773 public LayoutBranch findByLayoutSetBranchId_First(long layoutSetBranchId,
774 OrderByComparator orderByComparator)
775 throws NoSuchLayoutBranchException, SystemException {
776 LayoutBranch layoutBranch = fetchByLayoutSetBranchId_First(layoutSetBranchId,
777 orderByComparator);
778
779 if (layoutBranch != null) {
780 return layoutBranch;
781 }
782
783 StringBundler msg = new StringBundler(4);
784
785 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
786
787 msg.append("layoutSetBranchId=");
788 msg.append(layoutSetBranchId);
789
790 msg.append(StringPool.CLOSE_CURLY_BRACE);
791
792 throw new NoSuchLayoutBranchException(msg.toString());
793 }
794
795
803 public LayoutBranch fetchByLayoutSetBranchId_First(long layoutSetBranchId,
804 OrderByComparator orderByComparator) throws SystemException {
805 List<LayoutBranch> list = findByLayoutSetBranchId(layoutSetBranchId, 0,
806 1, orderByComparator);
807
808 if (!list.isEmpty()) {
809 return list.get(0);
810 }
811
812 return null;
813 }
814
815
824 public LayoutBranch findByLayoutSetBranchId_Last(long layoutSetBranchId,
825 OrderByComparator orderByComparator)
826 throws NoSuchLayoutBranchException, SystemException {
827 LayoutBranch layoutBranch = fetchByLayoutSetBranchId_Last(layoutSetBranchId,
828 orderByComparator);
829
830 if (layoutBranch != null) {
831 return layoutBranch;
832 }
833
834 StringBundler msg = new StringBundler(4);
835
836 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
837
838 msg.append("layoutSetBranchId=");
839 msg.append(layoutSetBranchId);
840
841 msg.append(StringPool.CLOSE_CURLY_BRACE);
842
843 throw new NoSuchLayoutBranchException(msg.toString());
844 }
845
846
854 public LayoutBranch fetchByLayoutSetBranchId_Last(long layoutSetBranchId,
855 OrderByComparator orderByComparator) throws SystemException {
856 int count = countByLayoutSetBranchId(layoutSetBranchId);
857
858 List<LayoutBranch> list = findByLayoutSetBranchId(layoutSetBranchId,
859 count - 1, count, orderByComparator);
860
861 if (!list.isEmpty()) {
862 return list.get(0);
863 }
864
865 return null;
866 }
867
868
878 public LayoutBranch[] findByLayoutSetBranchId_PrevAndNext(
879 long LayoutBranchId, long layoutSetBranchId,
880 OrderByComparator orderByComparator)
881 throws NoSuchLayoutBranchException, SystemException {
882 LayoutBranch layoutBranch = findByPrimaryKey(LayoutBranchId);
883
884 Session session = null;
885
886 try {
887 session = openSession();
888
889 LayoutBranch[] array = new LayoutBranchImpl[3];
890
891 array[0] = getByLayoutSetBranchId_PrevAndNext(session,
892 layoutBranch, layoutSetBranchId, orderByComparator, true);
893
894 array[1] = layoutBranch;
895
896 array[2] = getByLayoutSetBranchId_PrevAndNext(session,
897 layoutBranch, layoutSetBranchId, orderByComparator, false);
898
899 return array;
900 }
901 catch (Exception e) {
902 throw processException(e);
903 }
904 finally {
905 closeSession(session);
906 }
907 }
908
909 protected LayoutBranch getByLayoutSetBranchId_PrevAndNext(Session session,
910 LayoutBranch layoutBranch, long layoutSetBranchId,
911 OrderByComparator orderByComparator, boolean previous) {
912 StringBundler query = null;
913
914 if (orderByComparator != null) {
915 query = new StringBundler(6 +
916 (orderByComparator.getOrderByFields().length * 6));
917 }
918 else {
919 query = new StringBundler(3);
920 }
921
922 query.append(_SQL_SELECT_LAYOUTBRANCH_WHERE);
923
924 query.append(_FINDER_COLUMN_LAYOUTSETBRANCHID_LAYOUTSETBRANCHID_2);
925
926 if (orderByComparator != null) {
927 String[] orderByConditionFields = orderByComparator.getOrderByConditionFields();
928
929 if (orderByConditionFields.length > 0) {
930 query.append(WHERE_AND);
931 }
932
933 for (int i = 0; i < orderByConditionFields.length; i++) {
934 query.append(_ORDER_BY_ENTITY_ALIAS);
935 query.append(orderByConditionFields[i]);
936
937 if ((i + 1) < orderByConditionFields.length) {
938 if (orderByComparator.isAscending() ^ previous) {
939 query.append(WHERE_GREATER_THAN_HAS_NEXT);
940 }
941 else {
942 query.append(WHERE_LESSER_THAN_HAS_NEXT);
943 }
944 }
945 else {
946 if (orderByComparator.isAscending() ^ previous) {
947 query.append(WHERE_GREATER_THAN);
948 }
949 else {
950 query.append(WHERE_LESSER_THAN);
951 }
952 }
953 }
954
955 query.append(ORDER_BY_CLAUSE);
956
957 String[] orderByFields = orderByComparator.getOrderByFields();
958
959 for (int i = 0; i < orderByFields.length; i++) {
960 query.append(_ORDER_BY_ENTITY_ALIAS);
961 query.append(orderByFields[i]);
962
963 if ((i + 1) < orderByFields.length) {
964 if (orderByComparator.isAscending() ^ previous) {
965 query.append(ORDER_BY_ASC_HAS_NEXT);
966 }
967 else {
968 query.append(ORDER_BY_DESC_HAS_NEXT);
969 }
970 }
971 else {
972 if (orderByComparator.isAscending() ^ previous) {
973 query.append(ORDER_BY_ASC);
974 }
975 else {
976 query.append(ORDER_BY_DESC);
977 }
978 }
979 }
980 }
981
982 String sql = query.toString();
983
984 Query q = session.createQuery(sql);
985
986 q.setFirstResult(0);
987 q.setMaxResults(2);
988
989 QueryPos qPos = QueryPos.getInstance(q);
990
991 qPos.add(layoutSetBranchId);
992
993 if (orderByComparator != null) {
994 Object[] values = orderByComparator.getOrderByConditionValues(layoutBranch);
995
996 for (Object value : values) {
997 qPos.add(value);
998 }
999 }
1000
1001 List<LayoutBranch> list = q.list();
1002
1003 if (list.size() == 2) {
1004 return list.get(1);
1005 }
1006 else {
1007 return null;
1008 }
1009 }
1010
1011
1019 public List<LayoutBranch> findByL_P(long layoutSetBranchId, long plid)
1020 throws SystemException {
1021 return findByL_P(layoutSetBranchId, plid, QueryUtil.ALL_POS,
1022 QueryUtil.ALL_POS, null);
1023 }
1024
1025
1039 public List<LayoutBranch> findByL_P(long layoutSetBranchId, long plid,
1040 int start, int end) throws SystemException {
1041 return findByL_P(layoutSetBranchId, plid, start, end, null);
1042 }
1043
1044
1059 public List<LayoutBranch> findByL_P(long layoutSetBranchId, long plid,
1060 int start, int end, OrderByComparator orderByComparator)
1061 throws SystemException {
1062 FinderPath finderPath = null;
1063 Object[] finderArgs = null;
1064
1065 if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
1066 (orderByComparator == null)) {
1067 finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_L_P;
1068 finderArgs = new Object[] { layoutSetBranchId, plid };
1069 }
1070 else {
1071 finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_L_P;
1072 finderArgs = new Object[] {
1073 layoutSetBranchId, plid,
1074
1075 start, end, orderByComparator
1076 };
1077 }
1078
1079 List<LayoutBranch> list = (List<LayoutBranch>)FinderCacheUtil.getResult(finderPath,
1080 finderArgs, this);
1081
1082 if ((list != null) && !list.isEmpty()) {
1083 for (LayoutBranch layoutBranch : list) {
1084 if ((layoutSetBranchId != layoutBranch.getLayoutSetBranchId()) ||
1085 (plid != layoutBranch.getPlid())) {
1086 list = null;
1087
1088 break;
1089 }
1090 }
1091 }
1092
1093 if (list == null) {
1094 StringBundler query = null;
1095
1096 if (orderByComparator != null) {
1097 query = new StringBundler(4 +
1098 (orderByComparator.getOrderByFields().length * 3));
1099 }
1100 else {
1101 query = new StringBundler(3);
1102 }
1103
1104 query.append(_SQL_SELECT_LAYOUTBRANCH_WHERE);
1105
1106 query.append(_FINDER_COLUMN_L_P_LAYOUTSETBRANCHID_2);
1107
1108 query.append(_FINDER_COLUMN_L_P_PLID_2);
1109
1110 if (orderByComparator != null) {
1111 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
1112 orderByComparator);
1113 }
1114
1115 String sql = query.toString();
1116
1117 Session session = null;
1118
1119 try {
1120 session = openSession();
1121
1122 Query q = session.createQuery(sql);
1123
1124 QueryPos qPos = QueryPos.getInstance(q);
1125
1126 qPos.add(layoutSetBranchId);
1127
1128 qPos.add(plid);
1129
1130 list = (List<LayoutBranch>)QueryUtil.list(q, getDialect(),
1131 start, end);
1132 }
1133 catch (Exception e) {
1134 throw processException(e);
1135 }
1136 finally {
1137 if (list == null) {
1138 FinderCacheUtil.removeResult(finderPath, finderArgs);
1139 }
1140 else {
1141 cacheResult(list);
1142
1143 FinderCacheUtil.putResult(finderPath, finderArgs, list);
1144 }
1145
1146 closeSession(session);
1147 }
1148 }
1149
1150 return list;
1151 }
1152
1153
1163 public LayoutBranch findByL_P_First(long layoutSetBranchId, long plid,
1164 OrderByComparator orderByComparator)
1165 throws NoSuchLayoutBranchException, SystemException {
1166 LayoutBranch layoutBranch = fetchByL_P_First(layoutSetBranchId, plid,
1167 orderByComparator);
1168
1169 if (layoutBranch != null) {
1170 return layoutBranch;
1171 }
1172
1173 StringBundler msg = new StringBundler(6);
1174
1175 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1176
1177 msg.append("layoutSetBranchId=");
1178 msg.append(layoutSetBranchId);
1179
1180 msg.append(", plid=");
1181 msg.append(plid);
1182
1183 msg.append(StringPool.CLOSE_CURLY_BRACE);
1184
1185 throw new NoSuchLayoutBranchException(msg.toString());
1186 }
1187
1188
1197 public LayoutBranch fetchByL_P_First(long layoutSetBranchId, long plid,
1198 OrderByComparator orderByComparator) throws SystemException {
1199 List<LayoutBranch> list = findByL_P(layoutSetBranchId, plid, 0, 1,
1200 orderByComparator);
1201
1202 if (!list.isEmpty()) {
1203 return list.get(0);
1204 }
1205
1206 return null;
1207 }
1208
1209
1219 public LayoutBranch findByL_P_Last(long layoutSetBranchId, long plid,
1220 OrderByComparator orderByComparator)
1221 throws NoSuchLayoutBranchException, SystemException {
1222 LayoutBranch layoutBranch = fetchByL_P_Last(layoutSetBranchId, plid,
1223 orderByComparator);
1224
1225 if (layoutBranch != null) {
1226 return layoutBranch;
1227 }
1228
1229 StringBundler msg = new StringBundler(6);
1230
1231 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1232
1233 msg.append("layoutSetBranchId=");
1234 msg.append(layoutSetBranchId);
1235
1236 msg.append(", plid=");
1237 msg.append(plid);
1238
1239 msg.append(StringPool.CLOSE_CURLY_BRACE);
1240
1241 throw new NoSuchLayoutBranchException(msg.toString());
1242 }
1243
1244
1253 public LayoutBranch fetchByL_P_Last(long layoutSetBranchId, long plid,
1254 OrderByComparator orderByComparator) throws SystemException {
1255 int count = countByL_P(layoutSetBranchId, plid);
1256
1257 List<LayoutBranch> list = findByL_P(layoutSetBranchId, plid, count - 1,
1258 count, orderByComparator);
1259
1260 if (!list.isEmpty()) {
1261 return list.get(0);
1262 }
1263
1264 return null;
1265 }
1266
1267
1278 public LayoutBranch[] findByL_P_PrevAndNext(long LayoutBranchId,
1279 long layoutSetBranchId, long plid, OrderByComparator orderByComparator)
1280 throws NoSuchLayoutBranchException, SystemException {
1281 LayoutBranch layoutBranch = findByPrimaryKey(LayoutBranchId);
1282
1283 Session session = null;
1284
1285 try {
1286 session = openSession();
1287
1288 LayoutBranch[] array = new LayoutBranchImpl[3];
1289
1290 array[0] = getByL_P_PrevAndNext(session, layoutBranch,
1291 layoutSetBranchId, plid, orderByComparator, true);
1292
1293 array[1] = layoutBranch;
1294
1295 array[2] = getByL_P_PrevAndNext(session, layoutBranch,
1296 layoutSetBranchId, plid, orderByComparator, false);
1297
1298 return array;
1299 }
1300 catch (Exception e) {
1301 throw processException(e);
1302 }
1303 finally {
1304 closeSession(session);
1305 }
1306 }
1307
1308 protected LayoutBranch getByL_P_PrevAndNext(Session session,
1309 LayoutBranch layoutBranch, long layoutSetBranchId, long plid,
1310 OrderByComparator orderByComparator, boolean previous) {
1311 StringBundler query = null;
1312
1313 if (orderByComparator != null) {
1314 query = new StringBundler(6 +
1315 (orderByComparator.getOrderByFields().length * 6));
1316 }
1317 else {
1318 query = new StringBundler(3);
1319 }
1320
1321 query.append(_SQL_SELECT_LAYOUTBRANCH_WHERE);
1322
1323 query.append(_FINDER_COLUMN_L_P_LAYOUTSETBRANCHID_2);
1324
1325 query.append(_FINDER_COLUMN_L_P_PLID_2);
1326
1327 if (orderByComparator != null) {
1328 String[] orderByConditionFields = orderByComparator.getOrderByConditionFields();
1329
1330 if (orderByConditionFields.length > 0) {
1331 query.append(WHERE_AND);
1332 }
1333
1334 for (int i = 0; i < orderByConditionFields.length; i++) {
1335 query.append(_ORDER_BY_ENTITY_ALIAS);
1336 query.append(orderByConditionFields[i]);
1337
1338 if ((i + 1) < orderByConditionFields.length) {
1339 if (orderByComparator.isAscending() ^ previous) {
1340 query.append(WHERE_GREATER_THAN_HAS_NEXT);
1341 }
1342 else {
1343 query.append(WHERE_LESSER_THAN_HAS_NEXT);
1344 }
1345 }
1346 else {
1347 if (orderByComparator.isAscending() ^ previous) {
1348 query.append(WHERE_GREATER_THAN);
1349 }
1350 else {
1351 query.append(WHERE_LESSER_THAN);
1352 }
1353 }
1354 }
1355
1356 query.append(ORDER_BY_CLAUSE);
1357
1358 String[] orderByFields = orderByComparator.getOrderByFields();
1359
1360 for (int i = 0; i < orderByFields.length; i++) {
1361 query.append(_ORDER_BY_ENTITY_ALIAS);
1362 query.append(orderByFields[i]);
1363
1364 if ((i + 1) < orderByFields.length) {
1365 if (orderByComparator.isAscending() ^ previous) {
1366 query.append(ORDER_BY_ASC_HAS_NEXT);
1367 }
1368 else {
1369 query.append(ORDER_BY_DESC_HAS_NEXT);
1370 }
1371 }
1372 else {
1373 if (orderByComparator.isAscending() ^ previous) {
1374 query.append(ORDER_BY_ASC);
1375 }
1376 else {
1377 query.append(ORDER_BY_DESC);
1378 }
1379 }
1380 }
1381 }
1382
1383 String sql = query.toString();
1384
1385 Query q = session.createQuery(sql);
1386
1387 q.setFirstResult(0);
1388 q.setMaxResults(2);
1389
1390 QueryPos qPos = QueryPos.getInstance(q);
1391
1392 qPos.add(layoutSetBranchId);
1393
1394 qPos.add(plid);
1395
1396 if (orderByComparator != null) {
1397 Object[] values = orderByComparator.getOrderByConditionValues(layoutBranch);
1398
1399 for (Object value : values) {
1400 qPos.add(value);
1401 }
1402 }
1403
1404 List<LayoutBranch> list = q.list();
1405
1406 if (list.size() == 2) {
1407 return list.get(1);
1408 }
1409 else {
1410 return null;
1411 }
1412 }
1413
1414
1424 public LayoutBranch findByL_P_N(long layoutSetBranchId, long plid,
1425 String name) throws NoSuchLayoutBranchException, SystemException {
1426 LayoutBranch layoutBranch = fetchByL_P_N(layoutSetBranchId, plid, name);
1427
1428 if (layoutBranch == null) {
1429 StringBundler msg = new StringBundler(8);
1430
1431 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1432
1433 msg.append("layoutSetBranchId=");
1434 msg.append(layoutSetBranchId);
1435
1436 msg.append(", plid=");
1437 msg.append(plid);
1438
1439 msg.append(", name=");
1440 msg.append(name);
1441
1442 msg.append(StringPool.CLOSE_CURLY_BRACE);
1443
1444 if (_log.isWarnEnabled()) {
1445 _log.warn(msg.toString());
1446 }
1447
1448 throw new NoSuchLayoutBranchException(msg.toString());
1449 }
1450
1451 return layoutBranch;
1452 }
1453
1454
1463 public LayoutBranch fetchByL_P_N(long layoutSetBranchId, long plid,
1464 String name) throws SystemException {
1465 return fetchByL_P_N(layoutSetBranchId, plid, name, true);
1466 }
1467
1468
1478 public LayoutBranch fetchByL_P_N(long layoutSetBranchId, long plid,
1479 String name, boolean retrieveFromCache) throws SystemException {
1480 Object[] finderArgs = new Object[] { layoutSetBranchId, plid, name };
1481
1482 Object result = null;
1483
1484 if (retrieveFromCache) {
1485 result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_L_P_N,
1486 finderArgs, this);
1487 }
1488
1489 if (result instanceof LayoutBranch) {
1490 LayoutBranch layoutBranch = (LayoutBranch)result;
1491
1492 if ((layoutSetBranchId != layoutBranch.getLayoutSetBranchId()) ||
1493 (plid != layoutBranch.getPlid()) ||
1494 !Validator.equals(name, layoutBranch.getName())) {
1495 result = null;
1496 }
1497 }
1498
1499 if (result == null) {
1500 StringBundler query = new StringBundler(4);
1501
1502 query.append(_SQL_SELECT_LAYOUTBRANCH_WHERE);
1503
1504 query.append(_FINDER_COLUMN_L_P_N_LAYOUTSETBRANCHID_2);
1505
1506 query.append(_FINDER_COLUMN_L_P_N_PLID_2);
1507
1508 if (name == null) {
1509 query.append(_FINDER_COLUMN_L_P_N_NAME_1);
1510 }
1511 else {
1512 if (name.equals(StringPool.BLANK)) {
1513 query.append(_FINDER_COLUMN_L_P_N_NAME_3);
1514 }
1515 else {
1516 query.append(_FINDER_COLUMN_L_P_N_NAME_2);
1517 }
1518 }
1519
1520 String sql = query.toString();
1521
1522 Session session = null;
1523
1524 try {
1525 session = openSession();
1526
1527 Query q = session.createQuery(sql);
1528
1529 QueryPos qPos = QueryPos.getInstance(q);
1530
1531 qPos.add(layoutSetBranchId);
1532
1533 qPos.add(plid);
1534
1535 if (name != null) {
1536 qPos.add(name);
1537 }
1538
1539 List<LayoutBranch> list = q.list();
1540
1541 result = list;
1542
1543 LayoutBranch layoutBranch = null;
1544
1545 if (list.isEmpty()) {
1546 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_L_P_N,
1547 finderArgs, list);
1548 }
1549 else {
1550 layoutBranch = list.get(0);
1551
1552 cacheResult(layoutBranch);
1553
1554 if ((layoutBranch.getLayoutSetBranchId() != layoutSetBranchId) ||
1555 (layoutBranch.getPlid() != plid) ||
1556 (layoutBranch.getName() == null) ||
1557 !layoutBranch.getName().equals(name)) {
1558 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_L_P_N,
1559 finderArgs, layoutBranch);
1560 }
1561 }
1562
1563 return layoutBranch;
1564 }
1565 catch (Exception e) {
1566 throw processException(e);
1567 }
1568 finally {
1569 if (result == null) {
1570 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_L_P_N,
1571 finderArgs);
1572 }
1573
1574 closeSession(session);
1575 }
1576 }
1577 else {
1578 if (result instanceof List<?>) {
1579 return null;
1580 }
1581 else {
1582 return (LayoutBranch)result;
1583 }
1584 }
1585 }
1586
1587
1597 public LayoutBranch findByL_P_M(long layoutSetBranchId, long plid,
1598 boolean master) throws NoSuchLayoutBranchException, SystemException {
1599 LayoutBranch layoutBranch = fetchByL_P_M(layoutSetBranchId, plid, master);
1600
1601 if (layoutBranch == null) {
1602 StringBundler msg = new StringBundler(8);
1603
1604 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1605
1606 msg.append("layoutSetBranchId=");
1607 msg.append(layoutSetBranchId);
1608
1609 msg.append(", plid=");
1610 msg.append(plid);
1611
1612 msg.append(", master=");
1613 msg.append(master);
1614
1615 msg.append(StringPool.CLOSE_CURLY_BRACE);
1616
1617 if (_log.isWarnEnabled()) {
1618 _log.warn(msg.toString());
1619 }
1620
1621 throw new NoSuchLayoutBranchException(msg.toString());
1622 }
1623
1624 return layoutBranch;
1625 }
1626
1627
1636 public LayoutBranch fetchByL_P_M(long layoutSetBranchId, long plid,
1637 boolean master) throws SystemException {
1638 return fetchByL_P_M(layoutSetBranchId, plid, master, true);
1639 }
1640
1641
1651 public LayoutBranch fetchByL_P_M(long layoutSetBranchId, long plid,
1652 boolean master, boolean retrieveFromCache) throws SystemException {
1653 Object[] finderArgs = new Object[] { layoutSetBranchId, plid, master };
1654
1655 Object result = null;
1656
1657 if (retrieveFromCache) {
1658 result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_L_P_M,
1659 finderArgs, this);
1660 }
1661
1662 if (result instanceof LayoutBranch) {
1663 LayoutBranch layoutBranch = (LayoutBranch)result;
1664
1665 if ((layoutSetBranchId != layoutBranch.getLayoutSetBranchId()) ||
1666 (plid != layoutBranch.getPlid()) ||
1667 (master != layoutBranch.getMaster())) {
1668 result = null;
1669 }
1670 }
1671
1672 if (result == null) {
1673 StringBundler query = new StringBundler(4);
1674
1675 query.append(_SQL_SELECT_LAYOUTBRANCH_WHERE);
1676
1677 query.append(_FINDER_COLUMN_L_P_M_LAYOUTSETBRANCHID_2);
1678
1679 query.append(_FINDER_COLUMN_L_P_M_PLID_2);
1680
1681 query.append(_FINDER_COLUMN_L_P_M_MASTER_2);
1682
1683 String sql = query.toString();
1684
1685 Session session = null;
1686
1687 try {
1688 session = openSession();
1689
1690 Query q = session.createQuery(sql);
1691
1692 QueryPos qPos = QueryPos.getInstance(q);
1693
1694 qPos.add(layoutSetBranchId);
1695
1696 qPos.add(plid);
1697
1698 qPos.add(master);
1699
1700 List<LayoutBranch> list = q.list();
1701
1702 result = list;
1703
1704 LayoutBranch layoutBranch = null;
1705
1706 if (list.isEmpty()) {
1707 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_L_P_M,
1708 finderArgs, list);
1709 }
1710 else {
1711 layoutBranch = list.get(0);
1712
1713 cacheResult(layoutBranch);
1714
1715 if ((layoutBranch.getLayoutSetBranchId() != layoutSetBranchId) ||
1716 (layoutBranch.getPlid() != plid) ||
1717 (layoutBranch.getMaster() != master)) {
1718 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_L_P_M,
1719 finderArgs, layoutBranch);
1720 }
1721 }
1722
1723 return layoutBranch;
1724 }
1725 catch (Exception e) {
1726 throw processException(e);
1727 }
1728 finally {
1729 if (result == null) {
1730 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_L_P_M,
1731 finderArgs);
1732 }
1733
1734 closeSession(session);
1735 }
1736 }
1737 else {
1738 if (result instanceof List<?>) {
1739 return null;
1740 }
1741 else {
1742 return (LayoutBranch)result;
1743 }
1744 }
1745 }
1746
1747
1753 public List<LayoutBranch> findAll() throws SystemException {
1754 return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
1755 }
1756
1757
1769 public List<LayoutBranch> findAll(int start, int end)
1770 throws SystemException {
1771 return findAll(start, end, null);
1772 }
1773
1774
1787 public List<LayoutBranch> findAll(int start, int end,
1788 OrderByComparator orderByComparator) throws SystemException {
1789 FinderPath finderPath = null;
1790 Object[] finderArgs = new Object[] { start, end, orderByComparator };
1791
1792 if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
1793 (orderByComparator == null)) {
1794 finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL;
1795 finderArgs = FINDER_ARGS_EMPTY;
1796 }
1797 else {
1798 finderPath = FINDER_PATH_WITH_PAGINATION_FIND_ALL;
1799 finderArgs = new Object[] { start, end, orderByComparator };
1800 }
1801
1802 List<LayoutBranch> list = (List<LayoutBranch>)FinderCacheUtil.getResult(finderPath,
1803 finderArgs, this);
1804
1805 if (list == null) {
1806 StringBundler query = null;
1807 String sql = null;
1808
1809 if (orderByComparator != null) {
1810 query = new StringBundler(2 +
1811 (orderByComparator.getOrderByFields().length * 3));
1812
1813 query.append(_SQL_SELECT_LAYOUTBRANCH);
1814
1815 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
1816 orderByComparator);
1817
1818 sql = query.toString();
1819 }
1820 else {
1821 sql = _SQL_SELECT_LAYOUTBRANCH;
1822 }
1823
1824 Session session = null;
1825
1826 try {
1827 session = openSession();
1828
1829 Query q = session.createQuery(sql);
1830
1831 if (orderByComparator == null) {
1832 list = (List<LayoutBranch>)QueryUtil.list(q, getDialect(),
1833 start, end, false);
1834
1835 Collections.sort(list);
1836 }
1837 else {
1838 list = (List<LayoutBranch>)QueryUtil.list(q, getDialect(),
1839 start, end);
1840 }
1841 }
1842 catch (Exception e) {
1843 throw processException(e);
1844 }
1845 finally {
1846 if (list == null) {
1847 FinderCacheUtil.removeResult(finderPath, finderArgs);
1848 }
1849 else {
1850 cacheResult(list);
1851
1852 FinderCacheUtil.putResult(finderPath, finderArgs, list);
1853 }
1854
1855 closeSession(session);
1856 }
1857 }
1858
1859 return list;
1860 }
1861
1862
1868 public void removeByLayoutSetBranchId(long layoutSetBranchId)
1869 throws SystemException {
1870 for (LayoutBranch layoutBranch : findByLayoutSetBranchId(
1871 layoutSetBranchId)) {
1872 remove(layoutBranch);
1873 }
1874 }
1875
1876
1883 public void removeByL_P(long layoutSetBranchId, long plid)
1884 throws SystemException {
1885 for (LayoutBranch layoutBranch : findByL_P(layoutSetBranchId, plid)) {
1886 remove(layoutBranch);
1887 }
1888 }
1889
1890
1899 public LayoutBranch removeByL_P_N(long layoutSetBranchId, long plid,
1900 String name) throws NoSuchLayoutBranchException, SystemException {
1901 LayoutBranch layoutBranch = findByL_P_N(layoutSetBranchId, plid, name);
1902
1903 return remove(layoutBranch);
1904 }
1905
1906
1915 public LayoutBranch removeByL_P_M(long layoutSetBranchId, long plid,
1916 boolean master) throws NoSuchLayoutBranchException, SystemException {
1917 LayoutBranch layoutBranch = findByL_P_M(layoutSetBranchId, plid, master);
1918
1919 return remove(layoutBranch);
1920 }
1921
1922
1927 public void removeAll() throws SystemException {
1928 for (LayoutBranch layoutBranch : findAll()) {
1929 remove(layoutBranch);
1930 }
1931 }
1932
1933
1940 public int countByLayoutSetBranchId(long layoutSetBranchId)
1941 throws SystemException {
1942 Object[] finderArgs = new Object[] { layoutSetBranchId };
1943
1944 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_LAYOUTSETBRANCHID,
1945 finderArgs, this);
1946
1947 if (count == null) {
1948 StringBundler query = new StringBundler(2);
1949
1950 query.append(_SQL_COUNT_LAYOUTBRANCH_WHERE);
1951
1952 query.append(_FINDER_COLUMN_LAYOUTSETBRANCHID_LAYOUTSETBRANCHID_2);
1953
1954 String sql = query.toString();
1955
1956 Session session = null;
1957
1958 try {
1959 session = openSession();
1960
1961 Query q = session.createQuery(sql);
1962
1963 QueryPos qPos = QueryPos.getInstance(q);
1964
1965 qPos.add(layoutSetBranchId);
1966
1967 count = (Long)q.uniqueResult();
1968 }
1969 catch (Exception e) {
1970 throw processException(e);
1971 }
1972 finally {
1973 if (count == null) {
1974 count = Long.valueOf(0);
1975 }
1976
1977 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_LAYOUTSETBRANCHID,
1978 finderArgs, count);
1979
1980 closeSession(session);
1981 }
1982 }
1983
1984 return count.intValue();
1985 }
1986
1987
1995 public int countByL_P(long layoutSetBranchId, long plid)
1996 throws SystemException {
1997 Object[] finderArgs = new Object[] { layoutSetBranchId, plid };
1998
1999 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_L_P,
2000 finderArgs, this);
2001
2002 if (count == null) {
2003 StringBundler query = new StringBundler(3);
2004
2005 query.append(_SQL_COUNT_LAYOUTBRANCH_WHERE);
2006
2007 query.append(_FINDER_COLUMN_L_P_LAYOUTSETBRANCHID_2);
2008
2009 query.append(_FINDER_COLUMN_L_P_PLID_2);
2010
2011 String sql = query.toString();
2012
2013 Session session = null;
2014
2015 try {
2016 session = openSession();
2017
2018 Query q = session.createQuery(sql);
2019
2020 QueryPos qPos = QueryPos.getInstance(q);
2021
2022 qPos.add(layoutSetBranchId);
2023
2024 qPos.add(plid);
2025
2026 count = (Long)q.uniqueResult();
2027 }
2028 catch (Exception e) {
2029 throw processException(e);
2030 }
2031 finally {
2032 if (count == null) {
2033 count = Long.valueOf(0);
2034 }
2035
2036 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_L_P, finderArgs,
2037 count);
2038
2039 closeSession(session);
2040 }
2041 }
2042
2043 return count.intValue();
2044 }
2045
2046
2055 public int countByL_P_N(long layoutSetBranchId, long plid, String name)
2056 throws SystemException {
2057 Object[] finderArgs = new Object[] { layoutSetBranchId, plid, name };
2058
2059 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_L_P_N,
2060 finderArgs, this);
2061
2062 if (count == null) {
2063 StringBundler query = new StringBundler(4);
2064
2065 query.append(_SQL_COUNT_LAYOUTBRANCH_WHERE);
2066
2067 query.append(_FINDER_COLUMN_L_P_N_LAYOUTSETBRANCHID_2);
2068
2069 query.append(_FINDER_COLUMN_L_P_N_PLID_2);
2070
2071 if (name == null) {
2072 query.append(_FINDER_COLUMN_L_P_N_NAME_1);
2073 }
2074 else {
2075 if (name.equals(StringPool.BLANK)) {
2076 query.append(_FINDER_COLUMN_L_P_N_NAME_3);
2077 }
2078 else {
2079 query.append(_FINDER_COLUMN_L_P_N_NAME_2);
2080 }
2081 }
2082
2083 String sql = query.toString();
2084
2085 Session session = null;
2086
2087 try {
2088 session = openSession();
2089
2090 Query q = session.createQuery(sql);
2091
2092 QueryPos qPos = QueryPos.getInstance(q);
2093
2094 qPos.add(layoutSetBranchId);
2095
2096 qPos.add(plid);
2097
2098 if (name != null) {
2099 qPos.add(name);
2100 }
2101
2102 count = (Long)q.uniqueResult();
2103 }
2104 catch (Exception e) {
2105 throw processException(e);
2106 }
2107 finally {
2108 if (count == null) {
2109 count = Long.valueOf(0);
2110 }
2111
2112 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_L_P_N,
2113 finderArgs, count);
2114
2115 closeSession(session);
2116 }
2117 }
2118
2119 return count.intValue();
2120 }
2121
2122
2131 public int countByL_P_M(long layoutSetBranchId, long plid, boolean master)
2132 throws SystemException {
2133 Object[] finderArgs = new Object[] { layoutSetBranchId, plid, master };
2134
2135 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_L_P_M,
2136 finderArgs, this);
2137
2138 if (count == null) {
2139 StringBundler query = new StringBundler(4);
2140
2141 query.append(_SQL_COUNT_LAYOUTBRANCH_WHERE);
2142
2143 query.append(_FINDER_COLUMN_L_P_M_LAYOUTSETBRANCHID_2);
2144
2145 query.append(_FINDER_COLUMN_L_P_M_PLID_2);
2146
2147 query.append(_FINDER_COLUMN_L_P_M_MASTER_2);
2148
2149 String sql = query.toString();
2150
2151 Session session = null;
2152
2153 try {
2154 session = openSession();
2155
2156 Query q = session.createQuery(sql);
2157
2158 QueryPos qPos = QueryPos.getInstance(q);
2159
2160 qPos.add(layoutSetBranchId);
2161
2162 qPos.add(plid);
2163
2164 qPos.add(master);
2165
2166 count = (Long)q.uniqueResult();
2167 }
2168 catch (Exception e) {
2169 throw processException(e);
2170 }
2171 finally {
2172 if (count == null) {
2173 count = Long.valueOf(0);
2174 }
2175
2176 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_L_P_M,
2177 finderArgs, count);
2178
2179 closeSession(session);
2180 }
2181 }
2182
2183 return count.intValue();
2184 }
2185
2186
2192 public int countAll() throws SystemException {
2193 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
2194 FINDER_ARGS_EMPTY, this);
2195
2196 if (count == null) {
2197 Session session = null;
2198
2199 try {
2200 session = openSession();
2201
2202 Query q = session.createQuery(_SQL_COUNT_LAYOUTBRANCH);
2203
2204 count = (Long)q.uniqueResult();
2205 }
2206 catch (Exception e) {
2207 throw processException(e);
2208 }
2209 finally {
2210 if (count == null) {
2211 count = Long.valueOf(0);
2212 }
2213
2214 FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL,
2215 FINDER_ARGS_EMPTY, count);
2216
2217 closeSession(session);
2218 }
2219 }
2220
2221 return count.intValue();
2222 }
2223
2224
2227 public void afterPropertiesSet() {
2228 String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
2229 com.liferay.portal.util.PropsUtil.get(
2230 "value.object.listener.com.liferay.portal.model.LayoutBranch")));
2231
2232 if (listenerClassNames.length > 0) {
2233 try {
2234 List<ModelListener<LayoutBranch>> listenersList = new ArrayList<ModelListener<LayoutBranch>>();
2235
2236 for (String listenerClassName : listenerClassNames) {
2237 listenersList.add((ModelListener<LayoutBranch>)InstanceFactory.newInstance(
2238 listenerClassName));
2239 }
2240
2241 listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
2242 }
2243 catch (Exception e) {
2244 _log.error(e);
2245 }
2246 }
2247 }
2248
2249 public void destroy() {
2250 EntityCacheUtil.removeCache(LayoutBranchImpl.class.getName());
2251 FinderCacheUtil.removeCache(FINDER_CLASS_NAME_ENTITY);
2252 FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
2253 }
2254
2255 @BeanReference(type = AccountPersistence.class)
2256 protected AccountPersistence accountPersistence;
2257 @BeanReference(type = AddressPersistence.class)
2258 protected AddressPersistence addressPersistence;
2259 @BeanReference(type = BrowserTrackerPersistence.class)
2260 protected BrowserTrackerPersistence browserTrackerPersistence;
2261 @BeanReference(type = ClassNamePersistence.class)
2262 protected ClassNamePersistence classNamePersistence;
2263 @BeanReference(type = ClusterGroupPersistence.class)
2264 protected ClusterGroupPersistence clusterGroupPersistence;
2265 @BeanReference(type = CompanyPersistence.class)
2266 protected CompanyPersistence companyPersistence;
2267 @BeanReference(type = ContactPersistence.class)
2268 protected ContactPersistence contactPersistence;
2269 @BeanReference(type = CountryPersistence.class)
2270 protected CountryPersistence countryPersistence;
2271 @BeanReference(type = EmailAddressPersistence.class)
2272 protected EmailAddressPersistence emailAddressPersistence;
2273 @BeanReference(type = GroupPersistence.class)
2274 protected GroupPersistence groupPersistence;
2275 @BeanReference(type = ImagePersistence.class)
2276 protected ImagePersistence imagePersistence;
2277 @BeanReference(type = LayoutPersistence.class)
2278 protected LayoutPersistence layoutPersistence;
2279 @BeanReference(type = LayoutBranchPersistence.class)
2280 protected LayoutBranchPersistence layoutBranchPersistence;
2281 @BeanReference(type = LayoutPrototypePersistence.class)
2282 protected LayoutPrototypePersistence layoutPrototypePersistence;
2283 @BeanReference(type = LayoutRevisionPersistence.class)
2284 protected LayoutRevisionPersistence layoutRevisionPersistence;
2285 @BeanReference(type = LayoutSetPersistence.class)
2286 protected LayoutSetPersistence layoutSetPersistence;
2287 @BeanReference(type = LayoutSetBranchPersistence.class)
2288 protected LayoutSetBranchPersistence layoutSetBranchPersistence;
2289 @BeanReference(type = LayoutSetPrototypePersistence.class)
2290 protected LayoutSetPrototypePersistence layoutSetPrototypePersistence;
2291 @BeanReference(type = ListTypePersistence.class)
2292 protected ListTypePersistence listTypePersistence;
2293 @BeanReference(type = LockPersistence.class)
2294 protected LockPersistence lockPersistence;
2295 @BeanReference(type = MembershipRequestPersistence.class)
2296 protected MembershipRequestPersistence membershipRequestPersistence;
2297 @BeanReference(type = OrganizationPersistence.class)
2298 protected OrganizationPersistence organizationPersistence;
2299 @BeanReference(type = OrgGroupPermissionPersistence.class)
2300 protected OrgGroupPermissionPersistence orgGroupPermissionPersistence;
2301 @BeanReference(type = OrgGroupRolePersistence.class)
2302 protected OrgGroupRolePersistence orgGroupRolePersistence;
2303 @BeanReference(type = OrgLaborPersistence.class)
2304 protected OrgLaborPersistence orgLaborPersistence;
2305 @BeanReference(type = PasswordPolicyPersistence.class)
2306 protected PasswordPolicyPersistence passwordPolicyPersistence;
2307 @BeanReference(type = PasswordPolicyRelPersistence.class)
2308 protected PasswordPolicyRelPersistence passwordPolicyRelPersistence;
2309 @BeanReference(type = PasswordTrackerPersistence.class)
2310 protected PasswordTrackerPersistence passwordTrackerPersistence;
2311 @BeanReference(type = PermissionPersistence.class)
2312 protected PermissionPersistence permissionPersistence;
2313 @BeanReference(type = PhonePersistence.class)
2314 protected PhonePersistence phonePersistence;
2315 @BeanReference(type = PluginSettingPersistence.class)
2316 protected PluginSettingPersistence pluginSettingPersistence;
2317 @BeanReference(type = PortalPreferencesPersistence.class)
2318 protected PortalPreferencesPersistence portalPreferencesPersistence;
2319 @BeanReference(type = PortletPersistence.class)
2320 protected PortletPersistence portletPersistence;
2321 @BeanReference(type = PortletItemPersistence.class)
2322 protected PortletItemPersistence portletItemPersistence;
2323 @BeanReference(type = PortletPreferencesPersistence.class)
2324 protected PortletPreferencesPersistence portletPreferencesPersistence;
2325 @BeanReference(type = RegionPersistence.class)
2326 protected RegionPersistence regionPersistence;
2327 @BeanReference(type = ReleasePersistence.class)
2328 protected ReleasePersistence releasePersistence;
2329 @BeanReference(type = RepositoryPersistence.class)
2330 protected RepositoryPersistence repositoryPersistence;
2331 @BeanReference(type = RepositoryEntryPersistence.class)
2332 protected RepositoryEntryPersistence repositoryEntryPersistence;
2333 @BeanReference(type = ResourcePersistence.class)
2334 protected ResourcePersistence resourcePersistence;
2335 @BeanReference(type = ResourceActionPersistence.class)
2336 protected ResourceActionPersistence resourceActionPersistence;
2337 @BeanReference(type = ResourceBlockPersistence.class)
2338 protected ResourceBlockPersistence resourceBlockPersistence;
2339 @BeanReference(type = ResourceBlockPermissionPersistence.class)
2340 protected ResourceBlockPermissionPersistence resourceBlockPermissionPersistence;
2341 @BeanReference(type = ResourceCodePersistence.class)
2342 protected ResourceCodePersistence resourceCodePersistence;
2343 @BeanReference(type = ResourcePermissionPersistence.class)
2344 protected ResourcePermissionPersistence resourcePermissionPersistence;
2345 @BeanReference(type = ResourceTypePermissionPersistence.class)
2346 protected ResourceTypePermissionPersistence resourceTypePermissionPersistence;
2347 @BeanReference(type = RolePersistence.class)
2348 protected RolePersistence rolePersistence;
2349 @BeanReference(type = ServiceComponentPersistence.class)
2350 protected ServiceComponentPersistence serviceComponentPersistence;
2351 @BeanReference(type = ShardPersistence.class)
2352 protected ShardPersistence shardPersistence;
2353 @BeanReference(type = SubscriptionPersistence.class)
2354 protected SubscriptionPersistence subscriptionPersistence;
2355 @BeanReference(type = TeamPersistence.class)
2356 protected TeamPersistence teamPersistence;
2357 @BeanReference(type = TicketPersistence.class)
2358 protected TicketPersistence ticketPersistence;
2359 @BeanReference(type = UserPersistence.class)
2360 protected UserPersistence userPersistence;
2361 @BeanReference(type = UserGroupPersistence.class)
2362 protected UserGroupPersistence userGroupPersistence;
2363 @BeanReference(type = UserGroupGroupRolePersistence.class)
2364 protected UserGroupGroupRolePersistence userGroupGroupRolePersistence;
2365 @BeanReference(type = UserGroupRolePersistence.class)
2366 protected UserGroupRolePersistence userGroupRolePersistence;
2367 @BeanReference(type = UserIdMapperPersistence.class)
2368 protected UserIdMapperPersistence userIdMapperPersistence;
2369 @BeanReference(type = UserNotificationEventPersistence.class)
2370 protected UserNotificationEventPersistence userNotificationEventPersistence;
2371 @BeanReference(type = UserTrackerPersistence.class)
2372 protected UserTrackerPersistence userTrackerPersistence;
2373 @BeanReference(type = UserTrackerPathPersistence.class)
2374 protected UserTrackerPathPersistence userTrackerPathPersistence;
2375 @BeanReference(type = VirtualHostPersistence.class)
2376 protected VirtualHostPersistence virtualHostPersistence;
2377 @BeanReference(type = WebDAVPropsPersistence.class)
2378 protected WebDAVPropsPersistence webDAVPropsPersistence;
2379 @BeanReference(type = WebsitePersistence.class)
2380 protected WebsitePersistence websitePersistence;
2381 @BeanReference(type = WorkflowDefinitionLinkPersistence.class)
2382 protected WorkflowDefinitionLinkPersistence workflowDefinitionLinkPersistence;
2383 @BeanReference(type = WorkflowInstanceLinkPersistence.class)
2384 protected WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence;
2385 private static final String _SQL_SELECT_LAYOUTBRANCH = "SELECT layoutBranch FROM LayoutBranch layoutBranch";
2386 private static final String _SQL_SELECT_LAYOUTBRANCH_WHERE = "SELECT layoutBranch FROM LayoutBranch layoutBranch WHERE ";
2387 private static final String _SQL_COUNT_LAYOUTBRANCH = "SELECT COUNT(layoutBranch) FROM LayoutBranch layoutBranch";
2388 private static final String _SQL_COUNT_LAYOUTBRANCH_WHERE = "SELECT COUNT(layoutBranch) FROM LayoutBranch layoutBranch WHERE ";
2389 private static final String _FINDER_COLUMN_LAYOUTSETBRANCHID_LAYOUTSETBRANCHID_2 =
2390 "layoutBranch.layoutSetBranchId = ?";
2391 private static final String _FINDER_COLUMN_L_P_LAYOUTSETBRANCHID_2 = "layoutBranch.layoutSetBranchId = ? AND ";
2392 private static final String _FINDER_COLUMN_L_P_PLID_2 = "layoutBranch.plid = ?";
2393 private static final String _FINDER_COLUMN_L_P_N_LAYOUTSETBRANCHID_2 = "layoutBranch.layoutSetBranchId = ? AND ";
2394 private static final String _FINDER_COLUMN_L_P_N_PLID_2 = "layoutBranch.plid = ? AND ";
2395 private static final String _FINDER_COLUMN_L_P_N_NAME_1 = "layoutBranch.name IS NULL";
2396 private static final String _FINDER_COLUMN_L_P_N_NAME_2 = "layoutBranch.name = ?";
2397 private static final String _FINDER_COLUMN_L_P_N_NAME_3 = "(layoutBranch.name IS NULL OR layoutBranch.name = ?)";
2398 private static final String _FINDER_COLUMN_L_P_M_LAYOUTSETBRANCHID_2 = "layoutBranch.layoutSetBranchId = ? AND ";
2399 private static final String _FINDER_COLUMN_L_P_M_PLID_2 = "layoutBranch.plid = ? AND ";
2400 private static final String _FINDER_COLUMN_L_P_M_MASTER_2 = "layoutBranch.master = ?";
2401 private static final String _ORDER_BY_ENTITY_ALIAS = "layoutBranch.";
2402 private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No LayoutBranch exists with the primary key ";
2403 private static final String _NO_SUCH_ENTITY_WITH_KEY = "No LayoutBranch exists with the key {";
2404 private static final boolean _HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE = com.liferay.portal.util.PropsValues.HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE;
2405 private static Log _log = LogFactoryUtil.getLog(LayoutBranchPersistenceImpl.class);
2406 private static LayoutBranch _nullLayoutBranch = new LayoutBranchImpl() {
2407 @Override
2408 public Object clone() {
2409 return this;
2410 }
2411
2412 @Override
2413 public CacheModel<LayoutBranch> toCacheModel() {
2414 return _nullLayoutBranchCacheModel;
2415 }
2416 };
2417
2418 private static CacheModel<LayoutBranch> _nullLayoutBranchCacheModel = new CacheModel<LayoutBranch>() {
2419 public LayoutBranch toEntityModel() {
2420 return _nullLayoutBranch;
2421 }
2422 };
2423 }