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