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