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.NoSuchModelException;
18  import com.liferay.portal.NoSuchWebsiteException;
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.model.ModelListener;
38  import com.liferay.portal.model.Website;
39  import com.liferay.portal.model.impl.WebsiteImpl;
40  import com.liferay.portal.model.impl.WebsiteModelImpl;
41  import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
42  
43  import java.io.Serializable;
44  
45  import java.util.ArrayList;
46  import java.util.Collections;
47  import java.util.List;
48  
49  /**
50   * <a href="WebsitePersistenceImpl.java.html"><b><i>View Source</i></b></a>
51   *
52   * <p>
53   * ServiceBuilder generated this class. Modifications in this class will be
54   * overwritten the next time is generated.
55   * </p>
56   *
57   * @author    Brian Wing Shun Chan
58   * @see       WebsitePersistence
59   * @see       WebsiteUtil
60   * @generated
61   */
62  public class WebsitePersistenceImpl extends BasePersistenceImpl<Website>
63      implements WebsitePersistence {
64      public static final String FINDER_CLASS_NAME_ENTITY = WebsiteImpl.class.getName();
65      public static final String FINDER_CLASS_NAME_LIST = FINDER_CLASS_NAME_ENTITY +
66          ".List";
67      public static final FinderPath FINDER_PATH_FIND_BY_COMPANYID = new FinderPath(WebsiteModelImpl.ENTITY_CACHE_ENABLED,
68              WebsiteModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
69              "findByCompanyId", new String[] { Long.class.getName() });
70      public static final FinderPath FINDER_PATH_FIND_BY_OBC_COMPANYID = new FinderPath(WebsiteModelImpl.ENTITY_CACHE_ENABLED,
71              WebsiteModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
72              "findByCompanyId",
73              new String[] {
74                  Long.class.getName(),
75                  
76              "java.lang.Integer", "java.lang.Integer",
77                  "com.liferay.portal.kernel.util.OrderByComparator"
78              });
79      public static final FinderPath FINDER_PATH_COUNT_BY_COMPANYID = new FinderPath(WebsiteModelImpl.ENTITY_CACHE_ENABLED,
80              WebsiteModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
81              "countByCompanyId", new String[] { Long.class.getName() });
82      public static final FinderPath FINDER_PATH_FIND_BY_USERID = new FinderPath(WebsiteModelImpl.ENTITY_CACHE_ENABLED,
83              WebsiteModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
84              "findByUserId", new String[] { Long.class.getName() });
85      public static final FinderPath FINDER_PATH_FIND_BY_OBC_USERID = new FinderPath(WebsiteModelImpl.ENTITY_CACHE_ENABLED,
86              WebsiteModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
87              "findByUserId",
88              new String[] {
89                  Long.class.getName(),
90                  
91              "java.lang.Integer", "java.lang.Integer",
92                  "com.liferay.portal.kernel.util.OrderByComparator"
93              });
94      public static final FinderPath FINDER_PATH_COUNT_BY_USERID = new FinderPath(WebsiteModelImpl.ENTITY_CACHE_ENABLED,
95              WebsiteModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
96              "countByUserId", new String[] { Long.class.getName() });
97      public static final FinderPath FINDER_PATH_FIND_BY_C_C = new FinderPath(WebsiteModelImpl.ENTITY_CACHE_ENABLED,
98              WebsiteModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
99              "findByC_C",
100             new String[] { Long.class.getName(), Long.class.getName() });
101     public static final FinderPath FINDER_PATH_FIND_BY_OBC_C_C = new FinderPath(WebsiteModelImpl.ENTITY_CACHE_ENABLED,
102             WebsiteModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
103             "findByC_C",
104             new String[] {
105                 Long.class.getName(), Long.class.getName(),
106                 
107             "java.lang.Integer", "java.lang.Integer",
108                 "com.liferay.portal.kernel.util.OrderByComparator"
109             });
110     public static final FinderPath FINDER_PATH_COUNT_BY_C_C = new FinderPath(WebsiteModelImpl.ENTITY_CACHE_ENABLED,
111             WebsiteModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
112             "countByC_C",
113             new String[] { Long.class.getName(), Long.class.getName() });
114     public static final FinderPath FINDER_PATH_FIND_BY_C_C_C = new FinderPath(WebsiteModelImpl.ENTITY_CACHE_ENABLED,
115             WebsiteModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
116             "findByC_C_C",
117             new String[] {
118                 Long.class.getName(), Long.class.getName(), Long.class.getName()
119             });
120     public static final FinderPath FINDER_PATH_FIND_BY_OBC_C_C_C = new FinderPath(WebsiteModelImpl.ENTITY_CACHE_ENABLED,
121             WebsiteModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
122             "findByC_C_C",
123             new String[] {
124                 Long.class.getName(), Long.class.getName(), Long.class.getName(),
125                 
126             "java.lang.Integer", "java.lang.Integer",
127                 "com.liferay.portal.kernel.util.OrderByComparator"
128             });
129     public static final FinderPath FINDER_PATH_COUNT_BY_C_C_C = new FinderPath(WebsiteModelImpl.ENTITY_CACHE_ENABLED,
130             WebsiteModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
131             "countByC_C_C",
132             new String[] {
133                 Long.class.getName(), Long.class.getName(), Long.class.getName()
134             });
135     public static final FinderPath FINDER_PATH_FIND_BY_C_C_C_P = new FinderPath(WebsiteModelImpl.ENTITY_CACHE_ENABLED,
136             WebsiteModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
137             "findByC_C_C_P",
138             new String[] {
139                 Long.class.getName(), Long.class.getName(), Long.class.getName(),
140                 Boolean.class.getName()
141             });
142     public static final FinderPath FINDER_PATH_FIND_BY_OBC_C_C_C_P = new FinderPath(WebsiteModelImpl.ENTITY_CACHE_ENABLED,
143             WebsiteModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
144             "findByC_C_C_P",
145             new String[] {
146                 Long.class.getName(), Long.class.getName(), Long.class.getName(),
147                 Boolean.class.getName(),
148                 
149             "java.lang.Integer", "java.lang.Integer",
150                 "com.liferay.portal.kernel.util.OrderByComparator"
151             });
152     public static final FinderPath FINDER_PATH_COUNT_BY_C_C_C_P = new FinderPath(WebsiteModelImpl.ENTITY_CACHE_ENABLED,
153             WebsiteModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
154             "countByC_C_C_P",
155             new String[] {
156                 Long.class.getName(), Long.class.getName(), Long.class.getName(),
157                 Boolean.class.getName()
158             });
159     public static final FinderPath FINDER_PATH_FIND_ALL = new FinderPath(WebsiteModelImpl.ENTITY_CACHE_ENABLED,
160             WebsiteModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
161             "findAll", new String[0]);
162     public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(WebsiteModelImpl.ENTITY_CACHE_ENABLED,
163             WebsiteModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
164             "countAll", new String[0]);
165 
166     public void cacheResult(Website website) {
167         EntityCacheUtil.putResult(WebsiteModelImpl.ENTITY_CACHE_ENABLED,
168             WebsiteImpl.class, website.getPrimaryKey(), website);
169     }
170 
171     public void cacheResult(List<Website> websites) {
172         for (Website website : websites) {
173             if (EntityCacheUtil.getResult(
174                         WebsiteModelImpl.ENTITY_CACHE_ENABLED,
175                         WebsiteImpl.class, website.getPrimaryKey(), this) == null) {
176                 cacheResult(website);
177             }
178         }
179     }
180 
181     public void clearCache() {
182         CacheRegistry.clear(WebsiteImpl.class.getName());
183         EntityCacheUtil.clearCache(WebsiteImpl.class.getName());
184         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
185         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
186     }
187 
188     public Website create(long websiteId) {
189         Website website = new WebsiteImpl();
190 
191         website.setNew(true);
192         website.setPrimaryKey(websiteId);
193 
194         return website;
195     }
196 
197     public Website remove(Serializable primaryKey)
198         throws NoSuchModelException, SystemException {
199         return remove(((Long)primaryKey).longValue());
200     }
201 
202     public Website remove(long websiteId)
203         throws NoSuchWebsiteException, SystemException {
204         Session session = null;
205 
206         try {
207             session = openSession();
208 
209             Website website = (Website)session.get(WebsiteImpl.class,
210                     new Long(websiteId));
211 
212             if (website == null) {
213                 if (_log.isWarnEnabled()) {
214                     _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + websiteId);
215                 }
216 
217                 throw new NoSuchWebsiteException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
218                     websiteId);
219             }
220 
221             return remove(website);
222         }
223         catch (NoSuchWebsiteException nsee) {
224             throw nsee;
225         }
226         catch (Exception e) {
227             throw processException(e);
228         }
229         finally {
230             closeSession(session);
231         }
232     }
233 
234     public Website remove(Website website) throws SystemException {
235         for (ModelListener<Website> listener : listeners) {
236             listener.onBeforeRemove(website);
237         }
238 
239         website = removeImpl(website);
240 
241         for (ModelListener<Website> listener : listeners) {
242             listener.onAfterRemove(website);
243         }
244 
245         return website;
246     }
247 
248     protected Website removeImpl(Website website) throws SystemException {
249         website = toUnwrappedModel(website);
250 
251         Session session = null;
252 
253         try {
254             session = openSession();
255 
256             if (website.isCachedModel() || BatchSessionUtil.isEnabled()) {
257                 Object staleObject = session.get(WebsiteImpl.class,
258                         website.getPrimaryKeyObj());
259 
260                 if (staleObject != null) {
261                     session.evict(staleObject);
262                 }
263             }
264 
265             session.delete(website);
266 
267             session.flush();
268         }
269         catch (Exception e) {
270             throw processException(e);
271         }
272         finally {
273             closeSession(session);
274         }
275 
276         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
277 
278         EntityCacheUtil.removeResult(WebsiteModelImpl.ENTITY_CACHE_ENABLED,
279             WebsiteImpl.class, website.getPrimaryKey());
280 
281         return website;
282     }
283 
284     /**
285      * @deprecated Use {@link BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)}.
286      */
287     public Website update(Website website) throws SystemException {
288         if (_log.isWarnEnabled()) {
289             _log.warn(
290                 "Using the deprecated update(Website website) method. Use update(Website website, boolean merge) instead.");
291         }
292 
293         return update(website, false);
294     }
295 
296     public Website updateImpl(com.liferay.portal.model.Website website,
297         boolean merge) throws SystemException {
298         website = toUnwrappedModel(website);
299 
300         Session session = null;
301 
302         try {
303             session = openSession();
304 
305             BatchSessionUtil.update(session, website, merge);
306 
307             website.setNew(false);
308         }
309         catch (Exception e) {
310             throw processException(e);
311         }
312         finally {
313             closeSession(session);
314         }
315 
316         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
317 
318         EntityCacheUtil.putResult(WebsiteModelImpl.ENTITY_CACHE_ENABLED,
319             WebsiteImpl.class, website.getPrimaryKey(), website);
320 
321         return website;
322     }
323 
324     protected Website toUnwrappedModel(Website website) {
325         if (website instanceof WebsiteImpl) {
326             return website;
327         }
328 
329         WebsiteImpl websiteImpl = new WebsiteImpl();
330 
331         websiteImpl.setNew(website.isNew());
332         websiteImpl.setPrimaryKey(website.getPrimaryKey());
333 
334         websiteImpl.setWebsiteId(website.getWebsiteId());
335         websiteImpl.setCompanyId(website.getCompanyId());
336         websiteImpl.setUserId(website.getUserId());
337         websiteImpl.setUserName(website.getUserName());
338         websiteImpl.setCreateDate(website.getCreateDate());
339         websiteImpl.setModifiedDate(website.getModifiedDate());
340         websiteImpl.setClassNameId(website.getClassNameId());
341         websiteImpl.setClassPK(website.getClassPK());
342         websiteImpl.setUrl(website.getUrl());
343         websiteImpl.setTypeId(website.getTypeId());
344         websiteImpl.setPrimary(website.isPrimary());
345 
346         return websiteImpl;
347     }
348 
349     public Website findByPrimaryKey(Serializable primaryKey)
350         throws NoSuchModelException, SystemException {
351         return findByPrimaryKey(((Long)primaryKey).longValue());
352     }
353 
354     public Website findByPrimaryKey(long websiteId)
355         throws NoSuchWebsiteException, SystemException {
356         Website website = fetchByPrimaryKey(websiteId);
357 
358         if (website == null) {
359             if (_log.isWarnEnabled()) {
360                 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + websiteId);
361             }
362 
363             throw new NoSuchWebsiteException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
364                 websiteId);
365         }
366 
367         return website;
368     }
369 
370     public Website fetchByPrimaryKey(Serializable primaryKey)
371         throws SystemException {
372         return fetchByPrimaryKey(((Long)primaryKey).longValue());
373     }
374 
375     public Website fetchByPrimaryKey(long websiteId) throws SystemException {
376         Website website = (Website)EntityCacheUtil.getResult(WebsiteModelImpl.ENTITY_CACHE_ENABLED,
377                 WebsiteImpl.class, websiteId, this);
378 
379         if (website == null) {
380             Session session = null;
381 
382             try {
383                 session = openSession();
384 
385                 website = (Website)session.get(WebsiteImpl.class,
386                         new Long(websiteId));
387             }
388             catch (Exception e) {
389                 throw processException(e);
390             }
391             finally {
392                 if (website != null) {
393                     cacheResult(website);
394                 }
395 
396                 closeSession(session);
397             }
398         }
399 
400         return website;
401     }
402 
403     public List<Website> findByCompanyId(long companyId)
404         throws SystemException {
405         Object[] finderArgs = new Object[] { new Long(companyId) };
406 
407         List<Website> list = (List<Website>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_COMPANYID,
408                 finderArgs, this);
409 
410         if (list == null) {
411             Session session = null;
412 
413             try {
414                 session = openSession();
415 
416                 StringBundler query = new StringBundler(3);
417 
418                 query.append(_SQL_SELECT_WEBSITE_WHERE);
419 
420                 query.append(_FINDER_COLUMN_COMPANYID_COMPANYID_2);
421 
422                 query.append(WebsiteModelImpl.ORDER_BY_JPQL);
423 
424                 String sql = query.toString();
425 
426                 Query q = session.createQuery(sql);
427 
428                 QueryPos qPos = QueryPos.getInstance(q);
429 
430                 qPos.add(companyId);
431 
432                 list = q.list();
433             }
434             catch (Exception e) {
435                 throw processException(e);
436             }
437             finally {
438                 if (list == null) {
439                     list = new ArrayList<Website>();
440                 }
441 
442                 cacheResult(list);
443 
444                 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_COMPANYID,
445                     finderArgs, list);
446 
447                 closeSession(session);
448             }
449         }
450 
451         return list;
452     }
453 
454     public List<Website> findByCompanyId(long companyId, int start, int end)
455         throws SystemException {
456         return findByCompanyId(companyId, start, end, null);
457     }
458 
459     public List<Website> findByCompanyId(long companyId, int start, int end,
460         OrderByComparator obc) throws SystemException {
461         Object[] finderArgs = new Object[] {
462                 new Long(companyId),
463                 
464                 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
465             };
466 
467         List<Website> list = (List<Website>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_COMPANYID,
468                 finderArgs, this);
469 
470         if (list == null) {
471             Session session = null;
472 
473             try {
474                 session = openSession();
475 
476                 StringBundler query = null;
477 
478                 if (obc != null) {
479                     query = new StringBundler(3 +
480                             (obc.getOrderByFields().length * 3));
481                 }
482                 else {
483                     query = new StringBundler(3);
484                 }
485 
486                 query.append(_SQL_SELECT_WEBSITE_WHERE);
487 
488                 query.append(_FINDER_COLUMN_COMPANYID_COMPANYID_2);
489 
490                 if (obc != null) {
491                     appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
492                 }
493 
494                 else {
495                     query.append(WebsiteModelImpl.ORDER_BY_JPQL);
496                 }
497 
498                 String sql = query.toString();
499 
500                 Query q = session.createQuery(sql);
501 
502                 QueryPos qPos = QueryPos.getInstance(q);
503 
504                 qPos.add(companyId);
505 
506                 list = (List<Website>)QueryUtil.list(q, getDialect(), start, end);
507             }
508             catch (Exception e) {
509                 throw processException(e);
510             }
511             finally {
512                 if (list == null) {
513                     list = new ArrayList<Website>();
514                 }
515 
516                 cacheResult(list);
517 
518                 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_COMPANYID,
519                     finderArgs, list);
520 
521                 closeSession(session);
522             }
523         }
524 
525         return list;
526     }
527 
528     public Website findByCompanyId_First(long companyId, OrderByComparator obc)
529         throws NoSuchWebsiteException, SystemException {
530         List<Website> list = findByCompanyId(companyId, 0, 1, obc);
531 
532         if (list.isEmpty()) {
533             StringBundler msg = new StringBundler(4);
534 
535             msg.append(_NO_SUCH_ENTITY_WITH_KEY);
536 
537             msg.append("companyId=");
538             msg.append(companyId);
539 
540             msg.append(StringPool.CLOSE_CURLY_BRACE);
541 
542             throw new NoSuchWebsiteException(msg.toString());
543         }
544         else {
545             return list.get(0);
546         }
547     }
548 
549     public Website findByCompanyId_Last(long companyId, OrderByComparator obc)
550         throws NoSuchWebsiteException, SystemException {
551         int count = countByCompanyId(companyId);
552 
553         List<Website> list = findByCompanyId(companyId, count - 1, count, obc);
554 
555         if (list.isEmpty()) {
556             StringBundler msg = new StringBundler(4);
557 
558             msg.append(_NO_SUCH_ENTITY_WITH_KEY);
559 
560             msg.append("companyId=");
561             msg.append(companyId);
562 
563             msg.append(StringPool.CLOSE_CURLY_BRACE);
564 
565             throw new NoSuchWebsiteException(msg.toString());
566         }
567         else {
568             return list.get(0);
569         }
570     }
571 
572     public Website[] findByCompanyId_PrevAndNext(long websiteId,
573         long companyId, OrderByComparator obc)
574         throws NoSuchWebsiteException, SystemException {
575         Website website = findByPrimaryKey(websiteId);
576 
577         int count = countByCompanyId(companyId);
578 
579         Session session = null;
580 
581         try {
582             session = openSession();
583 
584             StringBundler query = null;
585 
586             if (obc != null) {
587                 query = new StringBundler(3 +
588                         (obc.getOrderByFields().length * 3));
589             }
590             else {
591                 query = new StringBundler(3);
592             }
593 
594             query.append(_SQL_SELECT_WEBSITE_WHERE);
595 
596             query.append(_FINDER_COLUMN_COMPANYID_COMPANYID_2);
597 
598             if (obc != null) {
599                 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
600             }
601 
602             else {
603                 query.append(WebsiteModelImpl.ORDER_BY_JPQL);
604             }
605 
606             String sql = query.toString();
607 
608             Query q = session.createQuery(sql);
609 
610             QueryPos qPos = QueryPos.getInstance(q);
611 
612             qPos.add(companyId);
613 
614             Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc, website);
615 
616             Website[] array = new WebsiteImpl[3];
617 
618             array[0] = (Website)objArray[0];
619             array[1] = (Website)objArray[1];
620             array[2] = (Website)objArray[2];
621 
622             return array;
623         }
624         catch (Exception e) {
625             throw processException(e);
626         }
627         finally {
628             closeSession(session);
629         }
630     }
631 
632     public List<Website> findByUserId(long userId) throws SystemException {
633         Object[] finderArgs = new Object[] { new Long(userId) };
634 
635         List<Website> list = (List<Website>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_USERID,
636                 finderArgs, this);
637 
638         if (list == null) {
639             Session session = null;
640 
641             try {
642                 session = openSession();
643 
644                 StringBundler query = new StringBundler(3);
645 
646                 query.append(_SQL_SELECT_WEBSITE_WHERE);
647 
648                 query.append(_FINDER_COLUMN_USERID_USERID_2);
649 
650                 query.append(WebsiteModelImpl.ORDER_BY_JPQL);
651 
652                 String sql = query.toString();
653 
654                 Query q = session.createQuery(sql);
655 
656                 QueryPos qPos = QueryPos.getInstance(q);
657 
658                 qPos.add(userId);
659 
660                 list = q.list();
661             }
662             catch (Exception e) {
663                 throw processException(e);
664             }
665             finally {
666                 if (list == null) {
667                     list = new ArrayList<Website>();
668                 }
669 
670                 cacheResult(list);
671 
672                 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_USERID,
673                     finderArgs, list);
674 
675                 closeSession(session);
676             }
677         }
678 
679         return list;
680     }
681 
682     public List<Website> findByUserId(long userId, int start, int end)
683         throws SystemException {
684         return findByUserId(userId, start, end, null);
685     }
686 
687     public List<Website> findByUserId(long userId, int start, int end,
688         OrderByComparator obc) throws SystemException {
689         Object[] finderArgs = new Object[] {
690                 new Long(userId),
691                 
692                 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
693             };
694 
695         List<Website> list = (List<Website>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_USERID,
696                 finderArgs, this);
697 
698         if (list == null) {
699             Session session = null;
700 
701             try {
702                 session = openSession();
703 
704                 StringBundler query = null;
705 
706                 if (obc != null) {
707                     query = new StringBundler(3 +
708                             (obc.getOrderByFields().length * 3));
709                 }
710                 else {
711                     query = new StringBundler(3);
712                 }
713 
714                 query.append(_SQL_SELECT_WEBSITE_WHERE);
715 
716                 query.append(_FINDER_COLUMN_USERID_USERID_2);
717 
718                 if (obc != null) {
719                     appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
720                 }
721 
722                 else {
723                     query.append(WebsiteModelImpl.ORDER_BY_JPQL);
724                 }
725 
726                 String sql = query.toString();
727 
728                 Query q = session.createQuery(sql);
729 
730                 QueryPos qPos = QueryPos.getInstance(q);
731 
732                 qPos.add(userId);
733 
734                 list = (List<Website>)QueryUtil.list(q, getDialect(), start, end);
735             }
736             catch (Exception e) {
737                 throw processException(e);
738             }
739             finally {
740                 if (list == null) {
741                     list = new ArrayList<Website>();
742                 }
743 
744                 cacheResult(list);
745 
746                 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_USERID,
747                     finderArgs, list);
748 
749                 closeSession(session);
750             }
751         }
752 
753         return list;
754     }
755 
756     public Website findByUserId_First(long userId, OrderByComparator obc)
757         throws NoSuchWebsiteException, SystemException {
758         List<Website> list = findByUserId(userId, 0, 1, obc);
759 
760         if (list.isEmpty()) {
761             StringBundler msg = new StringBundler(4);
762 
763             msg.append(_NO_SUCH_ENTITY_WITH_KEY);
764 
765             msg.append("userId=");
766             msg.append(userId);
767 
768             msg.append(StringPool.CLOSE_CURLY_BRACE);
769 
770             throw new NoSuchWebsiteException(msg.toString());
771         }
772         else {
773             return list.get(0);
774         }
775     }
776 
777     public Website findByUserId_Last(long userId, OrderByComparator obc)
778         throws NoSuchWebsiteException, SystemException {
779         int count = countByUserId(userId);
780 
781         List<Website> list = findByUserId(userId, count - 1, count, obc);
782 
783         if (list.isEmpty()) {
784             StringBundler msg = new StringBundler(4);
785 
786             msg.append(_NO_SUCH_ENTITY_WITH_KEY);
787 
788             msg.append("userId=");
789             msg.append(userId);
790 
791             msg.append(StringPool.CLOSE_CURLY_BRACE);
792 
793             throw new NoSuchWebsiteException(msg.toString());
794         }
795         else {
796             return list.get(0);
797         }
798     }
799 
800     public Website[] findByUserId_PrevAndNext(long websiteId, long userId,
801         OrderByComparator obc) throws NoSuchWebsiteException, SystemException {
802         Website website = findByPrimaryKey(websiteId);
803 
804         int count = countByUserId(userId);
805 
806         Session session = null;
807 
808         try {
809             session = openSession();
810 
811             StringBundler query = null;
812 
813             if (obc != null) {
814                 query = new StringBundler(3 +
815                         (obc.getOrderByFields().length * 3));
816             }
817             else {
818                 query = new StringBundler(3);
819             }
820 
821             query.append(_SQL_SELECT_WEBSITE_WHERE);
822 
823             query.append(_FINDER_COLUMN_USERID_USERID_2);
824 
825             if (obc != null) {
826                 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
827             }
828 
829             else {
830                 query.append(WebsiteModelImpl.ORDER_BY_JPQL);
831             }
832 
833             String sql = query.toString();
834 
835             Query q = session.createQuery(sql);
836 
837             QueryPos qPos = QueryPos.getInstance(q);
838 
839             qPos.add(userId);
840 
841             Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc, website);
842 
843             Website[] array = new WebsiteImpl[3];
844 
845             array[0] = (Website)objArray[0];
846             array[1] = (Website)objArray[1];
847             array[2] = (Website)objArray[2];
848 
849             return array;
850         }
851         catch (Exception e) {
852             throw processException(e);
853         }
854         finally {
855             closeSession(session);
856         }
857     }
858 
859     public List<Website> findByC_C(long companyId, long classNameId)
860         throws SystemException {
861         Object[] finderArgs = new Object[] {
862                 new Long(companyId), new Long(classNameId)
863             };
864 
865         List<Website> list = (List<Website>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_C_C,
866                 finderArgs, this);
867 
868         if (list == null) {
869             Session session = null;
870 
871             try {
872                 session = openSession();
873 
874                 StringBundler query = new StringBundler(4);
875 
876                 query.append(_SQL_SELECT_WEBSITE_WHERE);
877 
878                 query.append(_FINDER_COLUMN_C_C_COMPANYID_2);
879 
880                 query.append(_FINDER_COLUMN_C_C_CLASSNAMEID_2);
881 
882                 query.append(WebsiteModelImpl.ORDER_BY_JPQL);
883 
884                 String sql = query.toString();
885 
886                 Query q = session.createQuery(sql);
887 
888                 QueryPos qPos = QueryPos.getInstance(q);
889 
890                 qPos.add(companyId);
891 
892                 qPos.add(classNameId);
893 
894                 list = q.list();
895             }
896             catch (Exception e) {
897                 throw processException(e);
898             }
899             finally {
900                 if (list == null) {
901                     list = new ArrayList<Website>();
902                 }
903 
904                 cacheResult(list);
905 
906                 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_C_C, finderArgs,
907                     list);
908 
909                 closeSession(session);
910             }
911         }
912 
913         return list;
914     }
915 
916     public List<Website> findByC_C(long companyId, long classNameId, int start,
917         int end) throws SystemException {
918         return findByC_C(companyId, classNameId, start, end, null);
919     }
920 
921     public List<Website> findByC_C(long companyId, long classNameId, int start,
922         int end, OrderByComparator obc) throws SystemException {
923         Object[] finderArgs = new Object[] {
924                 new Long(companyId), new Long(classNameId),
925                 
926                 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
927             };
928 
929         List<Website> list = (List<Website>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_C_C,
930                 finderArgs, this);
931 
932         if (list == null) {
933             Session session = null;
934 
935             try {
936                 session = openSession();
937 
938                 StringBundler query = null;
939 
940                 if (obc != null) {
941                     query = new StringBundler(4 +
942                             (obc.getOrderByFields().length * 3));
943                 }
944                 else {
945                     query = new StringBundler(4);
946                 }
947 
948                 query.append(_SQL_SELECT_WEBSITE_WHERE);
949 
950                 query.append(_FINDER_COLUMN_C_C_COMPANYID_2);
951 
952                 query.append(_FINDER_COLUMN_C_C_CLASSNAMEID_2);
953 
954                 if (obc != null) {
955                     appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
956                 }
957 
958                 else {
959                     query.append(WebsiteModelImpl.ORDER_BY_JPQL);
960                 }
961 
962                 String sql = query.toString();
963 
964                 Query q = session.createQuery(sql);
965 
966                 QueryPos qPos = QueryPos.getInstance(q);
967 
968                 qPos.add(companyId);
969 
970                 qPos.add(classNameId);
971 
972                 list = (List<Website>)QueryUtil.list(q, getDialect(), start, end);
973             }
974             catch (Exception e) {
975                 throw processException(e);
976             }
977             finally {
978                 if (list == null) {
979                     list = new ArrayList<Website>();
980                 }
981 
982                 cacheResult(list);
983 
984                 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_C_C,
985                     finderArgs, list);
986 
987                 closeSession(session);
988             }
989         }
990 
991         return list;
992     }
993 
994     public Website findByC_C_First(long companyId, long classNameId,
995         OrderByComparator obc) throws NoSuchWebsiteException, SystemException {
996         List<Website> list = findByC_C(companyId, classNameId, 0, 1, obc);
997 
998         if (list.isEmpty()) {
999             StringBundler msg = new StringBundler(6);
1000
1001            msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1002
1003            msg.append("companyId=");
1004            msg.append(companyId);
1005
1006            msg.append(", classNameId=");
1007            msg.append(classNameId);
1008
1009            msg.append(StringPool.CLOSE_CURLY_BRACE);
1010
1011            throw new NoSuchWebsiteException(msg.toString());
1012        }
1013        else {
1014            return list.get(0);
1015        }
1016    }
1017
1018    public Website findByC_C_Last(long companyId, long classNameId,
1019        OrderByComparator obc) throws NoSuchWebsiteException, SystemException {
1020        int count = countByC_C(companyId, classNameId);
1021
1022        List<Website> list = findByC_C(companyId, classNameId, count - 1,
1023                count, obc);
1024
1025        if (list.isEmpty()) {
1026            StringBundler msg = new StringBundler(6);
1027
1028            msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1029
1030            msg.append("companyId=");
1031            msg.append(companyId);
1032
1033            msg.append(", classNameId=");
1034            msg.append(classNameId);
1035
1036            msg.append(StringPool.CLOSE_CURLY_BRACE);
1037
1038            throw new NoSuchWebsiteException(msg.toString());
1039        }
1040        else {
1041            return list.get(0);
1042        }
1043    }
1044
1045    public Website[] findByC_C_PrevAndNext(long websiteId, long companyId,
1046        long classNameId, OrderByComparator obc)
1047        throws NoSuchWebsiteException, SystemException {
1048        Website website = findByPrimaryKey(websiteId);
1049
1050        int count = countByC_C(companyId, classNameId);
1051
1052        Session session = null;
1053
1054        try {
1055            session = openSession();
1056
1057            StringBundler query = null;
1058
1059            if (obc != null) {
1060                query = new StringBundler(4 +
1061                        (obc.getOrderByFields().length * 3));
1062            }
1063            else {
1064                query = new StringBundler(4);
1065            }
1066
1067            query.append(_SQL_SELECT_WEBSITE_WHERE);
1068
1069            query.append(_FINDER_COLUMN_C_C_COMPANYID_2);
1070
1071            query.append(_FINDER_COLUMN_C_C_CLASSNAMEID_2);
1072
1073            if (obc != null) {
1074                appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
1075            }
1076
1077            else {
1078                query.append(WebsiteModelImpl.ORDER_BY_JPQL);
1079            }
1080
1081            String sql = query.toString();
1082
1083            Query q = session.createQuery(sql);
1084
1085            QueryPos qPos = QueryPos.getInstance(q);
1086
1087            qPos.add(companyId);
1088
1089            qPos.add(classNameId);
1090
1091            Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc, website);
1092
1093            Website[] array = new WebsiteImpl[3];
1094
1095            array[0] = (Website)objArray[0];
1096            array[1] = (Website)objArray[1];
1097            array[2] = (Website)objArray[2];
1098
1099            return array;
1100        }
1101        catch (Exception e) {
1102            throw processException(e);
1103        }
1104        finally {
1105            closeSession(session);
1106        }
1107    }
1108
1109    public List<Website> findByC_C_C(long companyId, long classNameId,
1110        long classPK) throws SystemException {
1111        Object[] finderArgs = new Object[] {
1112                new Long(companyId), new Long(classNameId), new Long(classPK)
1113            };
1114
1115        List<Website> list = (List<Website>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_C_C_C,
1116                finderArgs, this);
1117
1118        if (list == null) {
1119            Session session = null;
1120
1121            try {
1122                session = openSession();
1123
1124                StringBundler query = new StringBundler(5);
1125
1126                query.append(_SQL_SELECT_WEBSITE_WHERE);
1127
1128                query.append(_FINDER_COLUMN_C_C_C_COMPANYID_2);
1129
1130                query.append(_FINDER_COLUMN_C_C_C_CLASSNAMEID_2);
1131
1132                query.append(_FINDER_COLUMN_C_C_C_CLASSPK_2);
1133
1134                query.append(WebsiteModelImpl.ORDER_BY_JPQL);
1135
1136                String sql = query.toString();
1137
1138                Query q = session.createQuery(sql);
1139
1140                QueryPos qPos = QueryPos.getInstance(q);
1141
1142                qPos.add(companyId);
1143
1144                qPos.add(classNameId);
1145
1146                qPos.add(classPK);
1147
1148                list = q.list();
1149            }
1150            catch (Exception e) {
1151                throw processException(e);
1152            }
1153            finally {
1154                if (list == null) {
1155                    list = new ArrayList<Website>();
1156                }
1157
1158                cacheResult(list);
1159
1160                FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_C_C_C,
1161                    finderArgs, list);
1162
1163                closeSession(session);
1164            }
1165        }
1166
1167        return list;
1168    }
1169
1170    public List<Website> findByC_C_C(long companyId, long classNameId,
1171        long classPK, int start, int end) throws SystemException {
1172        return findByC_C_C(companyId, classNameId, classPK, start, end, null);
1173    }
1174
1175    public List<Website> findByC_C_C(long companyId, long classNameId,
1176        long classPK, int start, int end, OrderByComparator obc)
1177        throws SystemException {
1178        Object[] finderArgs = new Object[] {
1179                new Long(companyId), new Long(classNameId), new Long(classPK),
1180                
1181                String.valueOf(start), String.valueOf(end), String.valueOf(obc)
1182            };
1183
1184        List<Website> list = (List<Website>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_C_C_C,
1185                finderArgs, this);
1186
1187        if (list == null) {
1188            Session session = null;
1189
1190            try {
1191                session = openSession();
1192
1193                StringBundler query = null;
1194
1195                if (obc != null) {
1196                    query = new StringBundler(5 +
1197                            (obc.getOrderByFields().length * 3));
1198                }
1199                else {
1200                    query = new StringBundler(5);
1201                }
1202
1203                query.append(_SQL_SELECT_WEBSITE_WHERE);
1204
1205                query.append(_FINDER_COLUMN_C_C_C_COMPANYID_2);
1206
1207                query.append(_FINDER_COLUMN_C_C_C_CLASSNAMEID_2);
1208
1209                query.append(_FINDER_COLUMN_C_C_C_CLASSPK_2);
1210
1211                if (obc != null) {
1212                    appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
1213                }
1214
1215                else {
1216                    query.append(WebsiteModelImpl.ORDER_BY_JPQL);
1217                }
1218
1219                String sql = query.toString();
1220
1221                Query q = session.createQuery(sql);
1222
1223                QueryPos qPos = QueryPos.getInstance(q);
1224
1225                qPos.add(companyId);
1226
1227                qPos.add(classNameId);
1228
1229                qPos.add(classPK);
1230
1231                list = (List<Website>)QueryUtil.list(q, getDialect(), start, end);
1232            }
1233            catch (Exception e) {
1234                throw processException(e);
1235            }
1236            finally {
1237                if (list == null) {
1238                    list = new ArrayList<Website>();
1239                }
1240
1241                cacheResult(list);
1242
1243                FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_C_C_C,
1244                    finderArgs, list);
1245
1246                closeSession(session);
1247            }
1248        }
1249
1250        return list;
1251    }
1252
1253    public Website findByC_C_C_First(long companyId, long classNameId,
1254        long classPK, OrderByComparator obc)
1255        throws NoSuchWebsiteException, SystemException {
1256        List<Website> list = findByC_C_C(companyId, classNameId, classPK, 0, 1,
1257                obc);
1258
1259        if (list.isEmpty()) {
1260            StringBundler msg = new StringBundler(8);
1261
1262            msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1263
1264            msg.append("companyId=");
1265            msg.append(companyId);
1266
1267            msg.append(", classNameId=");
1268            msg.append(classNameId);
1269
1270            msg.append(", classPK=");
1271            msg.append(classPK);
1272
1273            msg.append(StringPool.CLOSE_CURLY_BRACE);
1274
1275            throw new NoSuchWebsiteException(msg.toString());
1276        }
1277        else {
1278            return list.get(0);
1279        }
1280    }
1281
1282    public Website findByC_C_C_Last(long companyId, long classNameId,
1283        long classPK, OrderByComparator obc)
1284        throws NoSuchWebsiteException, SystemException {
1285        int count = countByC_C_C(companyId, classNameId, classPK);
1286
1287        List<Website> list = findByC_C_C(companyId, classNameId, classPK,
1288                count - 1, count, obc);
1289
1290        if (list.isEmpty()) {
1291            StringBundler msg = new StringBundler(8);
1292
1293            msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1294
1295            msg.append("companyId=");
1296            msg.append(companyId);
1297
1298            msg.append(", classNameId=");
1299            msg.append(classNameId);
1300
1301            msg.append(", classPK=");
1302            msg.append(classPK);
1303
1304            msg.append(StringPool.CLOSE_CURLY_BRACE);
1305
1306            throw new NoSuchWebsiteException(msg.toString());
1307        }
1308        else {
1309            return list.get(0);
1310        }
1311    }
1312
1313    public Website[] findByC_C_C_PrevAndNext(long websiteId, long companyId,
1314        long classNameId, long classPK, OrderByComparator obc)
1315        throws NoSuchWebsiteException, SystemException {
1316        Website website = findByPrimaryKey(websiteId);
1317
1318        int count = countByC_C_C(companyId, classNameId, classPK);
1319
1320        Session session = null;
1321
1322        try {
1323            session = openSession();
1324
1325            StringBundler query = null;
1326
1327            if (obc != null) {
1328                query = new StringBundler(5 +
1329                        (obc.getOrderByFields().length * 3));
1330            }
1331            else {
1332                query = new StringBundler(5);
1333            }
1334
1335            query.append(_SQL_SELECT_WEBSITE_WHERE);
1336
1337            query.append(_FINDER_COLUMN_C_C_C_COMPANYID_2);
1338
1339            query.append(_FINDER_COLUMN_C_C_C_CLASSNAMEID_2);
1340
1341            query.append(_FINDER_COLUMN_C_C_C_CLASSPK_2);
1342
1343            if (obc != null) {
1344                appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
1345            }
1346
1347            else {
1348                query.append(WebsiteModelImpl.ORDER_BY_JPQL);
1349            }
1350
1351            String sql = query.toString();
1352
1353            Query q = session.createQuery(sql);
1354
1355            QueryPos qPos = QueryPos.getInstance(q);
1356
1357            qPos.add(companyId);
1358
1359            qPos.add(classNameId);
1360
1361            qPos.add(classPK);
1362
1363            Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc, website);
1364
1365            Website[] array = new WebsiteImpl[3];
1366
1367            array[0] = (Website)objArray[0];
1368            array[1] = (Website)objArray[1];
1369            array[2] = (Website)objArray[2];
1370
1371            return array;
1372        }
1373        catch (Exception e) {
1374            throw processException(e);
1375        }
1376        finally {
1377            closeSession(session);
1378        }
1379    }
1380
1381    public List<Website> findByC_C_C_P(long companyId, long classNameId,
1382        long classPK, boolean primary) throws SystemException {
1383        Object[] finderArgs = new Object[] {
1384                new Long(companyId), new Long(classNameId), new Long(classPK),
1385                Boolean.valueOf(primary)
1386            };
1387
1388        List<Website> list = (List<Website>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_C_C_C_P,
1389                finderArgs, this);
1390
1391        if (list == null) {
1392            Session session = null;
1393
1394            try {
1395                session = openSession();
1396
1397                StringBundler query = new StringBundler(6);
1398
1399                query.append(_SQL_SELECT_WEBSITE_WHERE);
1400
1401                query.append(_FINDER_COLUMN_C_C_C_P_COMPANYID_2);
1402
1403                query.append(_FINDER_COLUMN_C_C_C_P_CLASSNAMEID_2);
1404
1405                query.append(_FINDER_COLUMN_C_C_C_P_CLASSPK_2);
1406
1407                query.append(_FINDER_COLUMN_C_C_C_P_PRIMARY_2);
1408
1409                query.append(WebsiteModelImpl.ORDER_BY_JPQL);
1410
1411                String sql = query.toString();
1412
1413                Query q = session.createQuery(sql);
1414
1415                QueryPos qPos = QueryPos.getInstance(q);
1416
1417                qPos.add(companyId);
1418
1419                qPos.add(classNameId);
1420
1421                qPos.add(classPK);
1422
1423                qPos.add(primary);
1424
1425                list = q.list();
1426            }
1427            catch (Exception e) {
1428                throw processException(e);
1429            }
1430            finally {
1431                if (list == null) {
1432                    list = new ArrayList<Website>();
1433                }
1434
1435                cacheResult(list);
1436
1437                FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_C_C_C_P,
1438                    finderArgs, list);
1439
1440                closeSession(session);
1441            }
1442        }
1443
1444        return list;
1445    }
1446
1447    public List<Website> findByC_C_C_P(long companyId, long classNameId,
1448        long classPK, boolean primary, int start, int end)
1449        throws SystemException {
1450        return findByC_C_C_P(companyId, classNameId, classPK, primary, start,
1451            end, null);
1452    }
1453
1454    public List<Website> findByC_C_C_P(long companyId, long classNameId,
1455        long classPK, boolean primary, int start, int end, OrderByComparator obc)
1456        throws SystemException {
1457        Object[] finderArgs = new Object[] {
1458                new Long(companyId), new Long(classNameId), new Long(classPK),
1459                Boolean.valueOf(primary),
1460                
1461                String.valueOf(start), String.valueOf(end), String.valueOf(obc)
1462            };
1463
1464        List<Website> list = (List<Website>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_C_C_C_P,
1465                finderArgs, this);
1466
1467        if (list == null) {
1468            Session session = null;
1469
1470            try {
1471                session = openSession();
1472
1473                StringBundler query = null;
1474
1475                if (obc != null) {
1476                    query = new StringBundler(6 +
1477                            (obc.getOrderByFields().length * 3));
1478                }
1479                else {
1480                    query = new StringBundler(6);
1481                }
1482
1483                query.append(_SQL_SELECT_WEBSITE_WHERE);
1484
1485                query.append(_FINDER_COLUMN_C_C_C_P_COMPANYID_2);
1486
1487                query.append(_FINDER_COLUMN_C_C_C_P_CLASSNAMEID_2);
1488
1489                query.append(_FINDER_COLUMN_C_C_C_P_CLASSPK_2);
1490
1491                query.append(_FINDER_COLUMN_C_C_C_P_PRIMARY_2);
1492
1493                if (obc != null) {
1494                    appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
1495                }
1496
1497                else {
1498                    query.append(WebsiteModelImpl.ORDER_BY_JPQL);
1499                }
1500
1501                String sql = query.toString();
1502
1503                Query q = session.createQuery(sql);
1504
1505                QueryPos qPos = QueryPos.getInstance(q);
1506
1507                qPos.add(companyId);
1508
1509                qPos.add(classNameId);
1510
1511                qPos.add(classPK);
1512
1513                qPos.add(primary);
1514
1515                list = (List<Website>)QueryUtil.list(q, getDialect(), start, end);
1516            }
1517            catch (Exception e) {
1518                throw processException(e);
1519            }
1520            finally {
1521                if (list == null) {
1522                    list = new ArrayList<Website>();
1523                }
1524
1525                cacheResult(list);
1526
1527                FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_C_C_C_P,
1528                    finderArgs, list);
1529
1530                closeSession(session);
1531            }
1532        }
1533
1534        return list;
1535    }
1536
1537    public Website findByC_C_C_P_First(long companyId, long classNameId,
1538        long classPK, boolean primary, OrderByComparator obc)
1539        throws NoSuchWebsiteException, SystemException {
1540        List<Website> list = findByC_C_C_P(companyId, classNameId, classPK,
1541                primary, 0, 1, obc);
1542
1543        if (list.isEmpty()) {
1544            StringBundler msg = new StringBundler(10);
1545
1546            msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1547
1548            msg.append("companyId=");
1549            msg.append(companyId);
1550
1551            msg.append(", classNameId=");
1552            msg.append(classNameId);
1553
1554            msg.append(", classPK=");
1555            msg.append(classPK);
1556
1557            msg.append(", primary=");
1558            msg.append(primary);
1559
1560            msg.append(StringPool.CLOSE_CURLY_BRACE);
1561
1562            throw new NoSuchWebsiteException(msg.toString());
1563        }
1564        else {
1565            return list.get(0);
1566        }
1567    }
1568
1569    public Website findByC_C_C_P_Last(long companyId, long classNameId,
1570        long classPK, boolean primary, OrderByComparator obc)
1571        throws NoSuchWebsiteException, SystemException {
1572        int count = countByC_C_C_P(companyId, classNameId, classPK, primary);
1573
1574        List<Website> list = findByC_C_C_P(companyId, classNameId, classPK,
1575                primary, count - 1, count, obc);
1576
1577        if (list.isEmpty()) {
1578            StringBundler msg = new StringBundler(10);
1579
1580            msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1581
1582            msg.append("companyId=");
1583            msg.append(companyId);
1584
1585            msg.append(", classNameId=");
1586            msg.append(classNameId);
1587
1588            msg.append(", classPK=");
1589            msg.append(classPK);
1590
1591            msg.append(", primary=");
1592            msg.append(primary);
1593
1594            msg.append(StringPool.CLOSE_CURLY_BRACE);
1595
1596            throw new NoSuchWebsiteException(msg.toString());
1597        }
1598        else {
1599            return list.get(0);
1600        }
1601    }
1602
1603    public Website[] findByC_C_C_P_PrevAndNext(long websiteId, long companyId,
1604        long classNameId, long classPK, boolean primary, OrderByComparator obc)
1605        throws NoSuchWebsiteException, SystemException {
1606        Website website = findByPrimaryKey(websiteId);
1607
1608        int count = countByC_C_C_P(companyId, classNameId, classPK, primary);
1609
1610        Session session = null;
1611
1612        try {
1613            session = openSession();
1614
1615            StringBundler query = null;
1616
1617            if (obc != null) {
1618                query = new StringBundler(6 +
1619                        (obc.getOrderByFields().length * 3));
1620            }
1621            else {
1622                query = new StringBundler(6);
1623            }
1624
1625            query.append(_SQL_SELECT_WEBSITE_WHERE);
1626
1627            query.append(_FINDER_COLUMN_C_C_C_P_COMPANYID_2);
1628
1629            query.append(_FINDER_COLUMN_C_C_C_P_CLASSNAMEID_2);
1630
1631            query.append(_FINDER_COLUMN_C_C_C_P_CLASSPK_2);
1632
1633            query.append(_FINDER_COLUMN_C_C_C_P_PRIMARY_2);
1634
1635            if (obc != null) {
1636                appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
1637            }
1638
1639            else {
1640                query.append(WebsiteModelImpl.ORDER_BY_JPQL);
1641            }
1642
1643            String sql = query.toString();
1644
1645            Query q = session.createQuery(sql);
1646
1647            QueryPos qPos = QueryPos.getInstance(q);
1648
1649            qPos.add(companyId);
1650
1651            qPos.add(classNameId);
1652
1653            qPos.add(classPK);
1654
1655            qPos.add(primary);
1656
1657            Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc, website);
1658
1659            Website[] array = new WebsiteImpl[3];
1660
1661            array[0] = (Website)objArray[0];
1662            array[1] = (Website)objArray[1];
1663            array[2] = (Website)objArray[2];
1664
1665            return array;
1666        }
1667        catch (Exception e) {
1668            throw processException(e);
1669        }
1670        finally {
1671            closeSession(session);
1672        }
1673    }
1674
1675    public List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery)
1676        throws SystemException {
1677        Session session = null;
1678
1679        try {
1680            session = openSession();
1681
1682            dynamicQuery.compile(session);
1683
1684            return dynamicQuery.list();
1685        }
1686        catch (Exception e) {
1687            throw processException(e);
1688        }
1689        finally {
1690            closeSession(session);
1691        }
1692    }
1693
1694    public List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery,
1695        int start, int end) throws SystemException {
1696        Session session = null;
1697
1698        try {
1699            session = openSession();
1700
1701            dynamicQuery.setLimit(start, end);
1702
1703            dynamicQuery.compile(session);
1704
1705            return dynamicQuery.list();
1706        }
1707        catch (Exception e) {
1708            throw processException(e);
1709        }
1710        finally {
1711            closeSession(session);
1712        }
1713    }
1714
1715    public List<Website> findAll() throws SystemException {
1716        return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
1717    }
1718
1719    public List<Website> findAll(int start, int end) throws SystemException {
1720        return findAll(start, end, null);
1721    }
1722
1723    public List<Website> findAll(int start, int end, OrderByComparator obc)
1724        throws SystemException {
1725        Object[] finderArgs = new Object[] {
1726                String.valueOf(start), String.valueOf(end), String.valueOf(obc)
1727            };
1728
1729        List<Website> list = (List<Website>)FinderCacheUtil.getResult(FINDER_PATH_FIND_ALL,
1730                finderArgs, this);
1731
1732        if (list == null) {
1733            Session session = null;
1734
1735            try {
1736                session = openSession();
1737
1738                StringBundler query = null;
1739                String sql = null;
1740
1741                if (obc != null) {
1742                    query = new StringBundler(2 +
1743                            (obc.getOrderByFields().length * 3));
1744
1745                    query.append(_SQL_SELECT_WEBSITE);
1746
1747                    appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
1748
1749                    sql = query.toString();
1750                }
1751
1752                else {
1753                    sql = _SQL_SELECT_WEBSITE.concat(WebsiteModelImpl.ORDER_BY_JPQL);
1754                }
1755
1756                Query q = session.createQuery(sql);
1757
1758                if (obc == null) {
1759                    list = (List<Website>)QueryUtil.list(q, getDialect(),
1760                            start, end, false);
1761
1762                    Collections.sort(list);
1763                }
1764                else {
1765                    list = (List<Website>)QueryUtil.list(q, getDialect(),
1766                            start, end);
1767                }
1768            }
1769            catch (Exception e) {
1770                throw processException(e);
1771            }
1772            finally {
1773                if (list == null) {
1774                    list = new ArrayList<Website>();
1775                }
1776
1777                cacheResult(list);
1778
1779                FinderCacheUtil.putResult(FINDER_PATH_FIND_ALL, finderArgs, list);
1780
1781                closeSession(session);
1782            }
1783        }
1784
1785        return list;
1786    }
1787
1788    public void removeByCompanyId(long companyId) throws SystemException {
1789        for (Website website : findByCompanyId(companyId)) {
1790            remove(website);
1791        }
1792    }
1793
1794    public void removeByUserId(long userId) throws SystemException {
1795        for (Website website : findByUserId(userId)) {
1796            remove(website);
1797        }
1798    }
1799
1800    public void removeByC_C(long companyId, long classNameId)
1801        throws SystemException {
1802        for (Website website : findByC_C(companyId, classNameId)) {
1803            remove(website);
1804        }
1805    }
1806
1807    public void removeByC_C_C(long companyId, long classNameId, long classPK)
1808        throws SystemException {
1809        for (Website website : findByC_C_C(companyId, classNameId, classPK)) {
1810            remove(website);
1811        }
1812    }
1813
1814    public void removeByC_C_C_P(long companyId, long classNameId, long classPK,
1815        boolean primary) throws SystemException {
1816        for (Website website : findByC_C_C_P(companyId, classNameId, classPK,
1817                primary)) {
1818            remove(website);
1819        }
1820    }
1821
1822    public void removeAll() throws SystemException {
1823        for (Website website : findAll()) {
1824            remove(website);
1825        }
1826    }
1827
1828    public int countByCompanyId(long companyId) throws SystemException {
1829        Object[] finderArgs = new Object[] { new Long(companyId) };
1830
1831        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_COMPANYID,
1832                finderArgs, this);
1833
1834        if (count == null) {
1835            Session session = null;
1836
1837            try {
1838                session = openSession();
1839
1840                StringBundler query = new StringBundler(2);
1841
1842                query.append(_SQL_COUNT_WEBSITE_WHERE);
1843
1844                query.append(_FINDER_COLUMN_COMPANYID_COMPANYID_2);
1845
1846                String sql = query.toString();
1847
1848                Query q = session.createQuery(sql);
1849
1850                QueryPos qPos = QueryPos.getInstance(q);
1851
1852                qPos.add(companyId);
1853
1854                count = (Long)q.uniqueResult();
1855            }
1856            catch (Exception e) {
1857                throw processException(e);
1858            }
1859            finally {
1860                if (count == null) {
1861                    count = Long.valueOf(0);
1862                }
1863
1864                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_COMPANYID,
1865                    finderArgs, count);
1866
1867                closeSession(session);
1868            }
1869        }
1870
1871        return count.intValue();
1872    }
1873
1874    public int countByUserId(long userId) throws SystemException {
1875        Object[] finderArgs = new Object[] { new Long(userId) };
1876
1877        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_USERID,
1878                finderArgs, this);
1879
1880        if (count == null) {
1881            Session session = null;
1882
1883            try {
1884                session = openSession();
1885
1886                StringBundler query = new StringBundler(2);
1887
1888                query.append(_SQL_COUNT_WEBSITE_WHERE);
1889
1890                query.append(_FINDER_COLUMN_USERID_USERID_2);
1891
1892                String sql = query.toString();
1893
1894                Query q = session.createQuery(sql);
1895
1896                QueryPos qPos = QueryPos.getInstance(q);
1897
1898                qPos.add(userId);
1899
1900                count = (Long)q.uniqueResult();
1901            }
1902            catch (Exception e) {
1903                throw processException(e);
1904            }
1905            finally {
1906                if (count == null) {
1907                    count = Long.valueOf(0);
1908                }
1909
1910                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_USERID,
1911                    finderArgs, count);
1912
1913                closeSession(session);
1914            }
1915        }
1916
1917        return count.intValue();
1918    }
1919
1920    public int countByC_C(long companyId, long classNameId)
1921        throws SystemException {
1922        Object[] finderArgs = new Object[] {
1923                new Long(companyId), new Long(classNameId)
1924            };
1925
1926        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_C_C,
1927                finderArgs, this);
1928
1929        if (count == null) {
1930            Session session = null;
1931
1932            try {
1933                session = openSession();
1934
1935                StringBundler query = new StringBundler(3);
1936
1937                query.append(_SQL_COUNT_WEBSITE_WHERE);
1938
1939                query.append(_FINDER_COLUMN_C_C_COMPANYID_2);
1940
1941                query.append(_FINDER_COLUMN_C_C_CLASSNAMEID_2);
1942
1943                String sql = query.toString();
1944
1945                Query q = session.createQuery(sql);
1946
1947                QueryPos qPos = QueryPos.getInstance(q);
1948
1949                qPos.add(companyId);
1950
1951                qPos.add(classNameId);
1952
1953                count = (Long)q.uniqueResult();
1954            }
1955            catch (Exception e) {
1956                throw processException(e);
1957            }
1958            finally {
1959                if (count == null) {
1960                    count = Long.valueOf(0);
1961                }
1962
1963                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_C_C, finderArgs,
1964                    count);
1965
1966                closeSession(session);
1967            }
1968        }
1969
1970        return count.intValue();
1971    }
1972
1973    public int countByC_C_C(long companyId, long classNameId, long classPK)
1974        throws SystemException {
1975        Object[] finderArgs = new Object[] {
1976                new Long(companyId), new Long(classNameId), new Long(classPK)
1977            };
1978
1979        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_C_C_C,
1980                finderArgs, this);
1981
1982        if (count == null) {
1983            Session session = null;
1984
1985            try {
1986                session = openSession();
1987
1988                StringBundler query = new StringBundler(4);
1989
1990                query.append(_SQL_COUNT_WEBSITE_WHERE);
1991
1992                query.append(_FINDER_COLUMN_C_C_C_COMPANYID_2);
1993
1994                query.append(_FINDER_COLUMN_C_C_C_CLASSNAMEID_2);
1995
1996                query.append(_FINDER_COLUMN_C_C_C_CLASSPK_2);
1997
1998                String sql = query.toString();
1999
2000                Query q = session.createQuery(sql);
2001
2002                QueryPos qPos = QueryPos.getInstance(q);
2003
2004                qPos.add(companyId);
2005
2006                qPos.add(classNameId);
2007
2008                qPos.add(classPK);
2009
2010                count = (Long)q.uniqueResult();
2011            }
2012            catch (Exception e) {
2013                throw processException(e);
2014            }
2015            finally {
2016                if (count == null) {
2017                    count = Long.valueOf(0);
2018                }
2019
2020                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_C_C_C,
2021                    finderArgs, count);
2022
2023                closeSession(session);
2024            }
2025        }
2026
2027        return count.intValue();
2028    }
2029
2030    public int countByC_C_C_P(long companyId, long classNameId, long classPK,
2031        boolean primary) throws SystemException {
2032        Object[] finderArgs = new Object[] {
2033                new Long(companyId), new Long(classNameId), new Long(classPK),
2034                Boolean.valueOf(primary)
2035            };
2036
2037        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_C_C_C_P,
2038                finderArgs, this);
2039
2040        if (count == null) {
2041            Session session = null;
2042
2043            try {
2044                session = openSession();
2045
2046                StringBundler query = new StringBundler(5);
2047
2048                query.append(_SQL_COUNT_WEBSITE_WHERE);
2049
2050                query.append(_FINDER_COLUMN_C_C_C_P_COMPANYID_2);
2051
2052                query.append(_FINDER_COLUMN_C_C_C_P_CLASSNAMEID_2);
2053
2054                query.append(_FINDER_COLUMN_C_C_C_P_CLASSPK_2);
2055
2056                query.append(_FINDER_COLUMN_C_C_C_P_PRIMARY_2);
2057
2058                String sql = query.toString();
2059
2060                Query q = session.createQuery(sql);
2061
2062                QueryPos qPos = QueryPos.getInstance(q);
2063
2064                qPos.add(companyId);
2065
2066                qPos.add(classNameId);
2067
2068                qPos.add(classPK);
2069
2070                qPos.add(primary);
2071
2072                count = (Long)q.uniqueResult();
2073            }
2074            catch (Exception e) {
2075                throw processException(e);
2076            }
2077            finally {
2078                if (count == null) {
2079                    count = Long.valueOf(0);
2080                }
2081
2082                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_C_C_C_P,
2083                    finderArgs, count);
2084
2085                closeSession(session);
2086            }
2087        }
2088
2089        return count.intValue();
2090    }
2091
2092    public int countAll() throws SystemException {
2093        Object[] finderArgs = new Object[0];
2094
2095        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
2096                finderArgs, this);
2097
2098        if (count == null) {
2099            Session session = null;
2100
2101            try {
2102                session = openSession();
2103
2104                Query q = session.createQuery(_SQL_COUNT_WEBSITE);
2105
2106                count = (Long)q.uniqueResult();
2107            }
2108            catch (Exception e) {
2109                throw processException(e);
2110            }
2111            finally {
2112                if (count == null) {
2113                    count = Long.valueOf(0);
2114                }
2115
2116                FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL, finderArgs,
2117                    count);
2118
2119                closeSession(session);
2120            }
2121        }
2122
2123        return count.intValue();
2124    }
2125
2126    public void afterPropertiesSet() {
2127        String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
2128                    com.liferay.portal.util.PropsUtil.get(
2129                        "value.object.listener.com.liferay.portal.model.Website")));
2130
2131        if (listenerClassNames.length > 0) {
2132            try {
2133                List<ModelListener<Website>> listenersList = new ArrayList<ModelListener<Website>>();
2134
2135                for (String listenerClassName : listenerClassNames) {
2136                    listenersList.add((ModelListener<Website>)Class.forName(
2137                            listenerClassName).newInstance());
2138                }
2139
2140                listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
2141            }
2142            catch (Exception e) {
2143                _log.error(e);
2144            }
2145        }
2146    }
2147
2148    @BeanReference(name = "com.liferay.portal.service.persistence.AccountPersistence")
2149    protected com.liferay.portal.service.persistence.AccountPersistence accountPersistence;
2150    @BeanReference(name = "com.liferay.portal.service.persistence.AddressPersistence")
2151    protected com.liferay.portal.service.persistence.AddressPersistence addressPersistence;
2152    @BeanReference(name = "com.liferay.portal.service.persistence.BrowserTrackerPersistence")
2153    protected com.liferay.portal.service.persistence.BrowserTrackerPersistence browserTrackerPersistence;
2154    @BeanReference(name = "com.liferay.portal.service.persistence.ClassNamePersistence")
2155    protected com.liferay.portal.service.persistence.ClassNamePersistence classNamePersistence;
2156    @BeanReference(name = "com.liferay.portal.service.persistence.CompanyPersistence")
2157    protected com.liferay.portal.service.persistence.CompanyPersistence companyPersistence;
2158    @BeanReference(name = "com.liferay.portal.service.persistence.ContactPersistence")
2159    protected com.liferay.portal.service.persistence.ContactPersistence contactPersistence;
2160    @BeanReference(name = "com.liferay.portal.service.persistence.CountryPersistence")
2161    protected com.liferay.portal.service.persistence.CountryPersistence countryPersistence;
2162    @BeanReference(name = "com.liferay.portal.service.persistence.EmailAddressPersistence")
2163    protected com.liferay.portal.service.persistence.EmailAddressPersistence emailAddressPersistence;
2164    @BeanReference(name = "com.liferay.portal.service.persistence.GroupPersistence")
2165    protected com.liferay.portal.service.persistence.GroupPersistence groupPersistence;
2166    @BeanReference(name = "com.liferay.portal.service.persistence.ImagePersistence")
2167    protected com.liferay.portal.service.persistence.ImagePersistence imagePersistence;
2168    @BeanReference(name = "com.liferay.portal.service.persistence.LayoutPersistence")
2169    protected com.liferay.portal.service.persistence.LayoutPersistence layoutPersistence;
2170    @BeanReference(name = "com.liferay.portal.service.persistence.LayoutSetPersistence")
2171    protected com.liferay.portal.service.persistence.LayoutSetPersistence layoutSetPersistence;
2172    @BeanReference(name = "com.liferay.portal.service.persistence.ListTypePersistence")
2173    protected com.liferay.portal.service.persistence.ListTypePersistence listTypePersistence;
2174    @BeanReference(name = "com.liferay.portal.service.persistence.LockPersistence")
2175    protected com.liferay.portal.service.persistence.LockPersistence lockPersistence;
2176    @BeanReference(name = "com.liferay.portal.service.persistence.MembershipRequestPersistence")
2177    protected com.liferay.portal.service.persistence.MembershipRequestPersistence membershipRequestPersistence;
2178    @BeanReference(name = "com.liferay.portal.service.persistence.OrganizationPersistence")
2179    protected com.liferay.portal.service.persistence.OrganizationPersistence organizationPersistence;
2180    @BeanReference(name = "com.liferay.portal.service.persistence.OrgGroupPermissionPersistence")
2181    protected com.liferay.portal.service.persistence.OrgGroupPermissionPersistence orgGroupPermissionPersistence;
2182    @BeanReference(name = "com.liferay.portal.service.persistence.OrgGroupRolePersistence")
2183    protected com.liferay.portal.service.persistence.OrgGroupRolePersistence orgGroupRolePersistence;
2184    @BeanReference(name = "com.liferay.portal.service.persistence.OrgLaborPersistence")
2185    protected com.liferay.portal.service.persistence.OrgLaborPersistence orgLaborPersistence;
2186    @BeanReference(name = "com.liferay.portal.service.persistence.PasswordPolicyPersistence")
2187    protected com.liferay.portal.service.persistence.PasswordPolicyPersistence passwordPolicyPersistence;
2188    @BeanReference(name = "com.liferay.portal.service.persistence.PasswordPolicyRelPersistence")
2189    protected com.liferay.portal.service.persistence.PasswordPolicyRelPersistence passwordPolicyRelPersistence;
2190    @BeanReference(name = "com.liferay.portal.service.persistence.PasswordTrackerPersistence")
2191    protected com.liferay.portal.service.persistence.PasswordTrackerPersistence passwordTrackerPersistence;
2192    @BeanReference(name = "com.liferay.portal.service.persistence.PermissionPersistence")
2193    protected com.liferay.portal.service.persistence.PermissionPersistence permissionPersistence;
2194    @BeanReference(name = "com.liferay.portal.service.persistence.PhonePersistence")
2195    protected com.liferay.portal.service.persistence.PhonePersistence phonePersistence;
2196    @BeanReference(name = "com.liferay.portal.service.persistence.PluginSettingPersistence")
2197    protected com.liferay.portal.service.persistence.PluginSettingPersistence pluginSettingPersistence;
2198    @BeanReference(name = "com.liferay.portal.service.persistence.PortletPersistence")
2199    protected com.liferay.portal.service.persistence.PortletPersistence portletPersistence;
2200    @BeanReference(name = "com.liferay.portal.service.persistence.PortletItemPersistence")
2201    protected com.liferay.portal.service.persistence.PortletItemPersistence portletItemPersistence;
2202    @BeanReference(name = "com.liferay.portal.service.persistence.PortletPreferencesPersistence")
2203    protected com.liferay.portal.service.persistence.PortletPreferencesPersistence portletPreferencesPersistence;
2204    @BeanReference(name = "com.liferay.portal.service.persistence.RegionPersistence")
2205    protected com.liferay.portal.service.persistence.RegionPersistence regionPersistence;
2206    @BeanReference(name = "com.liferay.portal.service.persistence.ReleasePersistence")
2207    protected com.liferay.portal.service.persistence.ReleasePersistence releasePersistence;
2208    @BeanReference(name = "com.liferay.portal.service.persistence.ResourcePersistence")
2209    protected com.liferay.portal.service.persistence.ResourcePersistence resourcePersistence;
2210    @BeanReference(name = "com.liferay.portal.service.persistence.ResourceActionPersistence")
2211    protected com.liferay.portal.service.persistence.ResourceActionPersistence resourceActionPersistence;
2212    @BeanReference(name = "com.liferay.portal.service.persistence.ResourceCodePersistence")
2213    protected com.liferay.portal.service.persistence.ResourceCodePersistence resourceCodePersistence;
2214    @BeanReference(name = "com.liferay.portal.service.persistence.ResourcePermissionPersistence")
2215    protected com.liferay.portal.service.persistence.ResourcePermissionPersistence resourcePermissionPersistence;
2216    @BeanReference(name = "com.liferay.portal.service.persistence.RolePersistence")
2217    protected com.liferay.portal.service.persistence.RolePersistence rolePersistence;
2218    @BeanReference(name = "com.liferay.portal.service.persistence.ServiceComponentPersistence")
2219    protected com.liferay.portal.service.persistence.ServiceComponentPersistence serviceComponentPersistence;
2220    @BeanReference(name = "com.liferay.portal.service.persistence.ShardPersistence")
2221    protected com.liferay.portal.service.persistence.ShardPersistence shardPersistence;
2222    @BeanReference(name = "com.liferay.portal.service.persistence.SubscriptionPersistence")
2223    protected com.liferay.portal.service.persistence.SubscriptionPersistence subscriptionPersistence;
2224    @BeanReference(name = "com.liferay.portal.service.persistence.UserPersistence")
2225    protected com.liferay.portal.service.persistence.UserPersistence userPersistence;
2226    @BeanReference(name = "com.liferay.portal.service.persistence.UserGroupPersistence")
2227    protected com.liferay.portal.service.persistence.UserGroupPersistence userGroupPersistence;
2228    @BeanReference(name = "com.liferay.portal.service.persistence.UserGroupRolePersistence")
2229    protected com.liferay.portal.service.persistence.UserGroupRolePersistence userGroupRolePersistence;
2230    @BeanReference(name = "com.liferay.portal.service.persistence.UserIdMapperPersistence")
2231    protected com.liferay.portal.service.persistence.UserIdMapperPersistence userIdMapperPersistence;
2232    @BeanReference(name = "com.liferay.portal.service.persistence.UserTrackerPersistence")
2233    protected com.liferay.portal.service.persistence.UserTrackerPersistence userTrackerPersistence;
2234    @BeanReference(name = "com.liferay.portal.service.persistence.UserTrackerPathPersistence")
2235    protected com.liferay.portal.service.persistence.UserTrackerPathPersistence userTrackerPathPersistence;
2236    @BeanReference(name = "com.liferay.portal.service.persistence.WebDAVPropsPersistence")
2237    protected com.liferay.portal.service.persistence.WebDAVPropsPersistence webDAVPropsPersistence;
2238    @BeanReference(name = "com.liferay.portal.service.persistence.WebsitePersistence")
2239    protected com.liferay.portal.service.persistence.WebsitePersistence websitePersistence;
2240    private static final String _SQL_SELECT_WEBSITE = "SELECT website FROM Website website";
2241    private static final String _SQL_SELECT_WEBSITE_WHERE = "SELECT website FROM Website website WHERE ";
2242    private static final String _SQL_COUNT_WEBSITE = "SELECT COUNT(website) FROM Website website";
2243    private static final String _SQL_COUNT_WEBSITE_WHERE = "SELECT COUNT(website) FROM Website website WHERE ";
2244    private static final String _FINDER_COLUMN_COMPANYID_COMPANYID_2 = "website.companyId = ?";
2245    private static final String _FINDER_COLUMN_USERID_USERID_2 = "website.userId = ?";
2246    private static final String _FINDER_COLUMN_C_C_COMPANYID_2 = "website.companyId = ? AND ";
2247    private static final String _FINDER_COLUMN_C_C_CLASSNAMEID_2 = "website.classNameId = ?";
2248    private static final String _FINDER_COLUMN_C_C_C_COMPANYID_2 = "website.companyId = ? AND ";
2249    private static final String _FINDER_COLUMN_C_C_C_CLASSNAMEID_2 = "website.classNameId = ? AND ";
2250    private static final String _FINDER_COLUMN_C_C_C_CLASSPK_2 = "website.classPK = ?";
2251    private static final String _FINDER_COLUMN_C_C_C_P_COMPANYID_2 = "website.companyId = ? AND ";
2252    private static final String _FINDER_COLUMN_C_C_C_P_CLASSNAMEID_2 = "website.classNameId = ? AND ";
2253    private static final String _FINDER_COLUMN_C_C_C_P_CLASSPK_2 = "website.classPK = ? AND ";
2254    private static final String _FINDER_COLUMN_C_C_C_P_PRIMARY_2 = "website.primary = ?";
2255    private static final String _ORDER_BY_ENTITY_ALIAS = "website.";
2256    private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No Website exists with the primary key ";
2257    private static final String _NO_SUCH_ENTITY_WITH_KEY = "No Website exists with the key {";
2258    private static Log _log = LogFactoryUtil.getLog(WebsitePersistenceImpl.class);
2259}