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