1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.service.persistence;
16  
17  import com.liferay.portal.NoSuchLayoutSetException;
18  import com.liferay.portal.NoSuchModelException;
19  import com.liferay.portal.kernel.annotation.BeanReference;
20  import com.liferay.portal.kernel.cache.CacheRegistry;
21  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
22  import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
23  import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
24  import com.liferay.portal.kernel.dao.orm.FinderPath;
25  import com.liferay.portal.kernel.dao.orm.Query;
26  import com.liferay.portal.kernel.dao.orm.QueryPos;
27  import com.liferay.portal.kernel.dao.orm.QueryUtil;
28  import com.liferay.portal.kernel.dao.orm.Session;
29  import com.liferay.portal.kernel.exception.SystemException;
30  import com.liferay.portal.kernel.log.Log;
31  import com.liferay.portal.kernel.log.LogFactoryUtil;
32  import com.liferay.portal.kernel.util.GetterUtil;
33  import com.liferay.portal.kernel.util.OrderByComparator;
34  import com.liferay.portal.kernel.util.StringBundler;
35  import com.liferay.portal.kernel.util.StringPool;
36  import com.liferay.portal.kernel.util.StringUtil;
37  import com.liferay.portal.kernel.util.Validator;
38  import com.liferay.portal.model.LayoutSet;
39  import com.liferay.portal.model.ModelListener;
40  import com.liferay.portal.model.impl.LayoutSetImpl;
41  import com.liferay.portal.model.impl.LayoutSetModelImpl;
42  import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
43  
44  import java.io.Serializable;
45  
46  import java.util.ArrayList;
47  import java.util.Collections;
48  import java.util.List;
49  
50  /**
51   * <a href="LayoutSetPersistenceImpl.java.html"><b><i>View Source</i></b></a>
52   *
53   * <p>
54   * ServiceBuilder generated this class. Modifications in this class will be
55   * overwritten the next time is generated.
56   * </p>
57   *
58   * @author    Brian Wing Shun Chan
59   * @see       LayoutSetPersistence
60   * @see       LayoutSetUtil
61   * @generated
62   */
63  public class LayoutSetPersistenceImpl extends BasePersistenceImpl<LayoutSet>
64      implements LayoutSetPersistence {
65      public static final String FINDER_CLASS_NAME_ENTITY = LayoutSetImpl.class.getName();
66      public static final String FINDER_CLASS_NAME_LIST = FINDER_CLASS_NAME_ENTITY +
67          ".List";
68      public static final FinderPath FINDER_PATH_FIND_BY_GROUPID = new FinderPath(LayoutSetModelImpl.ENTITY_CACHE_ENABLED,
69              LayoutSetModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
70              "findByGroupId", new String[] { Long.class.getName() });
71      public static final FinderPath FINDER_PATH_FIND_BY_OBC_GROUPID = new FinderPath(LayoutSetModelImpl.ENTITY_CACHE_ENABLED,
72              LayoutSetModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
73              "findByGroupId",
74              new String[] {
75                  Long.class.getName(),
76                  
77              "java.lang.Integer", "java.lang.Integer",
78                  "com.liferay.portal.kernel.util.OrderByComparator"
79              });
80      public static final FinderPath FINDER_PATH_COUNT_BY_GROUPID = new FinderPath(LayoutSetModelImpl.ENTITY_CACHE_ENABLED,
81              LayoutSetModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
82              "countByGroupId", new String[] { Long.class.getName() });
83      public static final FinderPath FINDER_PATH_FETCH_BY_VIRTUALHOST = new FinderPath(LayoutSetModelImpl.ENTITY_CACHE_ENABLED,
84              LayoutSetModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_ENTITY,
85              "fetchByVirtualHost", new String[] { String.class.getName() });
86      public static final FinderPath FINDER_PATH_COUNT_BY_VIRTUALHOST = new FinderPath(LayoutSetModelImpl.ENTITY_CACHE_ENABLED,
87              LayoutSetModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
88              "countByVirtualHost", new String[] { String.class.getName() });
89      public static final FinderPath FINDER_PATH_FETCH_BY_G_P = new FinderPath(LayoutSetModelImpl.ENTITY_CACHE_ENABLED,
90              LayoutSetModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_ENTITY,
91              "fetchByG_P",
92              new String[] { Long.class.getName(), Boolean.class.getName() });
93      public static final FinderPath FINDER_PATH_COUNT_BY_G_P = new FinderPath(LayoutSetModelImpl.ENTITY_CACHE_ENABLED,
94              LayoutSetModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
95              "countByG_P",
96              new String[] { Long.class.getName(), Boolean.class.getName() });
97      public static final FinderPath FINDER_PATH_FIND_ALL = new FinderPath(LayoutSetModelImpl.ENTITY_CACHE_ENABLED,
98              LayoutSetModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
99              "findAll", new String[0]);
100     public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(LayoutSetModelImpl.ENTITY_CACHE_ENABLED,
101             LayoutSetModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
102             "countAll", new String[0]);
103 
104     public void cacheResult(LayoutSet layoutSet) {
105         EntityCacheUtil.putResult(LayoutSetModelImpl.ENTITY_CACHE_ENABLED,
106             LayoutSetImpl.class, layoutSet.getPrimaryKey(), layoutSet);
107 
108         FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_VIRTUALHOST,
109             new Object[] { layoutSet.getVirtualHost() }, layoutSet);
110 
111         FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_G_P,
112             new Object[] {
113                 new Long(layoutSet.getGroupId()),
114                 Boolean.valueOf(layoutSet.getPrivateLayout())
115             }, layoutSet);
116     }
117 
118     public void cacheResult(List<LayoutSet> layoutSets) {
119         for (LayoutSet layoutSet : layoutSets) {
120             if (EntityCacheUtil.getResult(
121                         LayoutSetModelImpl.ENTITY_CACHE_ENABLED,
122                         LayoutSetImpl.class, layoutSet.getPrimaryKey(), this) == null) {
123                 cacheResult(layoutSet);
124             }
125         }
126     }
127 
128     public void clearCache() {
129         CacheRegistry.clear(LayoutSetImpl.class.getName());
130         EntityCacheUtil.clearCache(LayoutSetImpl.class.getName());
131         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
132         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
133     }
134 
135     public LayoutSet create(long layoutSetId) {
136         LayoutSet layoutSet = new LayoutSetImpl();
137 
138         layoutSet.setNew(true);
139         layoutSet.setPrimaryKey(layoutSetId);
140 
141         return layoutSet;
142     }
143 
144     public LayoutSet remove(Serializable primaryKey)
145         throws NoSuchModelException, SystemException {
146         return remove(((Long)primaryKey).longValue());
147     }
148 
149     public LayoutSet remove(long layoutSetId)
150         throws NoSuchLayoutSetException, SystemException {
151         Session session = null;
152 
153         try {
154             session = openSession();
155 
156             LayoutSet layoutSet = (LayoutSet)session.get(LayoutSetImpl.class,
157                     new Long(layoutSetId));
158 
159             if (layoutSet == null) {
160                 if (_log.isWarnEnabled()) {
161                     _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + layoutSetId);
162                 }
163 
164                 throw new NoSuchLayoutSetException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
165                     layoutSetId);
166             }
167 
168             return remove(layoutSet);
169         }
170         catch (NoSuchLayoutSetException nsee) {
171             throw nsee;
172         }
173         catch (Exception e) {
174             throw processException(e);
175         }
176         finally {
177             closeSession(session);
178         }
179     }
180 
181     public LayoutSet remove(LayoutSet layoutSet) throws SystemException {
182         for (ModelListener<LayoutSet> listener : listeners) {
183             listener.onBeforeRemove(layoutSet);
184         }
185 
186         layoutSet = removeImpl(layoutSet);
187 
188         for (ModelListener<LayoutSet> listener : listeners) {
189             listener.onAfterRemove(layoutSet);
190         }
191 
192         return layoutSet;
193     }
194 
195     protected LayoutSet removeImpl(LayoutSet layoutSet)
196         throws SystemException {
197         layoutSet = toUnwrappedModel(layoutSet);
198 
199         Session session = null;
200 
201         try {
202             session = openSession();
203 
204             if (layoutSet.isCachedModel() || BatchSessionUtil.isEnabled()) {
205                 Object staleObject = session.get(LayoutSetImpl.class,
206                         layoutSet.getPrimaryKeyObj());
207 
208                 if (staleObject != null) {
209                     session.evict(staleObject);
210                 }
211             }
212 
213             session.delete(layoutSet);
214 
215             session.flush();
216         }
217         catch (Exception e) {
218             throw processException(e);
219         }
220         finally {
221             closeSession(session);
222         }
223 
224         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
225 
226         LayoutSetModelImpl layoutSetModelImpl = (LayoutSetModelImpl)layoutSet;
227 
228         FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_VIRTUALHOST,
229             new Object[] { layoutSetModelImpl.getOriginalVirtualHost() });
230 
231         FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_G_P,
232             new Object[] {
233                 new Long(layoutSetModelImpl.getOriginalGroupId()),
234                 Boolean.valueOf(layoutSetModelImpl.getOriginalPrivateLayout())
235             });
236 
237         EntityCacheUtil.removeResult(LayoutSetModelImpl.ENTITY_CACHE_ENABLED,
238             LayoutSetImpl.class, layoutSet.getPrimaryKey());
239 
240         return layoutSet;
241     }
242 
243     public LayoutSet updateImpl(com.liferay.portal.model.LayoutSet layoutSet,
244         boolean merge) throws SystemException {
245         layoutSet = toUnwrappedModel(layoutSet);
246 
247         boolean isNew = layoutSet.isNew();
248 
249         LayoutSetModelImpl layoutSetModelImpl = (LayoutSetModelImpl)layoutSet;
250 
251         Session session = null;
252 
253         try {
254             session = openSession();
255 
256             BatchSessionUtil.update(session, layoutSet, merge);
257 
258             layoutSet.setNew(false);
259         }
260         catch (Exception e) {
261             throw processException(e);
262         }
263         finally {
264             closeSession(session);
265         }
266 
267         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
268 
269         EntityCacheUtil.putResult(LayoutSetModelImpl.ENTITY_CACHE_ENABLED,
270             LayoutSetImpl.class, layoutSet.getPrimaryKey(), layoutSet);
271 
272         if (!isNew &&
273                 (!Validator.equals(layoutSet.getVirtualHost(),
274                     layoutSetModelImpl.getOriginalVirtualHost()))) {
275             FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_VIRTUALHOST,
276                 new Object[] { layoutSetModelImpl.getOriginalVirtualHost() });
277         }
278 
279         if (isNew ||
280                 (!Validator.equals(layoutSet.getVirtualHost(),
281                     layoutSetModelImpl.getOriginalVirtualHost()))) {
282             FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_VIRTUALHOST,
283                 new Object[] { layoutSet.getVirtualHost() }, layoutSet);
284         }
285 
286         if (!isNew &&
287                 ((layoutSet.getGroupId() != layoutSetModelImpl.getOriginalGroupId()) ||
288                 (layoutSet.getPrivateLayout() != layoutSetModelImpl.getOriginalPrivateLayout()))) {
289             FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_G_P,
290                 new Object[] {
291                     new Long(layoutSetModelImpl.getOriginalGroupId()),
292                     Boolean.valueOf(
293                         layoutSetModelImpl.getOriginalPrivateLayout())
294                 });
295         }
296 
297         if (isNew ||
298                 ((layoutSet.getGroupId() != layoutSetModelImpl.getOriginalGroupId()) ||
299                 (layoutSet.getPrivateLayout() != layoutSetModelImpl.getOriginalPrivateLayout()))) {
300             FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_G_P,
301                 new Object[] {
302                     new Long(layoutSet.getGroupId()),
303                     Boolean.valueOf(layoutSet.getPrivateLayout())
304                 }, layoutSet);
305         }
306 
307         return layoutSet;
308     }
309 
310     protected LayoutSet toUnwrappedModel(LayoutSet layoutSet) {
311         if (layoutSet instanceof LayoutSetImpl) {
312             return layoutSet;
313         }
314 
315         LayoutSetImpl layoutSetImpl = new LayoutSetImpl();
316 
317         layoutSetImpl.setNew(layoutSet.isNew());
318         layoutSetImpl.setPrimaryKey(layoutSet.getPrimaryKey());
319 
320         layoutSetImpl.setLayoutSetId(layoutSet.getLayoutSetId());
321         layoutSetImpl.setGroupId(layoutSet.getGroupId());
322         layoutSetImpl.setCompanyId(layoutSet.getCompanyId());
323         layoutSetImpl.setPrivateLayout(layoutSet.isPrivateLayout());
324         layoutSetImpl.setLogo(layoutSet.isLogo());
325         layoutSetImpl.setLogoId(layoutSet.getLogoId());
326         layoutSetImpl.setThemeId(layoutSet.getThemeId());
327         layoutSetImpl.setColorSchemeId(layoutSet.getColorSchemeId());
328         layoutSetImpl.setWapThemeId(layoutSet.getWapThemeId());
329         layoutSetImpl.setWapColorSchemeId(layoutSet.getWapColorSchemeId());
330         layoutSetImpl.setCss(layoutSet.getCss());
331         layoutSetImpl.setPageCount(layoutSet.getPageCount());
332         layoutSetImpl.setVirtualHost(layoutSet.getVirtualHost());
333         layoutSetImpl.setLayoutSetPrototypeId(layoutSet.getLayoutSetPrototypeId());
334 
335         return layoutSetImpl;
336     }
337 
338     public LayoutSet findByPrimaryKey(Serializable primaryKey)
339         throws NoSuchModelException, SystemException {
340         return findByPrimaryKey(((Long)primaryKey).longValue());
341     }
342 
343     public LayoutSet findByPrimaryKey(long layoutSetId)
344         throws NoSuchLayoutSetException, SystemException {
345         LayoutSet layoutSet = fetchByPrimaryKey(layoutSetId);
346 
347         if (layoutSet == null) {
348             if (_log.isWarnEnabled()) {
349                 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + layoutSetId);
350             }
351 
352             throw new NoSuchLayoutSetException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
353                 layoutSetId);
354         }
355 
356         return layoutSet;
357     }
358 
359     public LayoutSet fetchByPrimaryKey(Serializable primaryKey)
360         throws SystemException {
361         return fetchByPrimaryKey(((Long)primaryKey).longValue());
362     }
363 
364     public LayoutSet fetchByPrimaryKey(long layoutSetId)
365         throws SystemException {
366         LayoutSet layoutSet = (LayoutSet)EntityCacheUtil.getResult(LayoutSetModelImpl.ENTITY_CACHE_ENABLED,
367                 LayoutSetImpl.class, layoutSetId, this);
368 
369         if (layoutSet == null) {
370             Session session = null;
371 
372             try {
373                 session = openSession();
374 
375                 layoutSet = (LayoutSet)session.get(LayoutSetImpl.class,
376                         new Long(layoutSetId));
377             }
378             catch (Exception e) {
379                 throw processException(e);
380             }
381             finally {
382                 if (layoutSet != null) {
383                     cacheResult(layoutSet);
384                 }
385 
386                 closeSession(session);
387             }
388         }
389 
390         return layoutSet;
391     }
392 
393     public List<LayoutSet> findByGroupId(long groupId)
394         throws SystemException {
395         Object[] finderArgs = new Object[] { new Long(groupId) };
396 
397         List<LayoutSet> list = (List<LayoutSet>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_GROUPID,
398                 finderArgs, this);
399 
400         if (list == null) {
401             Session session = null;
402 
403             try {
404                 session = openSession();
405 
406                 StringBundler query = new StringBundler(2);
407 
408                 query.append(_SQL_SELECT_LAYOUTSET_WHERE);
409 
410                 query.append(_FINDER_COLUMN_GROUPID_GROUPID_2);
411 
412                 String sql = query.toString();
413 
414                 Query q = session.createQuery(sql);
415 
416                 QueryPos qPos = QueryPos.getInstance(q);
417 
418                 qPos.add(groupId);
419 
420                 list = q.list();
421             }
422             catch (Exception e) {
423                 throw processException(e);
424             }
425             finally {
426                 if (list == null) {
427                     list = new ArrayList<LayoutSet>();
428                 }
429 
430                 cacheResult(list);
431 
432                 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_GROUPID,
433                     finderArgs, list);
434 
435                 closeSession(session);
436             }
437         }
438 
439         return list;
440     }
441 
442     public List<LayoutSet> findByGroupId(long groupId, int start, int end)
443         throws SystemException {
444         return findByGroupId(groupId, start, end, null);
445     }
446 
447     public List<LayoutSet> findByGroupId(long groupId, int start, int end,
448         OrderByComparator obc) throws SystemException {
449         Object[] finderArgs = new Object[] {
450                 new Long(groupId),
451                 
452                 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
453             };
454 
455         List<LayoutSet> list = (List<LayoutSet>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_GROUPID,
456                 finderArgs, this);
457 
458         if (list == null) {
459             Session session = null;
460 
461             try {
462                 session = openSession();
463 
464                 StringBundler query = null;
465 
466                 if (obc != null) {
467                     query = new StringBundler(3 +
468                             (obc.getOrderByFields().length * 3));
469                 }
470                 else {
471                     query = new StringBundler(2);
472                 }
473 
474                 query.append(_SQL_SELECT_LAYOUTSET_WHERE);
475 
476                 query.append(_FINDER_COLUMN_GROUPID_GROUPID_2);
477 
478                 if (obc != null) {
479                     appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
480                 }
481 
482                 String sql = query.toString();
483 
484                 Query q = session.createQuery(sql);
485 
486                 QueryPos qPos = QueryPos.getInstance(q);
487 
488                 qPos.add(groupId);
489 
490                 list = (List<LayoutSet>)QueryUtil.list(q, getDialect(), start,
491                         end);
492             }
493             catch (Exception e) {
494                 throw processException(e);
495             }
496             finally {
497                 if (list == null) {
498                     list = new ArrayList<LayoutSet>();
499                 }
500 
501                 cacheResult(list);
502 
503                 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_GROUPID,
504                     finderArgs, list);
505 
506                 closeSession(session);
507             }
508         }
509 
510         return list;
511     }
512 
513     public LayoutSet findByGroupId_First(long groupId, OrderByComparator obc)
514         throws NoSuchLayoutSetException, SystemException {
515         List<LayoutSet> list = findByGroupId(groupId, 0, 1, obc);
516 
517         if (list.isEmpty()) {
518             StringBundler msg = new StringBundler(4);
519 
520             msg.append(_NO_SUCH_ENTITY_WITH_KEY);
521 
522             msg.append("groupId=");
523             msg.append(groupId);
524 
525             msg.append(StringPool.CLOSE_CURLY_BRACE);
526 
527             throw new NoSuchLayoutSetException(msg.toString());
528         }
529         else {
530             return list.get(0);
531         }
532     }
533 
534     public LayoutSet findByGroupId_Last(long groupId, OrderByComparator obc)
535         throws NoSuchLayoutSetException, SystemException {
536         int count = countByGroupId(groupId);
537 
538         List<LayoutSet> list = findByGroupId(groupId, count - 1, count, obc);
539 
540         if (list.isEmpty()) {
541             StringBundler msg = new StringBundler(4);
542 
543             msg.append(_NO_SUCH_ENTITY_WITH_KEY);
544 
545             msg.append("groupId=");
546             msg.append(groupId);
547 
548             msg.append(StringPool.CLOSE_CURLY_BRACE);
549 
550             throw new NoSuchLayoutSetException(msg.toString());
551         }
552         else {
553             return list.get(0);
554         }
555     }
556 
557     public LayoutSet[] findByGroupId_PrevAndNext(long layoutSetId,
558         long groupId, OrderByComparator obc)
559         throws NoSuchLayoutSetException, SystemException {
560         LayoutSet layoutSet = findByPrimaryKey(layoutSetId);
561 
562         int count = countByGroupId(groupId);
563 
564         Session session = null;
565 
566         try {
567             session = openSession();
568 
569             StringBundler query = null;
570 
571             if (obc != null) {
572                 query = new StringBundler(3 +
573                         (obc.getOrderByFields().length * 3));
574             }
575             else {
576                 query = new StringBundler(2);
577             }
578 
579             query.append(_SQL_SELECT_LAYOUTSET_WHERE);
580 
581             query.append(_FINDER_COLUMN_GROUPID_GROUPID_2);
582 
583             if (obc != null) {
584                 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
585             }
586 
587             String sql = query.toString();
588 
589             Query q = session.createQuery(sql);
590 
591             QueryPos qPos = QueryPos.getInstance(q);
592 
593             qPos.add(groupId);
594 
595             Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc,
596                     layoutSet);
597 
598             LayoutSet[] array = new LayoutSetImpl[3];
599 
600             array[0] = (LayoutSet)objArray[0];
601             array[1] = (LayoutSet)objArray[1];
602             array[2] = (LayoutSet)objArray[2];
603 
604             return array;
605         }
606         catch (Exception e) {
607             throw processException(e);
608         }
609         finally {
610             closeSession(session);
611         }
612     }
613 
614     public LayoutSet findByVirtualHost(String virtualHost)
615         throws NoSuchLayoutSetException, SystemException {
616         LayoutSet layoutSet = fetchByVirtualHost(virtualHost);
617 
618         if (layoutSet == null) {
619             StringBundler msg = new StringBundler(4);
620 
621             msg.append(_NO_SUCH_ENTITY_WITH_KEY);
622 
623             msg.append("virtualHost=");
624             msg.append(virtualHost);
625 
626             msg.append(StringPool.CLOSE_CURLY_BRACE);
627 
628             if (_log.isWarnEnabled()) {
629                 _log.warn(msg.toString());
630             }
631 
632             throw new NoSuchLayoutSetException(msg.toString());
633         }
634 
635         return layoutSet;
636     }
637 
638     public LayoutSet fetchByVirtualHost(String virtualHost)
639         throws SystemException {
640         return fetchByVirtualHost(virtualHost, true);
641     }
642 
643     public LayoutSet fetchByVirtualHost(String virtualHost,
644         boolean retrieveFromCache) throws SystemException {
645         Object[] finderArgs = new Object[] { virtualHost };
646 
647         Object result = null;
648 
649         if (retrieveFromCache) {
650             result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_VIRTUALHOST,
651                     finderArgs, this);
652         }
653 
654         if (result == null) {
655             Session session = null;
656 
657             try {
658                 session = openSession();
659 
660                 StringBundler query = new StringBundler(2);
661 
662                 query.append(_SQL_SELECT_LAYOUTSET_WHERE);
663 
664                 if (virtualHost == null) {
665                     query.append(_FINDER_COLUMN_VIRTUALHOST_VIRTUALHOST_1);
666                 }
667                 else {
668                     if (virtualHost.equals(StringPool.BLANK)) {
669                         query.append(_FINDER_COLUMN_VIRTUALHOST_VIRTUALHOST_3);
670                     }
671                     else {
672                         query.append(_FINDER_COLUMN_VIRTUALHOST_VIRTUALHOST_2);
673                     }
674                 }
675 
676                 String sql = query.toString();
677 
678                 Query q = session.createQuery(sql);
679 
680                 QueryPos qPos = QueryPos.getInstance(q);
681 
682                 if (virtualHost != null) {
683                     qPos.add(virtualHost);
684                 }
685 
686                 List<LayoutSet> list = q.list();
687 
688                 result = list;
689 
690                 LayoutSet layoutSet = null;
691 
692                 if (list.isEmpty()) {
693                     FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_VIRTUALHOST,
694                         finderArgs, list);
695                 }
696                 else {
697                     layoutSet = list.get(0);
698 
699                     cacheResult(layoutSet);
700 
701                     if ((layoutSet.getVirtualHost() == null) ||
702                             !layoutSet.getVirtualHost().equals(virtualHost)) {
703                         FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_VIRTUALHOST,
704                             finderArgs, layoutSet);
705                     }
706                 }
707 
708                 return layoutSet;
709             }
710             catch (Exception e) {
711                 throw processException(e);
712             }
713             finally {
714                 if (result == null) {
715                     FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_VIRTUALHOST,
716                         finderArgs, new ArrayList<LayoutSet>());
717                 }
718 
719                 closeSession(session);
720             }
721         }
722         else {
723             if (result instanceof List<?>) {
724                 return null;
725             }
726             else {
727                 return (LayoutSet)result;
728             }
729         }
730     }
731 
732     public LayoutSet findByG_P(long groupId, boolean privateLayout)
733         throws NoSuchLayoutSetException, SystemException {
734         LayoutSet layoutSet = fetchByG_P(groupId, privateLayout);
735 
736         if (layoutSet == null) {
737             StringBundler msg = new StringBundler(6);
738 
739             msg.append(_NO_SUCH_ENTITY_WITH_KEY);
740 
741             msg.append("groupId=");
742             msg.append(groupId);
743 
744             msg.append(", privateLayout=");
745             msg.append(privateLayout);
746 
747             msg.append(StringPool.CLOSE_CURLY_BRACE);
748 
749             if (_log.isWarnEnabled()) {
750                 _log.warn(msg.toString());
751             }
752 
753             throw new NoSuchLayoutSetException(msg.toString());
754         }
755 
756         return layoutSet;
757     }
758 
759     public LayoutSet fetchByG_P(long groupId, boolean privateLayout)
760         throws SystemException {
761         return fetchByG_P(groupId, privateLayout, true);
762     }
763 
764     public LayoutSet fetchByG_P(long groupId, boolean privateLayout,
765         boolean retrieveFromCache) throws SystemException {
766         Object[] finderArgs = new Object[] {
767                 new Long(groupId), Boolean.valueOf(privateLayout)
768             };
769 
770         Object result = null;
771 
772         if (retrieveFromCache) {
773             result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_G_P,
774                     finderArgs, this);
775         }
776 
777         if (result == null) {
778             Session session = null;
779 
780             try {
781                 session = openSession();
782 
783                 StringBundler query = new StringBundler(3);
784 
785                 query.append(_SQL_SELECT_LAYOUTSET_WHERE);
786 
787                 query.append(_FINDER_COLUMN_G_P_GROUPID_2);
788 
789                 query.append(_FINDER_COLUMN_G_P_PRIVATELAYOUT_2);
790 
791                 String sql = query.toString();
792 
793                 Query q = session.createQuery(sql);
794 
795                 QueryPos qPos = QueryPos.getInstance(q);
796 
797                 qPos.add(groupId);
798 
799                 qPos.add(privateLayout);
800 
801                 List<LayoutSet> list = q.list();
802 
803                 result = list;
804 
805                 LayoutSet layoutSet = null;
806 
807                 if (list.isEmpty()) {
808                     FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_G_P,
809                         finderArgs, list);
810                 }
811                 else {
812                     layoutSet = list.get(0);
813 
814                     cacheResult(layoutSet);
815 
816                     if ((layoutSet.getGroupId() != groupId) ||
817                             (layoutSet.getPrivateLayout() != privateLayout)) {
818                         FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_G_P,
819                             finderArgs, layoutSet);
820                     }
821                 }
822 
823                 return layoutSet;
824             }
825             catch (Exception e) {
826                 throw processException(e);
827             }
828             finally {
829                 if (result == null) {
830                     FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_G_P,
831                         finderArgs, new ArrayList<LayoutSet>());
832                 }
833 
834                 closeSession(session);
835             }
836         }
837         else {
838             if (result instanceof List<?>) {
839                 return null;
840             }
841             else {
842                 return (LayoutSet)result;
843             }
844         }
845     }
846 
847     public List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery)
848         throws SystemException {
849         Session session = null;
850 
851         try {
852             session = openSession();
853 
854             dynamicQuery.compile(session);
855 
856             return dynamicQuery.list();
857         }
858         catch (Exception e) {
859             throw processException(e);
860         }
861         finally {
862             closeSession(session);
863         }
864     }
865 
866     public List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery,
867         int start, int end) throws SystemException {
868         Session session = null;
869 
870         try {
871             session = openSession();
872 
873             dynamicQuery.setLimit(start, end);
874 
875             dynamicQuery.compile(session);
876 
877             return dynamicQuery.list();
878         }
879         catch (Exception e) {
880             throw processException(e);
881         }
882         finally {
883             closeSession(session);
884         }
885     }
886 
887     public List<LayoutSet> findAll() throws SystemException {
888         return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
889     }
890 
891     public List<LayoutSet> findAll(int start, int end)
892         throws SystemException {
893         return findAll(start, end, null);
894     }
895 
896     public List<LayoutSet> findAll(int start, int end, OrderByComparator obc)
897         throws SystemException {
898         Object[] finderArgs = new Object[] {
899                 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
900             };
901 
902         List<LayoutSet> list = (List<LayoutSet>)FinderCacheUtil.getResult(FINDER_PATH_FIND_ALL,
903                 finderArgs, this);
904 
905         if (list == null) {
906             Session session = null;
907 
908             try {
909                 session = openSession();
910 
911                 StringBundler query = null;
912                 String sql = null;
913 
914                 if (obc != null) {
915                     query = new StringBundler(2 +
916                             (obc.getOrderByFields().length * 3));
917 
918                     query.append(_SQL_SELECT_LAYOUTSET);
919 
920                     appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
921 
922                     sql = query.toString();
923                 }
924 
925                 sql = _SQL_SELECT_LAYOUTSET;
926 
927                 Query q = session.createQuery(sql);
928 
929                 if (obc == null) {
930                     list = (List<LayoutSet>)QueryUtil.list(q, getDialect(),
931                             start, end, false);
932 
933                     Collections.sort(list);
934                 }
935                 else {
936                     list = (List<LayoutSet>)QueryUtil.list(q, getDialect(),
937                             start, end);
938                 }
939             }
940             catch (Exception e) {
941                 throw processException(e);
942             }
943             finally {
944                 if (list == null) {
945                     list = new ArrayList<LayoutSet>();
946                 }
947 
948                 cacheResult(list);
949 
950                 FinderCacheUtil.putResult(FINDER_PATH_FIND_ALL, finderArgs, list);
951 
952                 closeSession(session);
953             }
954         }
955 
956         return list;
957     }
958 
959     public void removeByGroupId(long groupId) throws SystemException {
960         for (LayoutSet layoutSet : findByGroupId(groupId)) {
961             remove(layoutSet);
962         }
963     }
964 
965     public void removeByVirtualHost(String virtualHost)
966         throws NoSuchLayoutSetException, SystemException {
967         LayoutSet layoutSet = findByVirtualHost(virtualHost);
968 
969         remove(layoutSet);
970     }
971 
972     public void removeByG_P(long groupId, boolean privateLayout)
973         throws NoSuchLayoutSetException, SystemException {
974         LayoutSet layoutSet = findByG_P(groupId, privateLayout);
975 
976         remove(layoutSet);
977     }
978 
979     public void removeAll() throws SystemException {
980         for (LayoutSet layoutSet : findAll()) {
981             remove(layoutSet);
982         }
983     }
984 
985     public int countByGroupId(long groupId) throws SystemException {
986         Object[] finderArgs = new Object[] { new Long(groupId) };
987 
988         Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_GROUPID,
989                 finderArgs, this);
990 
991         if (count == null) {
992             Session session = null;
993 
994             try {
995                 session = openSession();
996 
997                 StringBundler query = new StringBundler(2);
998 
999                 query.append(_SQL_COUNT_LAYOUTSET_WHERE);
1000
1001                query.append(_FINDER_COLUMN_GROUPID_GROUPID_2);
1002
1003                String sql = query.toString();
1004
1005                Query q = session.createQuery(sql);
1006
1007                QueryPos qPos = QueryPos.getInstance(q);
1008
1009                qPos.add(groupId);
1010
1011                count = (Long)q.uniqueResult();
1012            }
1013            catch (Exception e) {
1014                throw processException(e);
1015            }
1016            finally {
1017                if (count == null) {
1018                    count = Long.valueOf(0);
1019                }
1020
1021                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_GROUPID,
1022                    finderArgs, count);
1023
1024                closeSession(session);
1025            }
1026        }
1027
1028        return count.intValue();
1029    }
1030
1031    public int countByVirtualHost(String virtualHost) throws SystemException {
1032        Object[] finderArgs = new Object[] { virtualHost };
1033
1034        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_VIRTUALHOST,
1035                finderArgs, this);
1036
1037        if (count == null) {
1038            Session session = null;
1039
1040            try {
1041                session = openSession();
1042
1043                StringBundler query = new StringBundler(2);
1044
1045                query.append(_SQL_COUNT_LAYOUTSET_WHERE);
1046
1047                if (virtualHost == null) {
1048                    query.append(_FINDER_COLUMN_VIRTUALHOST_VIRTUALHOST_1);
1049                }
1050                else {
1051                    if (virtualHost.equals(StringPool.BLANK)) {
1052                        query.append(_FINDER_COLUMN_VIRTUALHOST_VIRTUALHOST_3);
1053                    }
1054                    else {
1055                        query.append(_FINDER_COLUMN_VIRTUALHOST_VIRTUALHOST_2);
1056                    }
1057                }
1058
1059                String sql = query.toString();
1060
1061                Query q = session.createQuery(sql);
1062
1063                QueryPos qPos = QueryPos.getInstance(q);
1064
1065                if (virtualHost != null) {
1066                    qPos.add(virtualHost);
1067                }
1068
1069                count = (Long)q.uniqueResult();
1070            }
1071            catch (Exception e) {
1072                throw processException(e);
1073            }
1074            finally {
1075                if (count == null) {
1076                    count = Long.valueOf(0);
1077                }
1078
1079                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_VIRTUALHOST,
1080                    finderArgs, count);
1081
1082                closeSession(session);
1083            }
1084        }
1085
1086        return count.intValue();
1087    }
1088
1089    public int countByG_P(long groupId, boolean privateLayout)
1090        throws SystemException {
1091        Object[] finderArgs = new Object[] {
1092                new Long(groupId), Boolean.valueOf(privateLayout)
1093            };
1094
1095        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_G_P,
1096                finderArgs, this);
1097
1098        if (count == null) {
1099            Session session = null;
1100
1101            try {
1102                session = openSession();
1103
1104                StringBundler query = new StringBundler(3);
1105
1106                query.append(_SQL_COUNT_LAYOUTSET_WHERE);
1107
1108                query.append(_FINDER_COLUMN_G_P_GROUPID_2);
1109
1110                query.append(_FINDER_COLUMN_G_P_PRIVATELAYOUT_2);
1111
1112                String sql = query.toString();
1113
1114                Query q = session.createQuery(sql);
1115
1116                QueryPos qPos = QueryPos.getInstance(q);
1117
1118                qPos.add(groupId);
1119
1120                qPos.add(privateLayout);
1121
1122                count = (Long)q.uniqueResult();
1123            }
1124            catch (Exception e) {
1125                throw processException(e);
1126            }
1127            finally {
1128                if (count == null) {
1129                    count = Long.valueOf(0);
1130                }
1131
1132                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_G_P, finderArgs,
1133                    count);
1134
1135                closeSession(session);
1136            }
1137        }
1138
1139        return count.intValue();
1140    }
1141
1142    public int countAll() throws SystemException {
1143        Object[] finderArgs = new Object[0];
1144
1145        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
1146                finderArgs, this);
1147
1148        if (count == null) {
1149            Session session = null;
1150
1151            try {
1152                session = openSession();
1153
1154                Query q = session.createQuery(_SQL_COUNT_LAYOUTSET);
1155
1156                count = (Long)q.uniqueResult();
1157            }
1158            catch (Exception e) {
1159                throw processException(e);
1160            }
1161            finally {
1162                if (count == null) {
1163                    count = Long.valueOf(0);
1164                }
1165
1166                FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL, finderArgs,
1167                    count);
1168
1169                closeSession(session);
1170            }
1171        }
1172
1173        return count.intValue();
1174    }
1175
1176    public void afterPropertiesSet() {
1177        String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
1178                    com.liferay.portal.util.PropsUtil.get(
1179                        "value.object.listener.com.liferay.portal.model.LayoutSet")));
1180
1181        if (listenerClassNames.length > 0) {
1182            try {
1183                List<ModelListener<LayoutSet>> listenersList = new ArrayList<ModelListener<LayoutSet>>();
1184
1185                for (String listenerClassName : listenerClassNames) {
1186                    listenersList.add((ModelListener<LayoutSet>)Class.forName(
1187                            listenerClassName).newInstance());
1188                }
1189
1190                listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
1191            }
1192            catch (Exception e) {
1193                _log.error(e);
1194            }
1195        }
1196    }
1197
1198    @BeanReference(name = "com.liferay.portal.service.persistence.AccountPersistence")
1199    protected com.liferay.portal.service.persistence.AccountPersistence accountPersistence;
1200    @BeanReference(name = "com.liferay.portal.service.persistence.AddressPersistence")
1201    protected com.liferay.portal.service.persistence.AddressPersistence addressPersistence;
1202    @BeanReference(name = "com.liferay.portal.service.persistence.BrowserTrackerPersistence")
1203    protected com.liferay.portal.service.persistence.BrowserTrackerPersistence browserTrackerPersistence;
1204    @BeanReference(name = "com.liferay.portal.service.persistence.ClassNamePersistence")
1205    protected com.liferay.portal.service.persistence.ClassNamePersistence classNamePersistence;
1206    @BeanReference(name = "com.liferay.portal.service.persistence.CompanyPersistence")
1207    protected com.liferay.portal.service.persistence.CompanyPersistence companyPersistence;
1208    @BeanReference(name = "com.liferay.portal.service.persistence.ContactPersistence")
1209    protected com.liferay.portal.service.persistence.ContactPersistence contactPersistence;
1210    @BeanReference(name = "com.liferay.portal.service.persistence.CountryPersistence")
1211    protected com.liferay.portal.service.persistence.CountryPersistence countryPersistence;
1212    @BeanReference(name = "com.liferay.portal.service.persistence.EmailAddressPersistence")
1213    protected com.liferay.portal.service.persistence.EmailAddressPersistence emailAddressPersistence;
1214    @BeanReference(name = "com.liferay.portal.service.persistence.GroupPersistence")
1215    protected com.liferay.portal.service.persistence.GroupPersistence groupPersistence;
1216    @BeanReference(name = "com.liferay.portal.service.persistence.ImagePersistence")
1217    protected com.liferay.portal.service.persistence.ImagePersistence imagePersistence;
1218    @BeanReference(name = "com.liferay.portal.service.persistence.LayoutPersistence")
1219    protected com.liferay.portal.service.persistence.LayoutPersistence layoutPersistence;
1220    @BeanReference(name = "com.liferay.portal.service.persistence.LayoutPrototypePersistence")
1221    protected com.liferay.portal.service.persistence.LayoutPrototypePersistence layoutPrototypePersistence;
1222    @BeanReference(name = "com.liferay.portal.service.persistence.LayoutSetPersistence")
1223    protected com.liferay.portal.service.persistence.LayoutSetPersistence layoutSetPersistence;
1224    @BeanReference(name = "com.liferay.portal.service.persistence.LayoutSetPrototypePersistence")
1225    protected com.liferay.portal.service.persistence.LayoutSetPrototypePersistence layoutSetPrototypePersistence;
1226    @BeanReference(name = "com.liferay.portal.service.persistence.ListTypePersistence")
1227    protected com.liferay.portal.service.persistence.ListTypePersistence listTypePersistence;
1228    @BeanReference(name = "com.liferay.portal.service.persistence.LockPersistence")
1229    protected com.liferay.portal.service.persistence.LockPersistence lockPersistence;
1230    @BeanReference(name = "com.liferay.portal.service.persistence.MembershipRequestPersistence")
1231    protected com.liferay.portal.service.persistence.MembershipRequestPersistence membershipRequestPersistence;
1232    @BeanReference(name = "com.liferay.portal.service.persistence.OrganizationPersistence")
1233    protected com.liferay.portal.service.persistence.OrganizationPersistence organizationPersistence;
1234    @BeanReference(name = "com.liferay.portal.service.persistence.OrgGroupPermissionPersistence")
1235    protected com.liferay.portal.service.persistence.OrgGroupPermissionPersistence orgGroupPermissionPersistence;
1236    @BeanReference(name = "com.liferay.portal.service.persistence.OrgGroupRolePersistence")
1237    protected com.liferay.portal.service.persistence.OrgGroupRolePersistence orgGroupRolePersistence;
1238    @BeanReference(name = "com.liferay.portal.service.persistence.OrgLaborPersistence")
1239    protected com.liferay.portal.service.persistence.OrgLaborPersistence orgLaborPersistence;
1240    @BeanReference(name = "com.liferay.portal.service.persistence.PasswordPolicyPersistence")
1241    protected com.liferay.portal.service.persistence.PasswordPolicyPersistence passwordPolicyPersistence;
1242    @BeanReference(name = "com.liferay.portal.service.persistence.PasswordPolicyRelPersistence")
1243    protected com.liferay.portal.service.persistence.PasswordPolicyRelPersistence passwordPolicyRelPersistence;
1244    @BeanReference(name = "com.liferay.portal.service.persistence.PasswordTrackerPersistence")
1245    protected com.liferay.portal.service.persistence.PasswordTrackerPersistence passwordTrackerPersistence;
1246    @BeanReference(name = "com.liferay.portal.service.persistence.PermissionPersistence")
1247    protected com.liferay.portal.service.persistence.PermissionPersistence permissionPersistence;
1248    @BeanReference(name = "com.liferay.portal.service.persistence.PhonePersistence")
1249    protected com.liferay.portal.service.persistence.PhonePersistence phonePersistence;
1250    @BeanReference(name = "com.liferay.portal.service.persistence.PluginSettingPersistence")
1251    protected com.liferay.portal.service.persistence.PluginSettingPersistence pluginSettingPersistence;
1252    @BeanReference(name = "com.liferay.portal.service.persistence.PortletPersistence")
1253    protected com.liferay.portal.service.persistence.PortletPersistence portletPersistence;
1254    @BeanReference(name = "com.liferay.portal.service.persistence.PortletItemPersistence")
1255    protected com.liferay.portal.service.persistence.PortletItemPersistence portletItemPersistence;
1256    @BeanReference(name = "com.liferay.portal.service.persistence.PortletPreferencesPersistence")
1257    protected com.liferay.portal.service.persistence.PortletPreferencesPersistence portletPreferencesPersistence;
1258    @BeanReference(name = "com.liferay.portal.service.persistence.RegionPersistence")
1259    protected com.liferay.portal.service.persistence.RegionPersistence regionPersistence;
1260    @BeanReference(name = "com.liferay.portal.service.persistence.ReleasePersistence")
1261    protected com.liferay.portal.service.persistence.ReleasePersistence releasePersistence;
1262    @BeanReference(name = "com.liferay.portal.service.persistence.ResourcePersistence")
1263    protected com.liferay.portal.service.persistence.ResourcePersistence resourcePersistence;
1264    @BeanReference(name = "com.liferay.portal.service.persistence.ResourceActionPersistence")
1265    protected com.liferay.portal.service.persistence.ResourceActionPersistence resourceActionPersistence;
1266    @BeanReference(name = "com.liferay.portal.service.persistence.ResourceCodePersistence")
1267    protected com.liferay.portal.service.persistence.ResourceCodePersistence resourceCodePersistence;
1268    @BeanReference(name = "com.liferay.portal.service.persistence.ResourcePermissionPersistence")
1269    protected com.liferay.portal.service.persistence.ResourcePermissionPersistence resourcePermissionPersistence;
1270    @BeanReference(name = "com.liferay.portal.service.persistence.RolePersistence")
1271    protected com.liferay.portal.service.persistence.RolePersistence rolePersistence;
1272    @BeanReference(name = "com.liferay.portal.service.persistence.ServiceComponentPersistence")
1273    protected com.liferay.portal.service.persistence.ServiceComponentPersistence serviceComponentPersistence;
1274    @BeanReference(name = "com.liferay.portal.service.persistence.ShardPersistence")
1275    protected com.liferay.portal.service.persistence.ShardPersistence shardPersistence;
1276    @BeanReference(name = "com.liferay.portal.service.persistence.SubscriptionPersistence")
1277    protected com.liferay.portal.service.persistence.SubscriptionPersistence subscriptionPersistence;
1278    @BeanReference(name = "com.liferay.portal.service.persistence.UserPersistence")
1279    protected com.liferay.portal.service.persistence.UserPersistence userPersistence;
1280    @BeanReference(name = "com.liferay.portal.service.persistence.UserGroupPersistence")
1281    protected com.liferay.portal.service.persistence.UserGroupPersistence userGroupPersistence;
1282    @BeanReference(name = "com.liferay.portal.service.persistence.UserGroupGroupRolePersistence")
1283    protected com.liferay.portal.service.persistence.UserGroupGroupRolePersistence userGroupGroupRolePersistence;
1284    @BeanReference(name = "com.liferay.portal.service.persistence.UserGroupRolePersistence")
1285    protected com.liferay.portal.service.persistence.UserGroupRolePersistence userGroupRolePersistence;
1286    @BeanReference(name = "com.liferay.portal.service.persistence.UserIdMapperPersistence")
1287    protected com.liferay.portal.service.persistence.UserIdMapperPersistence userIdMapperPersistence;
1288    @BeanReference(name = "com.liferay.portal.service.persistence.UserTrackerPersistence")
1289    protected com.liferay.portal.service.persistence.UserTrackerPersistence userTrackerPersistence;
1290    @BeanReference(name = "com.liferay.portal.service.persistence.UserTrackerPathPersistence")
1291    protected com.liferay.portal.service.persistence.UserTrackerPathPersistence userTrackerPathPersistence;
1292    @BeanReference(name = "com.liferay.portal.service.persistence.WebDAVPropsPersistence")
1293    protected com.liferay.portal.service.persistence.WebDAVPropsPersistence webDAVPropsPersistence;
1294    @BeanReference(name = "com.liferay.portal.service.persistence.WebsitePersistence")
1295    protected com.liferay.portal.service.persistence.WebsitePersistence websitePersistence;
1296    @BeanReference(name = "com.liferay.portal.service.persistence.WorkflowDefinitionLinkPersistence")
1297    protected com.liferay.portal.service.persistence.WorkflowDefinitionLinkPersistence workflowDefinitionLinkPersistence;
1298    @BeanReference(name = "com.liferay.portal.service.persistence.WorkflowInstanceLinkPersistence")
1299    protected com.liferay.portal.service.persistence.WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence;
1300    private static final String _SQL_SELECT_LAYOUTSET = "SELECT layoutSet FROM LayoutSet layoutSet";
1301    private static final String _SQL_SELECT_LAYOUTSET_WHERE = "SELECT layoutSet FROM LayoutSet layoutSet WHERE ";
1302    private static final String _SQL_COUNT_LAYOUTSET = "SELECT COUNT(layoutSet) FROM LayoutSet layoutSet";
1303    private static final String _SQL_COUNT_LAYOUTSET_WHERE = "SELECT COUNT(layoutSet) FROM LayoutSet layoutSet WHERE ";
1304    private static final String _FINDER_COLUMN_GROUPID_GROUPID_2 = "layoutSet.groupId = ?";
1305    private static final String _FINDER_COLUMN_VIRTUALHOST_VIRTUALHOST_1 = "layoutSet.virtualHost IS NULL";
1306    private static final String _FINDER_COLUMN_VIRTUALHOST_VIRTUALHOST_2 = "layoutSet.virtualHost = ?";
1307    private static final String _FINDER_COLUMN_VIRTUALHOST_VIRTUALHOST_3 = "(layoutSet.virtualHost IS NULL OR layoutSet.virtualHost = ?)";
1308    private static final String _FINDER_COLUMN_G_P_GROUPID_2 = "layoutSet.groupId = ? AND ";
1309    private static final String _FINDER_COLUMN_G_P_PRIVATELAYOUT_2 = "layoutSet.privateLayout = ?";
1310    private static final String _ORDER_BY_ENTITY_ALIAS = "layoutSet.";
1311    private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No LayoutSet exists with the primary key ";
1312    private static final String _NO_SUCH_ENTITY_WITH_KEY = "No LayoutSet exists with the key {";
1313    private static Log _log = LogFactoryUtil.getLog(LayoutSetPersistenceImpl.class);
1314}