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