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