001
014
015 package com.liferay.portal.service.persistence;
016
017 import com.liferay.portal.NoSuchModelException;
018 import com.liferay.portal.NoSuchPhoneException;
019 import com.liferay.portal.kernel.annotation.BeanReference;
020 import com.liferay.portal.kernel.cache.CacheRegistryUtil;
021 import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
022 import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
023 import com.liferay.portal.kernel.dao.orm.FinderPath;
024 import com.liferay.portal.kernel.dao.orm.Query;
025 import com.liferay.portal.kernel.dao.orm.QueryPos;
026 import com.liferay.portal.kernel.dao.orm.QueryUtil;
027 import com.liferay.portal.kernel.dao.orm.Session;
028 import com.liferay.portal.kernel.exception.SystemException;
029 import com.liferay.portal.kernel.log.Log;
030 import com.liferay.portal.kernel.log.LogFactoryUtil;
031 import com.liferay.portal.kernel.util.GetterUtil;
032 import com.liferay.portal.kernel.util.InstanceFactory;
033 import com.liferay.portal.kernel.util.OrderByComparator;
034 import com.liferay.portal.kernel.util.StringBundler;
035 import com.liferay.portal.kernel.util.StringPool;
036 import com.liferay.portal.kernel.util.StringUtil;
037 import com.liferay.portal.model.ModelListener;
038 import com.liferay.portal.model.Phone;
039 import com.liferay.portal.model.impl.PhoneImpl;
040 import com.liferay.portal.model.impl.PhoneModelImpl;
041 import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
042
043 import java.io.Serializable;
044
045 import java.util.ArrayList;
046 import java.util.Collections;
047 import java.util.List;
048
049
065 public class PhonePersistenceImpl extends BasePersistenceImpl<Phone>
066 implements PhonePersistence {
067 public static final String FINDER_CLASS_NAME_ENTITY = PhoneImpl.class.getName();
068 public static final String FINDER_CLASS_NAME_LIST = FINDER_CLASS_NAME_ENTITY +
069 ".List";
070 public static final FinderPath FINDER_PATH_FIND_BY_COMPANYID = new FinderPath(PhoneModelImpl.ENTITY_CACHE_ENABLED,
071 PhoneModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
072 "findByCompanyId",
073 new String[] {
074 Long.class.getName(),
075
076 "java.lang.Integer", "java.lang.Integer",
077 "com.liferay.portal.kernel.util.OrderByComparator"
078 });
079 public static final FinderPath FINDER_PATH_COUNT_BY_COMPANYID = new FinderPath(PhoneModelImpl.ENTITY_CACHE_ENABLED,
080 PhoneModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
081 "countByCompanyId", new String[] { Long.class.getName() });
082 public static final FinderPath FINDER_PATH_FIND_BY_USERID = new FinderPath(PhoneModelImpl.ENTITY_CACHE_ENABLED,
083 PhoneModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
084 "findByUserId",
085 new String[] {
086 Long.class.getName(),
087
088 "java.lang.Integer", "java.lang.Integer",
089 "com.liferay.portal.kernel.util.OrderByComparator"
090 });
091 public static final FinderPath FINDER_PATH_COUNT_BY_USERID = new FinderPath(PhoneModelImpl.ENTITY_CACHE_ENABLED,
092 PhoneModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
093 "countByUserId", new String[] { Long.class.getName() });
094 public static final FinderPath FINDER_PATH_FIND_BY_C_C = new FinderPath(PhoneModelImpl.ENTITY_CACHE_ENABLED,
095 PhoneModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
096 "findByC_C",
097 new String[] {
098 Long.class.getName(), Long.class.getName(),
099
100 "java.lang.Integer", "java.lang.Integer",
101 "com.liferay.portal.kernel.util.OrderByComparator"
102 });
103 public static final FinderPath FINDER_PATH_COUNT_BY_C_C = new FinderPath(PhoneModelImpl.ENTITY_CACHE_ENABLED,
104 PhoneModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
105 "countByC_C",
106 new String[] { Long.class.getName(), Long.class.getName() });
107 public static final FinderPath FINDER_PATH_FIND_BY_C_C_C = new FinderPath(PhoneModelImpl.ENTITY_CACHE_ENABLED,
108 PhoneModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
109 "findByC_C_C",
110 new String[] {
111 Long.class.getName(), Long.class.getName(), Long.class.getName(),
112
113 "java.lang.Integer", "java.lang.Integer",
114 "com.liferay.portal.kernel.util.OrderByComparator"
115 });
116 public static final FinderPath FINDER_PATH_COUNT_BY_C_C_C = new FinderPath(PhoneModelImpl.ENTITY_CACHE_ENABLED,
117 PhoneModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
118 "countByC_C_C",
119 new String[] {
120 Long.class.getName(), Long.class.getName(), Long.class.getName()
121 });
122 public static final FinderPath FINDER_PATH_FIND_BY_C_C_C_P = new FinderPath(PhoneModelImpl.ENTITY_CACHE_ENABLED,
123 PhoneModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
124 "findByC_C_C_P",
125 new String[] {
126 Long.class.getName(), Long.class.getName(), Long.class.getName(),
127 Boolean.class.getName(),
128
129 "java.lang.Integer", "java.lang.Integer",
130 "com.liferay.portal.kernel.util.OrderByComparator"
131 });
132 public static final FinderPath FINDER_PATH_COUNT_BY_C_C_C_P = new FinderPath(PhoneModelImpl.ENTITY_CACHE_ENABLED,
133 PhoneModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
134 "countByC_C_C_P",
135 new String[] {
136 Long.class.getName(), Long.class.getName(), Long.class.getName(),
137 Boolean.class.getName()
138 });
139 public static final FinderPath FINDER_PATH_FIND_ALL = new FinderPath(PhoneModelImpl.ENTITY_CACHE_ENABLED,
140 PhoneModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
141 "findAll", new String[0]);
142 public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(PhoneModelImpl.ENTITY_CACHE_ENABLED,
143 PhoneModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
144 "countAll", new String[0]);
145
146
151 public void cacheResult(Phone phone) {
152 EntityCacheUtil.putResult(PhoneModelImpl.ENTITY_CACHE_ENABLED,
153 PhoneImpl.class, phone.getPrimaryKey(), phone);
154 }
155
156
161 public void cacheResult(List<Phone> phones) {
162 for (Phone phone : phones) {
163 if (EntityCacheUtil.getResult(PhoneModelImpl.ENTITY_CACHE_ENABLED,
164 PhoneImpl.class, phone.getPrimaryKey(), this) == null) {
165 cacheResult(phone);
166 }
167 }
168 }
169
170
177 public void clearCache() {
178 CacheRegistryUtil.clear(PhoneImpl.class.getName());
179 EntityCacheUtil.clearCache(PhoneImpl.class.getName());
180 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
181 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
182 }
183
184
191 public void clearCache(Phone phone) {
192 EntityCacheUtil.removeResult(PhoneModelImpl.ENTITY_CACHE_ENABLED,
193 PhoneImpl.class, phone.getPrimaryKey());
194 }
195
196
202 public Phone create(long phoneId) {
203 Phone phone = new PhoneImpl();
204
205 phone.setNew(true);
206 phone.setPrimaryKey(phoneId);
207
208 return phone;
209 }
210
211
219 public Phone remove(Serializable primaryKey)
220 throws NoSuchModelException, SystemException {
221 return remove(((Long)primaryKey).longValue());
222 }
223
224
232 public Phone remove(long phoneId)
233 throws NoSuchPhoneException, SystemException {
234 Session session = null;
235
236 try {
237 session = openSession();
238
239 Phone phone = (Phone)session.get(PhoneImpl.class, new Long(phoneId));
240
241 if (phone == null) {
242 if (_log.isWarnEnabled()) {
243 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + phoneId);
244 }
245
246 throw new NoSuchPhoneException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
247 phoneId);
248 }
249
250 return remove(phone);
251 }
252 catch (NoSuchPhoneException nsee) {
253 throw nsee;
254 }
255 catch (Exception e) {
256 throw processException(e);
257 }
258 finally {
259 closeSession(session);
260 }
261 }
262
263 protected Phone removeImpl(Phone phone) throws SystemException {
264 phone = toUnwrappedModel(phone);
265
266 Session session = null;
267
268 try {
269 session = openSession();
270
271 if (phone.isCachedModel() || BatchSessionUtil.isEnabled()) {
272 Object staleObject = session.get(PhoneImpl.class,
273 phone.getPrimaryKeyObj());
274
275 if (staleObject != null) {
276 session.evict(staleObject);
277 }
278 }
279
280 session.delete(phone);
281
282 session.flush();
283 }
284 catch (Exception e) {
285 throw processException(e);
286 }
287 finally {
288 closeSession(session);
289 }
290
291 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
292
293 EntityCacheUtil.removeResult(PhoneModelImpl.ENTITY_CACHE_ENABLED,
294 PhoneImpl.class, phone.getPrimaryKey());
295
296 return phone;
297 }
298
299 public Phone updateImpl(com.liferay.portal.model.Phone phone, boolean merge)
300 throws SystemException {
301 phone = toUnwrappedModel(phone);
302
303 Session session = null;
304
305 try {
306 session = openSession();
307
308 BatchSessionUtil.update(session, phone, merge);
309
310 phone.setNew(false);
311 }
312 catch (Exception e) {
313 throw processException(e);
314 }
315 finally {
316 closeSession(session);
317 }
318
319 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
320
321 EntityCacheUtil.putResult(PhoneModelImpl.ENTITY_CACHE_ENABLED,
322 PhoneImpl.class, phone.getPrimaryKey(), phone);
323
324 return phone;
325 }
326
327 protected Phone toUnwrappedModel(Phone phone) {
328 if (phone instanceof PhoneImpl) {
329 return phone;
330 }
331
332 PhoneImpl phoneImpl = new PhoneImpl();
333
334 phoneImpl.setNew(phone.isNew());
335 phoneImpl.setPrimaryKey(phone.getPrimaryKey());
336
337 phoneImpl.setPhoneId(phone.getPhoneId());
338 phoneImpl.setCompanyId(phone.getCompanyId());
339 phoneImpl.setUserId(phone.getUserId());
340 phoneImpl.setUserName(phone.getUserName());
341 phoneImpl.setCreateDate(phone.getCreateDate());
342 phoneImpl.setModifiedDate(phone.getModifiedDate());
343 phoneImpl.setClassNameId(phone.getClassNameId());
344 phoneImpl.setClassPK(phone.getClassPK());
345 phoneImpl.setNumber(phone.getNumber());
346 phoneImpl.setExtension(phone.getExtension());
347 phoneImpl.setTypeId(phone.getTypeId());
348 phoneImpl.setPrimary(phone.isPrimary());
349
350 return phoneImpl;
351 }
352
353
361 public Phone findByPrimaryKey(Serializable primaryKey)
362 throws NoSuchModelException, SystemException {
363 return findByPrimaryKey(((Long)primaryKey).longValue());
364 }
365
366
374 public Phone findByPrimaryKey(long phoneId)
375 throws NoSuchPhoneException, SystemException {
376 Phone phone = fetchByPrimaryKey(phoneId);
377
378 if (phone == null) {
379 if (_log.isWarnEnabled()) {
380 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + phoneId);
381 }
382
383 throw new NoSuchPhoneException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
384 phoneId);
385 }
386
387 return phone;
388 }
389
390
397 public Phone fetchByPrimaryKey(Serializable primaryKey)
398 throws SystemException {
399 return fetchByPrimaryKey(((Long)primaryKey).longValue());
400 }
401
402
409 public Phone fetchByPrimaryKey(long phoneId) throws SystemException {
410 Phone phone = (Phone)EntityCacheUtil.getResult(PhoneModelImpl.ENTITY_CACHE_ENABLED,
411 PhoneImpl.class, phoneId, this);
412
413 if (phone == null) {
414 Session session = null;
415
416 try {
417 session = openSession();
418
419 phone = (Phone)session.get(PhoneImpl.class, new Long(phoneId));
420 }
421 catch (Exception e) {
422 throw processException(e);
423 }
424 finally {
425 if (phone != null) {
426 cacheResult(phone);
427 }
428
429 closeSession(session);
430 }
431 }
432
433 return phone;
434 }
435
436
443 public List<Phone> findByCompanyId(long companyId)
444 throws SystemException {
445 return findByCompanyId(companyId, QueryUtil.ALL_POS, QueryUtil.ALL_POS,
446 null);
447 }
448
449
462 public List<Phone> findByCompanyId(long companyId, int start, int end)
463 throws SystemException {
464 return findByCompanyId(companyId, start, end, null);
465 }
466
467
481 public List<Phone> findByCompanyId(long companyId, int start, int end,
482 OrderByComparator orderByComparator) throws SystemException {
483 Object[] finderArgs = new Object[] {
484 companyId,
485
486 String.valueOf(start), String.valueOf(end),
487 String.valueOf(orderByComparator)
488 };
489
490 List<Phone> list = (List<Phone>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_COMPANYID,
491 finderArgs, this);
492
493 if (list == null) {
494 Session session = null;
495
496 try {
497 session = openSession();
498
499 StringBundler query = null;
500
501 if (orderByComparator != null) {
502 query = new StringBundler(3 +
503 (orderByComparator.getOrderByFields().length * 3));
504 }
505 else {
506 query = new StringBundler(3);
507 }
508
509 query.append(_SQL_SELECT_PHONE_WHERE);
510
511 query.append(_FINDER_COLUMN_COMPANYID_COMPANYID_2);
512
513 if (orderByComparator != null) {
514 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
515 orderByComparator);
516 }
517
518 else {
519 query.append(PhoneModelImpl.ORDER_BY_JPQL);
520 }
521
522 String sql = query.toString();
523
524 Query q = session.createQuery(sql);
525
526 QueryPos qPos = QueryPos.getInstance(q);
527
528 qPos.add(companyId);
529
530 list = (List<Phone>)QueryUtil.list(q, getDialect(), start, end);
531 }
532 catch (Exception e) {
533 throw processException(e);
534 }
535 finally {
536 if (list == null) {
537 list = new ArrayList<Phone>();
538 }
539
540 cacheResult(list);
541
542 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_COMPANYID,
543 finderArgs, list);
544
545 closeSession(session);
546 }
547 }
548
549 return list;
550 }
551
552
565 public Phone findByCompanyId_First(long companyId,
566 OrderByComparator orderByComparator)
567 throws NoSuchPhoneException, SystemException {
568 List<Phone> list = findByCompanyId(companyId, 0, 1, orderByComparator);
569
570 if (list.isEmpty()) {
571 StringBundler msg = new StringBundler(4);
572
573 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
574
575 msg.append("companyId=");
576 msg.append(companyId);
577
578 msg.append(StringPool.CLOSE_CURLY_BRACE);
579
580 throw new NoSuchPhoneException(msg.toString());
581 }
582 else {
583 return list.get(0);
584 }
585 }
586
587
600 public Phone findByCompanyId_Last(long companyId,
601 OrderByComparator orderByComparator)
602 throws NoSuchPhoneException, SystemException {
603 int count = countByCompanyId(companyId);
604
605 List<Phone> list = findByCompanyId(companyId, count - 1, count,
606 orderByComparator);
607
608 if (list.isEmpty()) {
609 StringBundler msg = new StringBundler(4);
610
611 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
612
613 msg.append("companyId=");
614 msg.append(companyId);
615
616 msg.append(StringPool.CLOSE_CURLY_BRACE);
617
618 throw new NoSuchPhoneException(msg.toString());
619 }
620 else {
621 return list.get(0);
622 }
623 }
624
625
639 public Phone[] findByCompanyId_PrevAndNext(long phoneId, long companyId,
640 OrderByComparator orderByComparator)
641 throws NoSuchPhoneException, SystemException {
642 Phone phone = findByPrimaryKey(phoneId);
643
644 Session session = null;
645
646 try {
647 session = openSession();
648
649 Phone[] array = new PhoneImpl[3];
650
651 array[0] = getByCompanyId_PrevAndNext(session, phone, companyId,
652 orderByComparator, true);
653
654 array[1] = phone;
655
656 array[2] = getByCompanyId_PrevAndNext(session, phone, companyId,
657 orderByComparator, false);
658
659 return array;
660 }
661 catch (Exception e) {
662 throw processException(e);
663 }
664 finally {
665 closeSession(session);
666 }
667 }
668
669 protected Phone getByCompanyId_PrevAndNext(Session session, Phone phone,
670 long companyId, OrderByComparator orderByComparator, boolean previous) {
671 StringBundler query = null;
672
673 if (orderByComparator != null) {
674 query = new StringBundler(6 +
675 (orderByComparator.getOrderByFields().length * 6));
676 }
677 else {
678 query = new StringBundler(3);
679 }
680
681 query.append(_SQL_SELECT_PHONE_WHERE);
682
683 query.append(_FINDER_COLUMN_COMPANYID_COMPANYID_2);
684
685 if (orderByComparator != null) {
686 String[] orderByFields = orderByComparator.getOrderByFields();
687
688 if (orderByFields.length > 0) {
689 query.append(WHERE_AND);
690 }
691
692 for (int i = 0; i < orderByFields.length; i++) {
693 query.append(_ORDER_BY_ENTITY_ALIAS);
694 query.append(orderByFields[i]);
695
696 if ((i + 1) < orderByFields.length) {
697 if (orderByComparator.isAscending() ^ previous) {
698 query.append(WHERE_GREATER_THAN_HAS_NEXT);
699 }
700 else {
701 query.append(WHERE_LESSER_THAN_HAS_NEXT);
702 }
703 }
704 else {
705 if (orderByComparator.isAscending() ^ previous) {
706 query.append(WHERE_GREATER_THAN);
707 }
708 else {
709 query.append(WHERE_LESSER_THAN);
710 }
711 }
712 }
713
714 query.append(ORDER_BY_CLAUSE);
715
716 for (int i = 0; i < orderByFields.length; i++) {
717 query.append(_ORDER_BY_ENTITY_ALIAS);
718 query.append(orderByFields[i]);
719
720 if ((i + 1) < orderByFields.length) {
721 if (orderByComparator.isAscending() ^ previous) {
722 query.append(ORDER_BY_ASC_HAS_NEXT);
723 }
724 else {
725 query.append(ORDER_BY_DESC_HAS_NEXT);
726 }
727 }
728 else {
729 if (orderByComparator.isAscending() ^ previous) {
730 query.append(ORDER_BY_ASC);
731 }
732 else {
733 query.append(ORDER_BY_DESC);
734 }
735 }
736 }
737 }
738
739 else {
740 query.append(PhoneModelImpl.ORDER_BY_JPQL);
741 }
742
743 String sql = query.toString();
744
745 Query q = session.createQuery(sql);
746
747 q.setFirstResult(0);
748 q.setMaxResults(2);
749
750 QueryPos qPos = QueryPos.getInstance(q);
751
752 qPos.add(companyId);
753
754 if (orderByComparator != null) {
755 Object[] values = orderByComparator.getOrderByValues(phone);
756
757 for (Object value : values) {
758 qPos.add(value);
759 }
760 }
761
762 List<Phone> list = q.list();
763
764 if (list.size() == 2) {
765 return list.get(1);
766 }
767 else {
768 return null;
769 }
770 }
771
772
779 public List<Phone> findByUserId(long userId) throws SystemException {
780 return findByUserId(userId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
781 }
782
783
796 public List<Phone> findByUserId(long userId, int start, int end)
797 throws SystemException {
798 return findByUserId(userId, start, end, null);
799 }
800
801
815 public List<Phone> findByUserId(long userId, int start, int end,
816 OrderByComparator orderByComparator) throws SystemException {
817 Object[] finderArgs = new Object[] {
818 userId,
819
820 String.valueOf(start), String.valueOf(end),
821 String.valueOf(orderByComparator)
822 };
823
824 List<Phone> list = (List<Phone>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_USERID,
825 finderArgs, this);
826
827 if (list == null) {
828 Session session = null;
829
830 try {
831 session = openSession();
832
833 StringBundler query = null;
834
835 if (orderByComparator != null) {
836 query = new StringBundler(3 +
837 (orderByComparator.getOrderByFields().length * 3));
838 }
839 else {
840 query = new StringBundler(3);
841 }
842
843 query.append(_SQL_SELECT_PHONE_WHERE);
844
845 query.append(_FINDER_COLUMN_USERID_USERID_2);
846
847 if (orderByComparator != null) {
848 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
849 orderByComparator);
850 }
851
852 else {
853 query.append(PhoneModelImpl.ORDER_BY_JPQL);
854 }
855
856 String sql = query.toString();
857
858 Query q = session.createQuery(sql);
859
860 QueryPos qPos = QueryPos.getInstance(q);
861
862 qPos.add(userId);
863
864 list = (List<Phone>)QueryUtil.list(q, getDialect(), start, end);
865 }
866 catch (Exception e) {
867 throw processException(e);
868 }
869 finally {
870 if (list == null) {
871 list = new ArrayList<Phone>();
872 }
873
874 cacheResult(list);
875
876 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_USERID,
877 finderArgs, list);
878
879 closeSession(session);
880 }
881 }
882
883 return list;
884 }
885
886
899 public Phone findByUserId_First(long userId,
900 OrderByComparator orderByComparator)
901 throws NoSuchPhoneException, SystemException {
902 List<Phone> list = findByUserId(userId, 0, 1, orderByComparator);
903
904 if (list.isEmpty()) {
905 StringBundler msg = new StringBundler(4);
906
907 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
908
909 msg.append("userId=");
910 msg.append(userId);
911
912 msg.append(StringPool.CLOSE_CURLY_BRACE);
913
914 throw new NoSuchPhoneException(msg.toString());
915 }
916 else {
917 return list.get(0);
918 }
919 }
920
921
934 public Phone findByUserId_Last(long userId,
935 OrderByComparator orderByComparator)
936 throws NoSuchPhoneException, SystemException {
937 int count = countByUserId(userId);
938
939 List<Phone> list = findByUserId(userId, count - 1, count,
940 orderByComparator);
941
942 if (list.isEmpty()) {
943 StringBundler msg = new StringBundler(4);
944
945 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
946
947 msg.append("userId=");
948 msg.append(userId);
949
950 msg.append(StringPool.CLOSE_CURLY_BRACE);
951
952 throw new NoSuchPhoneException(msg.toString());
953 }
954 else {
955 return list.get(0);
956 }
957 }
958
959
973 public Phone[] findByUserId_PrevAndNext(long phoneId, long userId,
974 OrderByComparator orderByComparator)
975 throws NoSuchPhoneException, SystemException {
976 Phone phone = findByPrimaryKey(phoneId);
977
978 Session session = null;
979
980 try {
981 session = openSession();
982
983 Phone[] array = new PhoneImpl[3];
984
985 array[0] = getByUserId_PrevAndNext(session, phone, userId,
986 orderByComparator, true);
987
988 array[1] = phone;
989
990 array[2] = getByUserId_PrevAndNext(session, phone, userId,
991 orderByComparator, false);
992
993 return array;
994 }
995 catch (Exception e) {
996 throw processException(e);
997 }
998 finally {
999 closeSession(session);
1000 }
1001 }
1002
1003 protected Phone getByUserId_PrevAndNext(Session session, Phone phone,
1004 long userId, OrderByComparator orderByComparator, boolean previous) {
1005 StringBundler query = null;
1006
1007 if (orderByComparator != null) {
1008 query = new StringBundler(6 +
1009 (orderByComparator.getOrderByFields().length * 6));
1010 }
1011 else {
1012 query = new StringBundler(3);
1013 }
1014
1015 query.append(_SQL_SELECT_PHONE_WHERE);
1016
1017 query.append(_FINDER_COLUMN_USERID_USERID_2);
1018
1019 if (orderByComparator != null) {
1020 String[] orderByFields = orderByComparator.getOrderByFields();
1021
1022 if (orderByFields.length > 0) {
1023 query.append(WHERE_AND);
1024 }
1025
1026 for (int i = 0; i < orderByFields.length; i++) {
1027 query.append(_ORDER_BY_ENTITY_ALIAS);
1028 query.append(orderByFields[i]);
1029
1030 if ((i + 1) < orderByFields.length) {
1031 if (orderByComparator.isAscending() ^ previous) {
1032 query.append(WHERE_GREATER_THAN_HAS_NEXT);
1033 }
1034 else {
1035 query.append(WHERE_LESSER_THAN_HAS_NEXT);
1036 }
1037 }
1038 else {
1039 if (orderByComparator.isAscending() ^ previous) {
1040 query.append(WHERE_GREATER_THAN);
1041 }
1042 else {
1043 query.append(WHERE_LESSER_THAN);
1044 }
1045 }
1046 }
1047
1048 query.append(ORDER_BY_CLAUSE);
1049
1050 for (int i = 0; i < orderByFields.length; i++) {
1051 query.append(_ORDER_BY_ENTITY_ALIAS);
1052 query.append(orderByFields[i]);
1053
1054 if ((i + 1) < orderByFields.length) {
1055 if (orderByComparator.isAscending() ^ previous) {
1056 query.append(ORDER_BY_ASC_HAS_NEXT);
1057 }
1058 else {
1059 query.append(ORDER_BY_DESC_HAS_NEXT);
1060 }
1061 }
1062 else {
1063 if (orderByComparator.isAscending() ^ previous) {
1064 query.append(ORDER_BY_ASC);
1065 }
1066 else {
1067 query.append(ORDER_BY_DESC);
1068 }
1069 }
1070 }
1071 }
1072
1073 else {
1074 query.append(PhoneModelImpl.ORDER_BY_JPQL);
1075 }
1076
1077 String sql = query.toString();
1078
1079 Query q = session.createQuery(sql);
1080
1081 q.setFirstResult(0);
1082 q.setMaxResults(2);
1083
1084 QueryPos qPos = QueryPos.getInstance(q);
1085
1086 qPos.add(userId);
1087
1088 if (orderByComparator != null) {
1089 Object[] values = orderByComparator.getOrderByValues(phone);
1090
1091 for (Object value : values) {
1092 qPos.add(value);
1093 }
1094 }
1095
1096 List<Phone> list = q.list();
1097
1098 if (list.size() == 2) {
1099 return list.get(1);
1100 }
1101 else {
1102 return null;
1103 }
1104 }
1105
1106
1114 public List<Phone> findByC_C(long companyId, long classNameId)
1115 throws SystemException {
1116 return findByC_C(companyId, classNameId, QueryUtil.ALL_POS,
1117 QueryUtil.ALL_POS, null);
1118 }
1119
1120
1134 public List<Phone> findByC_C(long companyId, long classNameId, int start,
1135 int end) throws SystemException {
1136 return findByC_C(companyId, classNameId, start, end, null);
1137 }
1138
1139
1154 public List<Phone> findByC_C(long companyId, long classNameId, int start,
1155 int end, OrderByComparator orderByComparator) throws SystemException {
1156 Object[] finderArgs = new Object[] {
1157 companyId, classNameId,
1158
1159 String.valueOf(start), String.valueOf(end),
1160 String.valueOf(orderByComparator)
1161 };
1162
1163 List<Phone> list = (List<Phone>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_C_C,
1164 finderArgs, this);
1165
1166 if (list == null) {
1167 Session session = null;
1168
1169 try {
1170 session = openSession();
1171
1172 StringBundler query = null;
1173
1174 if (orderByComparator != null) {
1175 query = new StringBundler(4 +
1176 (orderByComparator.getOrderByFields().length * 3));
1177 }
1178 else {
1179 query = new StringBundler(4);
1180 }
1181
1182 query.append(_SQL_SELECT_PHONE_WHERE);
1183
1184 query.append(_FINDER_COLUMN_C_C_COMPANYID_2);
1185
1186 query.append(_FINDER_COLUMN_C_C_CLASSNAMEID_2);
1187
1188 if (orderByComparator != null) {
1189 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
1190 orderByComparator);
1191 }
1192
1193 else {
1194 query.append(PhoneModelImpl.ORDER_BY_JPQL);
1195 }
1196
1197 String sql = query.toString();
1198
1199 Query q = session.createQuery(sql);
1200
1201 QueryPos qPos = QueryPos.getInstance(q);
1202
1203 qPos.add(companyId);
1204
1205 qPos.add(classNameId);
1206
1207 list = (List<Phone>)QueryUtil.list(q, getDialect(), start, end);
1208 }
1209 catch (Exception e) {
1210 throw processException(e);
1211 }
1212 finally {
1213 if (list == null) {
1214 list = new ArrayList<Phone>();
1215 }
1216
1217 cacheResult(list);
1218
1219 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_C_C, finderArgs,
1220 list);
1221
1222 closeSession(session);
1223 }
1224 }
1225
1226 return list;
1227 }
1228
1229
1243 public Phone findByC_C_First(long companyId, long classNameId,
1244 OrderByComparator orderByComparator)
1245 throws NoSuchPhoneException, SystemException {
1246 List<Phone> list = findByC_C(companyId, classNameId, 0, 1,
1247 orderByComparator);
1248
1249 if (list.isEmpty()) {
1250 StringBundler msg = new StringBundler(6);
1251
1252 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1253
1254 msg.append("companyId=");
1255 msg.append(companyId);
1256
1257 msg.append(", classNameId=");
1258 msg.append(classNameId);
1259
1260 msg.append(StringPool.CLOSE_CURLY_BRACE);
1261
1262 throw new NoSuchPhoneException(msg.toString());
1263 }
1264 else {
1265 return list.get(0);
1266 }
1267 }
1268
1269
1283 public Phone findByC_C_Last(long companyId, long classNameId,
1284 OrderByComparator orderByComparator)
1285 throws NoSuchPhoneException, SystemException {
1286 int count = countByC_C(companyId, classNameId);
1287
1288 List<Phone> list = findByC_C(companyId, classNameId, count - 1, count,
1289 orderByComparator);
1290
1291 if (list.isEmpty()) {
1292 StringBundler msg = new StringBundler(6);
1293
1294 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1295
1296 msg.append("companyId=");
1297 msg.append(companyId);
1298
1299 msg.append(", classNameId=");
1300 msg.append(classNameId);
1301
1302 msg.append(StringPool.CLOSE_CURLY_BRACE);
1303
1304 throw new NoSuchPhoneException(msg.toString());
1305 }
1306 else {
1307 return list.get(0);
1308 }
1309 }
1310
1311
1326 public Phone[] findByC_C_PrevAndNext(long phoneId, long companyId,
1327 long classNameId, OrderByComparator orderByComparator)
1328 throws NoSuchPhoneException, SystemException {
1329 Phone phone = findByPrimaryKey(phoneId);
1330
1331 Session session = null;
1332
1333 try {
1334 session = openSession();
1335
1336 Phone[] array = new PhoneImpl[3];
1337
1338 array[0] = getByC_C_PrevAndNext(session, phone, companyId,
1339 classNameId, orderByComparator, true);
1340
1341 array[1] = phone;
1342
1343 array[2] = getByC_C_PrevAndNext(session, phone, companyId,
1344 classNameId, orderByComparator, false);
1345
1346 return array;
1347 }
1348 catch (Exception e) {
1349 throw processException(e);
1350 }
1351 finally {
1352 closeSession(session);
1353 }
1354 }
1355
1356 protected Phone getByC_C_PrevAndNext(Session session, Phone phone,
1357 long companyId, long classNameId, OrderByComparator orderByComparator,
1358 boolean previous) {
1359 StringBundler query = null;
1360
1361 if (orderByComparator != null) {
1362 query = new StringBundler(6 +
1363 (orderByComparator.getOrderByFields().length * 6));
1364 }
1365 else {
1366 query = new StringBundler(3);
1367 }
1368
1369 query.append(_SQL_SELECT_PHONE_WHERE);
1370
1371 query.append(_FINDER_COLUMN_C_C_COMPANYID_2);
1372
1373 query.append(_FINDER_COLUMN_C_C_CLASSNAMEID_2);
1374
1375 if (orderByComparator != null) {
1376 String[] orderByFields = orderByComparator.getOrderByFields();
1377
1378 if (orderByFields.length > 0) {
1379 query.append(WHERE_AND);
1380 }
1381
1382 for (int i = 0; i < orderByFields.length; i++) {
1383 query.append(_ORDER_BY_ENTITY_ALIAS);
1384 query.append(orderByFields[i]);
1385
1386 if ((i + 1) < orderByFields.length) {
1387 if (orderByComparator.isAscending() ^ previous) {
1388 query.append(WHERE_GREATER_THAN_HAS_NEXT);
1389 }
1390 else {
1391 query.append(WHERE_LESSER_THAN_HAS_NEXT);
1392 }
1393 }
1394 else {
1395 if (orderByComparator.isAscending() ^ previous) {
1396 query.append(WHERE_GREATER_THAN);
1397 }
1398 else {
1399 query.append(WHERE_LESSER_THAN);
1400 }
1401 }
1402 }
1403
1404 query.append(ORDER_BY_CLAUSE);
1405
1406 for (int i = 0; i < orderByFields.length; i++) {
1407 query.append(_ORDER_BY_ENTITY_ALIAS);
1408 query.append(orderByFields[i]);
1409
1410 if ((i + 1) < orderByFields.length) {
1411 if (orderByComparator.isAscending() ^ previous) {
1412 query.append(ORDER_BY_ASC_HAS_NEXT);
1413 }
1414 else {
1415 query.append(ORDER_BY_DESC_HAS_NEXT);
1416 }
1417 }
1418 else {
1419 if (orderByComparator.isAscending() ^ previous) {
1420 query.append(ORDER_BY_ASC);
1421 }
1422 else {
1423 query.append(ORDER_BY_DESC);
1424 }
1425 }
1426 }
1427 }
1428
1429 else {
1430 query.append(PhoneModelImpl.ORDER_BY_JPQL);
1431 }
1432
1433 String sql = query.toString();
1434
1435 Query q = session.createQuery(sql);
1436
1437 q.setFirstResult(0);
1438 q.setMaxResults(2);
1439
1440 QueryPos qPos = QueryPos.getInstance(q);
1441
1442 qPos.add(companyId);
1443
1444 qPos.add(classNameId);
1445
1446 if (orderByComparator != null) {
1447 Object[] values = orderByComparator.getOrderByValues(phone);
1448
1449 for (Object value : values) {
1450 qPos.add(value);
1451 }
1452 }
1453
1454 List<Phone> list = q.list();
1455
1456 if (list.size() == 2) {
1457 return list.get(1);
1458 }
1459 else {
1460 return null;
1461 }
1462 }
1463
1464
1473 public List<Phone> findByC_C_C(long companyId, long classNameId,
1474 long classPK) throws SystemException {
1475 return findByC_C_C(companyId, classNameId, classPK, QueryUtil.ALL_POS,
1476 QueryUtil.ALL_POS, null);
1477 }
1478
1479
1494 public List<Phone> findByC_C_C(long companyId, long classNameId,
1495 long classPK, int start, int end) throws SystemException {
1496 return findByC_C_C(companyId, classNameId, classPK, start, end, null);
1497 }
1498
1499
1515 public List<Phone> findByC_C_C(long companyId, long classNameId,
1516 long classPK, int start, int end, OrderByComparator orderByComparator)
1517 throws SystemException {
1518 Object[] finderArgs = new Object[] {
1519 companyId, classNameId, classPK,
1520
1521 String.valueOf(start), String.valueOf(end),
1522 String.valueOf(orderByComparator)
1523 };
1524
1525 List<Phone> list = (List<Phone>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_C_C_C,
1526 finderArgs, this);
1527
1528 if (list == null) {
1529 Session session = null;
1530
1531 try {
1532 session = openSession();
1533
1534 StringBundler query = null;
1535
1536 if (orderByComparator != null) {
1537 query = new StringBundler(5 +
1538 (orderByComparator.getOrderByFields().length * 3));
1539 }
1540 else {
1541 query = new StringBundler(5);
1542 }
1543
1544 query.append(_SQL_SELECT_PHONE_WHERE);
1545
1546 query.append(_FINDER_COLUMN_C_C_C_COMPANYID_2);
1547
1548 query.append(_FINDER_COLUMN_C_C_C_CLASSNAMEID_2);
1549
1550 query.append(_FINDER_COLUMN_C_C_C_CLASSPK_2);
1551
1552 if (orderByComparator != null) {
1553 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
1554 orderByComparator);
1555 }
1556
1557 else {
1558 query.append(PhoneModelImpl.ORDER_BY_JPQL);
1559 }
1560
1561 String sql = query.toString();
1562
1563 Query q = session.createQuery(sql);
1564
1565 QueryPos qPos = QueryPos.getInstance(q);
1566
1567 qPos.add(companyId);
1568
1569 qPos.add(classNameId);
1570
1571 qPos.add(classPK);
1572
1573 list = (List<Phone>)QueryUtil.list(q, getDialect(), start, end);
1574 }
1575 catch (Exception e) {
1576 throw processException(e);
1577 }
1578 finally {
1579 if (list == null) {
1580 list = new ArrayList<Phone>();
1581 }
1582
1583 cacheResult(list);
1584
1585 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_C_C_C,
1586 finderArgs, list);
1587
1588 closeSession(session);
1589 }
1590 }
1591
1592 return list;
1593 }
1594
1595
1610 public Phone findByC_C_C_First(long companyId, long classNameId,
1611 long classPK, OrderByComparator orderByComparator)
1612 throws NoSuchPhoneException, SystemException {
1613 List<Phone> list = findByC_C_C(companyId, classNameId, classPK, 0, 1,
1614 orderByComparator);
1615
1616 if (list.isEmpty()) {
1617 StringBundler msg = new StringBundler(8);
1618
1619 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1620
1621 msg.append("companyId=");
1622 msg.append(companyId);
1623
1624 msg.append(", classNameId=");
1625 msg.append(classNameId);
1626
1627 msg.append(", classPK=");
1628 msg.append(classPK);
1629
1630 msg.append(StringPool.CLOSE_CURLY_BRACE);
1631
1632 throw new NoSuchPhoneException(msg.toString());
1633 }
1634 else {
1635 return list.get(0);
1636 }
1637 }
1638
1639
1654 public Phone findByC_C_C_Last(long companyId, long classNameId,
1655 long classPK, OrderByComparator orderByComparator)
1656 throws NoSuchPhoneException, SystemException {
1657 int count = countByC_C_C(companyId, classNameId, classPK);
1658
1659 List<Phone> list = findByC_C_C(companyId, classNameId, classPK,
1660 count - 1, count, orderByComparator);
1661
1662 if (list.isEmpty()) {
1663 StringBundler msg = new StringBundler(8);
1664
1665 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1666
1667 msg.append("companyId=");
1668 msg.append(companyId);
1669
1670 msg.append(", classNameId=");
1671 msg.append(classNameId);
1672
1673 msg.append(", classPK=");
1674 msg.append(classPK);
1675
1676 msg.append(StringPool.CLOSE_CURLY_BRACE);
1677
1678 throw new NoSuchPhoneException(msg.toString());
1679 }
1680 else {
1681 return list.get(0);
1682 }
1683 }
1684
1685
1701 public Phone[] findByC_C_C_PrevAndNext(long phoneId, long companyId,
1702 long classNameId, long classPK, OrderByComparator orderByComparator)
1703 throws NoSuchPhoneException, SystemException {
1704 Phone phone = findByPrimaryKey(phoneId);
1705
1706 Session session = null;
1707
1708 try {
1709 session = openSession();
1710
1711 Phone[] array = new PhoneImpl[3];
1712
1713 array[0] = getByC_C_C_PrevAndNext(session, phone, companyId,
1714 classNameId, classPK, orderByComparator, true);
1715
1716 array[1] = phone;
1717
1718 array[2] = getByC_C_C_PrevAndNext(session, phone, companyId,
1719 classNameId, classPK, orderByComparator, false);
1720
1721 return array;
1722 }
1723 catch (Exception e) {
1724 throw processException(e);
1725 }
1726 finally {
1727 closeSession(session);
1728 }
1729 }
1730
1731 protected Phone getByC_C_C_PrevAndNext(Session session, Phone phone,
1732 long companyId, long classNameId, long classPK,
1733 OrderByComparator orderByComparator, boolean previous) {
1734 StringBundler query = null;
1735
1736 if (orderByComparator != null) {
1737 query = new StringBundler(6 +
1738 (orderByComparator.getOrderByFields().length * 6));
1739 }
1740 else {
1741 query = new StringBundler(3);
1742 }
1743
1744 query.append(_SQL_SELECT_PHONE_WHERE);
1745
1746 query.append(_FINDER_COLUMN_C_C_C_COMPANYID_2);
1747
1748 query.append(_FINDER_COLUMN_C_C_C_CLASSNAMEID_2);
1749
1750 query.append(_FINDER_COLUMN_C_C_C_CLASSPK_2);
1751
1752 if (orderByComparator != null) {
1753 String[] orderByFields = orderByComparator.getOrderByFields();
1754
1755 if (orderByFields.length > 0) {
1756 query.append(WHERE_AND);
1757 }
1758
1759 for (int i = 0; i < orderByFields.length; i++) {
1760 query.append(_ORDER_BY_ENTITY_ALIAS);
1761 query.append(orderByFields[i]);
1762
1763 if ((i + 1) < orderByFields.length) {
1764 if (orderByComparator.isAscending() ^ previous) {
1765 query.append(WHERE_GREATER_THAN_HAS_NEXT);
1766 }
1767 else {
1768 query.append(WHERE_LESSER_THAN_HAS_NEXT);
1769 }
1770 }
1771 else {
1772 if (orderByComparator.isAscending() ^ previous) {
1773 query.append(WHERE_GREATER_THAN);
1774 }
1775 else {
1776 query.append(WHERE_LESSER_THAN);
1777 }
1778 }
1779 }
1780
1781 query.append(ORDER_BY_CLAUSE);
1782
1783 for (int i = 0; i < orderByFields.length; i++) {
1784 query.append(_ORDER_BY_ENTITY_ALIAS);
1785 query.append(orderByFields[i]);
1786
1787 if ((i + 1) < orderByFields.length) {
1788 if (orderByComparator.isAscending() ^ previous) {
1789 query.append(ORDER_BY_ASC_HAS_NEXT);
1790 }
1791 else {
1792 query.append(ORDER_BY_DESC_HAS_NEXT);
1793 }
1794 }
1795 else {
1796 if (orderByComparator.isAscending() ^ previous) {
1797 query.append(ORDER_BY_ASC);
1798 }
1799 else {
1800 query.append(ORDER_BY_DESC);
1801 }
1802 }
1803 }
1804 }
1805
1806 else {
1807 query.append(PhoneModelImpl.ORDER_BY_JPQL);
1808 }
1809
1810 String sql = query.toString();
1811
1812 Query q = session.createQuery(sql);
1813
1814 q.setFirstResult(0);
1815 q.setMaxResults(2);
1816
1817 QueryPos qPos = QueryPos.getInstance(q);
1818
1819 qPos.add(companyId);
1820
1821 qPos.add(classNameId);
1822
1823 qPos.add(classPK);
1824
1825 if (orderByComparator != null) {
1826 Object[] values = orderByComparator.getOrderByValues(phone);
1827
1828 for (Object value : values) {
1829 qPos.add(value);
1830 }
1831 }
1832
1833 List<Phone> list = q.list();
1834
1835 if (list.size() == 2) {
1836 return list.get(1);
1837 }
1838 else {
1839 return null;
1840 }
1841 }
1842
1843
1853 public List<Phone> findByC_C_C_P(long companyId, long classNameId,
1854 long classPK, boolean primary) throws SystemException {
1855 return findByC_C_C_P(companyId, classNameId, classPK, primary,
1856 QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
1857 }
1858
1859
1875 public List<Phone> findByC_C_C_P(long companyId, long classNameId,
1876 long classPK, boolean primary, int start, int end)
1877 throws SystemException {
1878 return findByC_C_C_P(companyId, classNameId, classPK, primary, start,
1879 end, null);
1880 }
1881
1882
1899 public List<Phone> findByC_C_C_P(long companyId, long classNameId,
1900 long classPK, boolean primary, int start, int end,
1901 OrderByComparator orderByComparator) throws SystemException {
1902 Object[] finderArgs = new Object[] {
1903 companyId, classNameId, classPK, primary,
1904
1905 String.valueOf(start), String.valueOf(end),
1906 String.valueOf(orderByComparator)
1907 };
1908
1909 List<Phone> list = (List<Phone>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_C_C_C_P,
1910 finderArgs, this);
1911
1912 if (list == null) {
1913 Session session = null;
1914
1915 try {
1916 session = openSession();
1917
1918 StringBundler query = null;
1919
1920 if (orderByComparator != null) {
1921 query = new StringBundler(6 +
1922 (orderByComparator.getOrderByFields().length * 3));
1923 }
1924 else {
1925 query = new StringBundler(6);
1926 }
1927
1928 query.append(_SQL_SELECT_PHONE_WHERE);
1929
1930 query.append(_FINDER_COLUMN_C_C_C_P_COMPANYID_2);
1931
1932 query.append(_FINDER_COLUMN_C_C_C_P_CLASSNAMEID_2);
1933
1934 query.append(_FINDER_COLUMN_C_C_C_P_CLASSPK_2);
1935
1936 query.append(_FINDER_COLUMN_C_C_C_P_PRIMARY_2);
1937
1938 if (orderByComparator != null) {
1939 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
1940 orderByComparator);
1941 }
1942
1943 else {
1944 query.append(PhoneModelImpl.ORDER_BY_JPQL);
1945 }
1946
1947 String sql = query.toString();
1948
1949 Query q = session.createQuery(sql);
1950
1951 QueryPos qPos = QueryPos.getInstance(q);
1952
1953 qPos.add(companyId);
1954
1955 qPos.add(classNameId);
1956
1957 qPos.add(classPK);
1958
1959 qPos.add(primary);
1960
1961 list = (List<Phone>)QueryUtil.list(q, getDialect(), start, end);
1962 }
1963 catch (Exception e) {
1964 throw processException(e);
1965 }
1966 finally {
1967 if (list == null) {
1968 list = new ArrayList<Phone>();
1969 }
1970
1971 cacheResult(list);
1972
1973 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_C_C_C_P,
1974 finderArgs, list);
1975
1976 closeSession(session);
1977 }
1978 }
1979
1980 return list;
1981 }
1982
1983
1999 public Phone findByC_C_C_P_First(long companyId, long classNameId,
2000 long classPK, boolean primary, OrderByComparator orderByComparator)
2001 throws NoSuchPhoneException, SystemException {
2002 List<Phone> list = findByC_C_C_P(companyId, classNameId, classPK,
2003 primary, 0, 1, orderByComparator);
2004
2005 if (list.isEmpty()) {
2006 StringBundler msg = new StringBundler(10);
2007
2008 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
2009
2010 msg.append("companyId=");
2011 msg.append(companyId);
2012
2013 msg.append(", classNameId=");
2014 msg.append(classNameId);
2015
2016 msg.append(", classPK=");
2017 msg.append(classPK);
2018
2019 msg.append(", primary=");
2020 msg.append(primary);
2021
2022 msg.append(StringPool.CLOSE_CURLY_BRACE);
2023
2024 throw new NoSuchPhoneException(msg.toString());
2025 }
2026 else {
2027 return list.get(0);
2028 }
2029 }
2030
2031
2047 public Phone findByC_C_C_P_Last(long companyId, long classNameId,
2048 long classPK, boolean primary, OrderByComparator orderByComparator)
2049 throws NoSuchPhoneException, SystemException {
2050 int count = countByC_C_C_P(companyId, classNameId, classPK, primary);
2051
2052 List<Phone> list = findByC_C_C_P(companyId, classNameId, classPK,
2053 primary, count - 1, count, orderByComparator);
2054
2055 if (list.isEmpty()) {
2056 StringBundler msg = new StringBundler(10);
2057
2058 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
2059
2060 msg.append("companyId=");
2061 msg.append(companyId);
2062
2063 msg.append(", classNameId=");
2064 msg.append(classNameId);
2065
2066 msg.append(", classPK=");
2067 msg.append(classPK);
2068
2069 msg.append(", primary=");
2070 msg.append(primary);
2071
2072 msg.append(StringPool.CLOSE_CURLY_BRACE);
2073
2074 throw new NoSuchPhoneException(msg.toString());
2075 }
2076 else {
2077 return list.get(0);
2078 }
2079 }
2080
2081
2098 public Phone[] findByC_C_C_P_PrevAndNext(long phoneId, long companyId,
2099 long classNameId, long classPK, boolean primary,
2100 OrderByComparator orderByComparator)
2101 throws NoSuchPhoneException, SystemException {
2102 Phone phone = findByPrimaryKey(phoneId);
2103
2104 Session session = null;
2105
2106 try {
2107 session = openSession();
2108
2109 Phone[] array = new PhoneImpl[3];
2110
2111 array[0] = getByC_C_C_P_PrevAndNext(session, phone, companyId,
2112 classNameId, classPK, primary, orderByComparator, true);
2113
2114 array[1] = phone;
2115
2116 array[2] = getByC_C_C_P_PrevAndNext(session, phone, companyId,
2117 classNameId, classPK, primary, orderByComparator, false);
2118
2119 return array;
2120 }
2121 catch (Exception e) {
2122 throw processException(e);
2123 }
2124 finally {
2125 closeSession(session);
2126 }
2127 }
2128
2129 protected Phone getByC_C_C_P_PrevAndNext(Session session, Phone phone,
2130 long companyId, long classNameId, long classPK, boolean primary,
2131 OrderByComparator orderByComparator, boolean previous) {
2132 StringBundler query = null;
2133
2134 if (orderByComparator != null) {
2135 query = new StringBundler(6 +
2136 (orderByComparator.getOrderByFields().length * 6));
2137 }
2138 else {
2139 query = new StringBundler(3);
2140 }
2141
2142 query.append(_SQL_SELECT_PHONE_WHERE);
2143
2144 query.append(_FINDER_COLUMN_C_C_C_P_COMPANYID_2);
2145
2146 query.append(_FINDER_COLUMN_C_C_C_P_CLASSNAMEID_2);
2147
2148 query.append(_FINDER_COLUMN_C_C_C_P_CLASSPK_2);
2149
2150 query.append(_FINDER_COLUMN_C_C_C_P_PRIMARY_2);
2151
2152 if (orderByComparator != null) {
2153 String[] orderByFields = orderByComparator.getOrderByFields();
2154
2155 if (orderByFields.length > 0) {
2156 query.append(WHERE_AND);
2157 }
2158
2159 for (int i = 0; i < orderByFields.length; i++) {
2160 query.append(_ORDER_BY_ENTITY_ALIAS);
2161 query.append(orderByFields[i]);
2162
2163 if ((i + 1) < orderByFields.length) {
2164 if (orderByComparator.isAscending() ^ previous) {
2165 query.append(WHERE_GREATER_THAN_HAS_NEXT);
2166 }
2167 else {
2168 query.append(WHERE_LESSER_THAN_HAS_NEXT);
2169 }
2170 }
2171 else {
2172 if (orderByComparator.isAscending() ^ previous) {
2173 query.append(WHERE_GREATER_THAN);
2174 }
2175 else {
2176 query.append(WHERE_LESSER_THAN);
2177 }
2178 }
2179 }
2180
2181 query.append(ORDER_BY_CLAUSE);
2182
2183 for (int i = 0; i < orderByFields.length; i++) {
2184 query.append(_ORDER_BY_ENTITY_ALIAS);
2185 query.append(orderByFields[i]);
2186
2187 if ((i + 1) < orderByFields.length) {
2188 if (orderByComparator.isAscending() ^ previous) {
2189 query.append(ORDER_BY_ASC_HAS_NEXT);
2190 }
2191 else {
2192 query.append(ORDER_BY_DESC_HAS_NEXT);
2193 }
2194 }
2195 else {
2196 if (orderByComparator.isAscending() ^ previous) {
2197 query.append(ORDER_BY_ASC);
2198 }
2199 else {
2200 query.append(ORDER_BY_DESC);
2201 }
2202 }
2203 }
2204 }
2205
2206 else {
2207 query.append(PhoneModelImpl.ORDER_BY_JPQL);
2208 }
2209
2210 String sql = query.toString();
2211
2212 Query q = session.createQuery(sql);
2213
2214 q.setFirstResult(0);
2215 q.setMaxResults(2);
2216
2217 QueryPos qPos = QueryPos.getInstance(q);
2218
2219 qPos.add(companyId);
2220
2221 qPos.add(classNameId);
2222
2223 qPos.add(classPK);
2224
2225 qPos.add(primary);
2226
2227 if (orderByComparator != null) {
2228 Object[] values = orderByComparator.getOrderByValues(phone);
2229
2230 for (Object value : values) {
2231 qPos.add(value);
2232 }
2233 }
2234
2235 List<Phone> list = q.list();
2236
2237 if (list.size() == 2) {
2238 return list.get(1);
2239 }
2240 else {
2241 return null;
2242 }
2243 }
2244
2245
2251 public List<Phone> findAll() throws SystemException {
2252 return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
2253 }
2254
2255
2267 public List<Phone> findAll(int start, int end) throws SystemException {
2268 return findAll(start, end, null);
2269 }
2270
2271
2284 public List<Phone> findAll(int start, int end,
2285 OrderByComparator orderByComparator) throws SystemException {
2286 Object[] finderArgs = new Object[] {
2287 String.valueOf(start), String.valueOf(end),
2288 String.valueOf(orderByComparator)
2289 };
2290
2291 List<Phone> list = (List<Phone>)FinderCacheUtil.getResult(FINDER_PATH_FIND_ALL,
2292 finderArgs, this);
2293
2294 if (list == null) {
2295 Session session = null;
2296
2297 try {
2298 session = openSession();
2299
2300 StringBundler query = null;
2301 String sql = null;
2302
2303 if (orderByComparator != null) {
2304 query = new StringBundler(2 +
2305 (orderByComparator.getOrderByFields().length * 3));
2306
2307 query.append(_SQL_SELECT_PHONE);
2308
2309 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
2310 orderByComparator);
2311
2312 sql = query.toString();
2313 }
2314 else {
2315 sql = _SQL_SELECT_PHONE.concat(PhoneModelImpl.ORDER_BY_JPQL);
2316 }
2317
2318 Query q = session.createQuery(sql);
2319
2320 if (orderByComparator == null) {
2321 list = (List<Phone>)QueryUtil.list(q, getDialect(), start,
2322 end, false);
2323
2324 Collections.sort(list);
2325 }
2326 else {
2327 list = (List<Phone>)QueryUtil.list(q, getDialect(), start,
2328 end);
2329 }
2330 }
2331 catch (Exception e) {
2332 throw processException(e);
2333 }
2334 finally {
2335 if (list == null) {
2336 list = new ArrayList<Phone>();
2337 }
2338
2339 cacheResult(list);
2340
2341 FinderCacheUtil.putResult(FINDER_PATH_FIND_ALL, finderArgs, list);
2342
2343 closeSession(session);
2344 }
2345 }
2346
2347 return list;
2348 }
2349
2350
2356 public void removeByCompanyId(long companyId) throws SystemException {
2357 for (Phone phone : findByCompanyId(companyId)) {
2358 remove(phone);
2359 }
2360 }
2361
2362
2368 public void removeByUserId(long userId) throws SystemException {
2369 for (Phone phone : findByUserId(userId)) {
2370 remove(phone);
2371 }
2372 }
2373
2374
2381 public void removeByC_C(long companyId, long classNameId)
2382 throws SystemException {
2383 for (Phone phone : findByC_C(companyId, classNameId)) {
2384 remove(phone);
2385 }
2386 }
2387
2388
2396 public void removeByC_C_C(long companyId, long classNameId, long classPK)
2397 throws SystemException {
2398 for (Phone phone : findByC_C_C(companyId, classNameId, classPK)) {
2399 remove(phone);
2400 }
2401 }
2402
2403
2412 public void removeByC_C_C_P(long companyId, long classNameId, long classPK,
2413 boolean primary) throws SystemException {
2414 for (Phone phone : findByC_C_C_P(companyId, classNameId, classPK,
2415 primary)) {
2416 remove(phone);
2417 }
2418 }
2419
2420
2425 public void removeAll() throws SystemException {
2426 for (Phone phone : findAll()) {
2427 remove(phone);
2428 }
2429 }
2430
2431
2438 public int countByCompanyId(long companyId) throws SystemException {
2439 Object[] finderArgs = new Object[] { companyId };
2440
2441 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_COMPANYID,
2442 finderArgs, this);
2443
2444 if (count == null) {
2445 Session session = null;
2446
2447 try {
2448 session = openSession();
2449
2450 StringBundler query = new StringBundler(2);
2451
2452 query.append(_SQL_COUNT_PHONE_WHERE);
2453
2454 query.append(_FINDER_COLUMN_COMPANYID_COMPANYID_2);
2455
2456 String sql = query.toString();
2457
2458 Query q = session.createQuery(sql);
2459
2460 QueryPos qPos = QueryPos.getInstance(q);
2461
2462 qPos.add(companyId);
2463
2464 count = (Long)q.uniqueResult();
2465 }
2466 catch (Exception e) {
2467 throw processException(e);
2468 }
2469 finally {
2470 if (count == null) {
2471 count = Long.valueOf(0);
2472 }
2473
2474 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_COMPANYID,
2475 finderArgs, count);
2476
2477 closeSession(session);
2478 }
2479 }
2480
2481 return count.intValue();
2482 }
2483
2484
2491 public int countByUserId(long userId) throws SystemException {
2492 Object[] finderArgs = new Object[] { userId };
2493
2494 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_USERID,
2495 finderArgs, this);
2496
2497 if (count == null) {
2498 Session session = null;
2499
2500 try {
2501 session = openSession();
2502
2503 StringBundler query = new StringBundler(2);
2504
2505 query.append(_SQL_COUNT_PHONE_WHERE);
2506
2507 query.append(_FINDER_COLUMN_USERID_USERID_2);
2508
2509 String sql = query.toString();
2510
2511 Query q = session.createQuery(sql);
2512
2513 QueryPos qPos = QueryPos.getInstance(q);
2514
2515 qPos.add(userId);
2516
2517 count = (Long)q.uniqueResult();
2518 }
2519 catch (Exception e) {
2520 throw processException(e);
2521 }
2522 finally {
2523 if (count == null) {
2524 count = Long.valueOf(0);
2525 }
2526
2527 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_USERID,
2528 finderArgs, count);
2529
2530 closeSession(session);
2531 }
2532 }
2533
2534 return count.intValue();
2535 }
2536
2537
2545 public int countByC_C(long companyId, long classNameId)
2546 throws SystemException {
2547 Object[] finderArgs = new Object[] { companyId, classNameId };
2548
2549 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_C_C,
2550 finderArgs, this);
2551
2552 if (count == null) {
2553 Session session = null;
2554
2555 try {
2556 session = openSession();
2557
2558 StringBundler query = new StringBundler(3);
2559
2560 query.append(_SQL_COUNT_PHONE_WHERE);
2561
2562 query.append(_FINDER_COLUMN_C_C_COMPANYID_2);
2563
2564 query.append(_FINDER_COLUMN_C_C_CLASSNAMEID_2);
2565
2566 String sql = query.toString();
2567
2568 Query q = session.createQuery(sql);
2569
2570 QueryPos qPos = QueryPos.getInstance(q);
2571
2572 qPos.add(companyId);
2573
2574 qPos.add(classNameId);
2575
2576 count = (Long)q.uniqueResult();
2577 }
2578 catch (Exception e) {
2579 throw processException(e);
2580 }
2581 finally {
2582 if (count == null) {
2583 count = Long.valueOf(0);
2584 }
2585
2586 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_C_C, finderArgs,
2587 count);
2588
2589 closeSession(session);
2590 }
2591 }
2592
2593 return count.intValue();
2594 }
2595
2596
2605 public int countByC_C_C(long companyId, long classNameId, long classPK)
2606 throws SystemException {
2607 Object[] finderArgs = new Object[] { companyId, classNameId, classPK };
2608
2609 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_C_C_C,
2610 finderArgs, this);
2611
2612 if (count == null) {
2613 Session session = null;
2614
2615 try {
2616 session = openSession();
2617
2618 StringBundler query = new StringBundler(4);
2619
2620 query.append(_SQL_COUNT_PHONE_WHERE);
2621
2622 query.append(_FINDER_COLUMN_C_C_C_COMPANYID_2);
2623
2624 query.append(_FINDER_COLUMN_C_C_C_CLASSNAMEID_2);
2625
2626 query.append(_FINDER_COLUMN_C_C_C_CLASSPK_2);
2627
2628 String sql = query.toString();
2629
2630 Query q = session.createQuery(sql);
2631
2632 QueryPos qPos = QueryPos.getInstance(q);
2633
2634 qPos.add(companyId);
2635
2636 qPos.add(classNameId);
2637
2638 qPos.add(classPK);
2639
2640 count = (Long)q.uniqueResult();
2641 }
2642 catch (Exception e) {
2643 throw processException(e);
2644 }
2645 finally {
2646 if (count == null) {
2647 count = Long.valueOf(0);
2648 }
2649
2650 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_C_C_C,
2651 finderArgs, count);
2652
2653 closeSession(session);
2654 }
2655 }
2656
2657 return count.intValue();
2658 }
2659
2660
2670 public int countByC_C_C_P(long companyId, long classNameId, long classPK,
2671 boolean primary) throws SystemException {
2672 Object[] finderArgs = new Object[] {
2673 companyId, classNameId, classPK, primary
2674 };
2675
2676 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_C_C_C_P,
2677 finderArgs, this);
2678
2679 if (count == null) {
2680 Session session = null;
2681
2682 try {
2683 session = openSession();
2684
2685 StringBundler query = new StringBundler(5);
2686
2687 query.append(_SQL_COUNT_PHONE_WHERE);
2688
2689 query.append(_FINDER_COLUMN_C_C_C_P_COMPANYID_2);
2690
2691 query.append(_FINDER_COLUMN_C_C_C_P_CLASSNAMEID_2);
2692
2693 query.append(_FINDER_COLUMN_C_C_C_P_CLASSPK_2);
2694
2695 query.append(_FINDER_COLUMN_C_C_C_P_PRIMARY_2);
2696
2697 String sql = query.toString();
2698
2699 Query q = session.createQuery(sql);
2700
2701 QueryPos qPos = QueryPos.getInstance(q);
2702
2703 qPos.add(companyId);
2704
2705 qPos.add(classNameId);
2706
2707 qPos.add(classPK);
2708
2709 qPos.add(primary);
2710
2711 count = (Long)q.uniqueResult();
2712 }
2713 catch (Exception e) {
2714 throw processException(e);
2715 }
2716 finally {
2717 if (count == null) {
2718 count = Long.valueOf(0);
2719 }
2720
2721 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_C_C_C_P,
2722 finderArgs, count);
2723
2724 closeSession(session);
2725 }
2726 }
2727
2728 return count.intValue();
2729 }
2730
2731
2737 public int countAll() throws SystemException {
2738 Object[] finderArgs = new Object[0];
2739
2740 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
2741 finderArgs, this);
2742
2743 if (count == null) {
2744 Session session = null;
2745
2746 try {
2747 session = openSession();
2748
2749 Query q = session.createQuery(_SQL_COUNT_PHONE);
2750
2751 count = (Long)q.uniqueResult();
2752 }
2753 catch (Exception e) {
2754 throw processException(e);
2755 }
2756 finally {
2757 if (count == null) {
2758 count = Long.valueOf(0);
2759 }
2760
2761 FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL, finderArgs,
2762 count);
2763
2764 closeSession(session);
2765 }
2766 }
2767
2768 return count.intValue();
2769 }
2770
2771
2774 public void afterPropertiesSet() {
2775 String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
2776 com.liferay.portal.util.PropsUtil.get(
2777 "value.object.listener.com.liferay.portal.model.Phone")));
2778
2779 if (listenerClassNames.length > 0) {
2780 try {
2781 List<ModelListener<Phone>> listenersList = new ArrayList<ModelListener<Phone>>();
2782
2783 for (String listenerClassName : listenerClassNames) {
2784 listenersList.add((ModelListener<Phone>)InstanceFactory.newInstance(
2785 listenerClassName));
2786 }
2787
2788 listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
2789 }
2790 catch (Exception e) {
2791 _log.error(e);
2792 }
2793 }
2794 }
2795
2796 @BeanReference(type = AccountPersistence.class)
2797 protected AccountPersistence accountPersistence;
2798 @BeanReference(type = AddressPersistence.class)
2799 protected AddressPersistence addressPersistence;
2800 @BeanReference(type = BrowserTrackerPersistence.class)
2801 protected BrowserTrackerPersistence browserTrackerPersistence;
2802 @BeanReference(type = ClassNamePersistence.class)
2803 protected ClassNamePersistence classNamePersistence;
2804 @BeanReference(type = ClusterGroupPersistence.class)
2805 protected ClusterGroupPersistence clusterGroupPersistence;
2806 @BeanReference(type = CompanyPersistence.class)
2807 protected CompanyPersistence companyPersistence;
2808 @BeanReference(type = ContactPersistence.class)
2809 protected ContactPersistence contactPersistence;
2810 @BeanReference(type = CountryPersistence.class)
2811 protected CountryPersistence countryPersistence;
2812 @BeanReference(type = EmailAddressPersistence.class)
2813 protected EmailAddressPersistence emailAddressPersistence;
2814 @BeanReference(type = GroupPersistence.class)
2815 protected GroupPersistence groupPersistence;
2816 @BeanReference(type = ImagePersistence.class)
2817 protected ImagePersistence imagePersistence;
2818 @BeanReference(type = LayoutPersistence.class)
2819 protected LayoutPersistence layoutPersistence;
2820 @BeanReference(type = LayoutPrototypePersistence.class)
2821 protected LayoutPrototypePersistence layoutPrototypePersistence;
2822 @BeanReference(type = LayoutSetPersistence.class)
2823 protected LayoutSetPersistence layoutSetPersistence;
2824 @BeanReference(type = LayoutSetPrototypePersistence.class)
2825 protected LayoutSetPrototypePersistence layoutSetPrototypePersistence;
2826 @BeanReference(type = ListTypePersistence.class)
2827 protected ListTypePersistence listTypePersistence;
2828 @BeanReference(type = LockPersistence.class)
2829 protected LockPersistence lockPersistence;
2830 @BeanReference(type = MembershipRequestPersistence.class)
2831 protected MembershipRequestPersistence membershipRequestPersistence;
2832 @BeanReference(type = OrganizationPersistence.class)
2833 protected OrganizationPersistence organizationPersistence;
2834 @BeanReference(type = OrgGroupPermissionPersistence.class)
2835 protected OrgGroupPermissionPersistence orgGroupPermissionPersistence;
2836 @BeanReference(type = OrgGroupRolePersistence.class)
2837 protected OrgGroupRolePersistence orgGroupRolePersistence;
2838 @BeanReference(type = OrgLaborPersistence.class)
2839 protected OrgLaborPersistence orgLaborPersistence;
2840 @BeanReference(type = PasswordPolicyPersistence.class)
2841 protected PasswordPolicyPersistence passwordPolicyPersistence;
2842 @BeanReference(type = PasswordPolicyRelPersistence.class)
2843 protected PasswordPolicyRelPersistence passwordPolicyRelPersistence;
2844 @BeanReference(type = PasswordTrackerPersistence.class)
2845 protected PasswordTrackerPersistence passwordTrackerPersistence;
2846 @BeanReference(type = PermissionPersistence.class)
2847 protected PermissionPersistence permissionPersistence;
2848 @BeanReference(type = PhonePersistence.class)
2849 protected PhonePersistence phonePersistence;
2850 @BeanReference(type = PluginSettingPersistence.class)
2851 protected PluginSettingPersistence pluginSettingPersistence;
2852 @BeanReference(type = PortletPersistence.class)
2853 protected PortletPersistence portletPersistence;
2854 @BeanReference(type = PortletItemPersistence.class)
2855 protected PortletItemPersistence portletItemPersistence;
2856 @BeanReference(type = PortletPreferencesPersistence.class)
2857 protected PortletPreferencesPersistence portletPreferencesPersistence;
2858 @BeanReference(type = RegionPersistence.class)
2859 protected RegionPersistence regionPersistence;
2860 @BeanReference(type = ReleasePersistence.class)
2861 protected ReleasePersistence releasePersistence;
2862 @BeanReference(type = ResourcePersistence.class)
2863 protected ResourcePersistence resourcePersistence;
2864 @BeanReference(type = ResourceActionPersistence.class)
2865 protected ResourceActionPersistence resourceActionPersistence;
2866 @BeanReference(type = ResourceCodePersistence.class)
2867 protected ResourceCodePersistence resourceCodePersistence;
2868 @BeanReference(type = ResourcePermissionPersistence.class)
2869 protected ResourcePermissionPersistence resourcePermissionPersistence;
2870 @BeanReference(type = RolePersistence.class)
2871 protected RolePersistence rolePersistence;
2872 @BeanReference(type = ServiceComponentPersistence.class)
2873 protected ServiceComponentPersistence serviceComponentPersistence;
2874 @BeanReference(type = ShardPersistence.class)
2875 protected ShardPersistence shardPersistence;
2876 @BeanReference(type = SubscriptionPersistence.class)
2877 protected SubscriptionPersistence subscriptionPersistence;
2878 @BeanReference(type = TicketPersistence.class)
2879 protected TicketPersistence ticketPersistence;
2880 @BeanReference(type = TeamPersistence.class)
2881 protected TeamPersistence teamPersistence;
2882 @BeanReference(type = UserPersistence.class)
2883 protected UserPersistence userPersistence;
2884 @BeanReference(type = UserGroupPersistence.class)
2885 protected UserGroupPersistence userGroupPersistence;
2886 @BeanReference(type = UserGroupGroupRolePersistence.class)
2887 protected UserGroupGroupRolePersistence userGroupGroupRolePersistence;
2888 @BeanReference(type = UserGroupRolePersistence.class)
2889 protected UserGroupRolePersistence userGroupRolePersistence;
2890 @BeanReference(type = UserIdMapperPersistence.class)
2891 protected UserIdMapperPersistence userIdMapperPersistence;
2892 @BeanReference(type = UserTrackerPersistence.class)
2893 protected UserTrackerPersistence userTrackerPersistence;
2894 @BeanReference(type = UserTrackerPathPersistence.class)
2895 protected UserTrackerPathPersistence userTrackerPathPersistence;
2896 @BeanReference(type = WebDAVPropsPersistence.class)
2897 protected WebDAVPropsPersistence webDAVPropsPersistence;
2898 @BeanReference(type = WebsitePersistence.class)
2899 protected WebsitePersistence websitePersistence;
2900 @BeanReference(type = WorkflowDefinitionLinkPersistence.class)
2901 protected WorkflowDefinitionLinkPersistence workflowDefinitionLinkPersistence;
2902 @BeanReference(type = WorkflowInstanceLinkPersistence.class)
2903 protected WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence;
2904 private static final String _SQL_SELECT_PHONE = "SELECT phone FROM Phone phone";
2905 private static final String _SQL_SELECT_PHONE_WHERE = "SELECT phone FROM Phone phone WHERE ";
2906 private static final String _SQL_COUNT_PHONE = "SELECT COUNT(phone) FROM Phone phone";
2907 private static final String _SQL_COUNT_PHONE_WHERE = "SELECT COUNT(phone) FROM Phone phone WHERE ";
2908 private static final String _FINDER_COLUMN_COMPANYID_COMPANYID_2 = "phone.companyId = ?";
2909 private static final String _FINDER_COLUMN_USERID_USERID_2 = "phone.userId = ?";
2910 private static final String _FINDER_COLUMN_C_C_COMPANYID_2 = "phone.companyId = ? AND ";
2911 private static final String _FINDER_COLUMN_C_C_CLASSNAMEID_2 = "phone.classNameId = ?";
2912 private static final String _FINDER_COLUMN_C_C_C_COMPANYID_2 = "phone.companyId = ? AND ";
2913 private static final String _FINDER_COLUMN_C_C_C_CLASSNAMEID_2 = "phone.classNameId = ? AND ";
2914 private static final String _FINDER_COLUMN_C_C_C_CLASSPK_2 = "phone.classPK = ?";
2915 private static final String _FINDER_COLUMN_C_C_C_P_COMPANYID_2 = "phone.companyId = ? AND ";
2916 private static final String _FINDER_COLUMN_C_C_C_P_CLASSNAMEID_2 = "phone.classNameId = ? AND ";
2917 private static final String _FINDER_COLUMN_C_C_C_P_CLASSPK_2 = "phone.classPK = ? AND ";
2918 private static final String _FINDER_COLUMN_C_C_C_P_PRIMARY_2 = "phone.primary = ?";
2919 private static final String _ORDER_BY_ENTITY_ALIAS = "phone.";
2920 private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No Phone exists with the primary key ";
2921 private static final String _NO_SUCH_ENTITY_WITH_KEY = "No Phone exists with the key {";
2922 private static Log _log = LogFactoryUtil.getLog(PhonePersistenceImpl.class);
2923 }