1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portal.service.persistence;
16  
17  import com.liferay.portal.NoSuchModelException;
18  import com.liferay.portal.NoSuchUserTrackerException;
19  import com.liferay.portal.SystemException;
20  import com.liferay.portal.kernel.annotation.BeanReference;
21  import com.liferay.portal.kernel.cache.CacheRegistry;
22  import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
23  import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
24  import com.liferay.portal.kernel.dao.orm.FinderPath;
25  import com.liferay.portal.kernel.dao.orm.Query;
26  import com.liferay.portal.kernel.dao.orm.QueryPos;
27  import com.liferay.portal.kernel.dao.orm.QueryUtil;
28  import com.liferay.portal.kernel.dao.orm.Session;
29  import com.liferay.portal.kernel.log.Log;
30  import com.liferay.portal.kernel.log.LogFactoryUtil;
31  import com.liferay.portal.kernel.util.GetterUtil;
32  import com.liferay.portal.kernel.util.InstanceFactory;
33  import com.liferay.portal.kernel.util.OrderByComparator;
34  import com.liferay.portal.kernel.util.StringBundler;
35  import com.liferay.portal.kernel.util.StringPool;
36  import com.liferay.portal.kernel.util.StringUtil;
37  import com.liferay.portal.model.ModelListener;
38  import com.liferay.portal.model.UserTracker;
39  import com.liferay.portal.model.impl.UserTrackerImpl;
40  import com.liferay.portal.model.impl.UserTrackerModelImpl;
41  import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
42  
43  import java.io.Serializable;
44  
45  import java.util.ArrayList;
46  import java.util.Collections;
47  import java.util.List;
48  
49  /**
50   * <a href="UserTrackerPersistenceImpl.java.html"><b><i>View Source</i></b></a>
51   *
52   * <p>
53   * ServiceBuilder generated this class. Modifications in this class will be
54   * overwritten the next time is generated.
55   * </p>
56   *
57   * @author    Brian Wing Shun Chan
58   * @see       UserTrackerPersistence
59   * @see       UserTrackerUtil
60   * @generated
61   */
62  public class UserTrackerPersistenceImpl extends BasePersistenceImpl<UserTracker>
63      implements UserTrackerPersistence {
64      public static final String FINDER_CLASS_NAME_ENTITY = UserTrackerImpl.class.getName();
65      public static final String FINDER_CLASS_NAME_LIST = FINDER_CLASS_NAME_ENTITY +
66          ".List";
67      public static final FinderPath FINDER_PATH_FIND_BY_COMPANYID = new FinderPath(UserTrackerModelImpl.ENTITY_CACHE_ENABLED,
68              UserTrackerModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
69              "findByCompanyId",
70              new String[] {
71                  Long.class.getName(),
72                  
73              "java.lang.Integer", "java.lang.Integer",
74                  "com.liferay.portal.kernel.util.OrderByComparator"
75              });
76      public static final FinderPath FINDER_PATH_COUNT_BY_COMPANYID = new FinderPath(UserTrackerModelImpl.ENTITY_CACHE_ENABLED,
77              UserTrackerModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
78              "countByCompanyId", new String[] { Long.class.getName() });
79      public static final FinderPath FINDER_PATH_FIND_BY_USERID = new FinderPath(UserTrackerModelImpl.ENTITY_CACHE_ENABLED,
80              UserTrackerModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
81              "findByUserId",
82              new String[] {
83                  Long.class.getName(),
84                  
85              "java.lang.Integer", "java.lang.Integer",
86                  "com.liferay.portal.kernel.util.OrderByComparator"
87              });
88      public static final FinderPath FINDER_PATH_COUNT_BY_USERID = new FinderPath(UserTrackerModelImpl.ENTITY_CACHE_ENABLED,
89              UserTrackerModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
90              "countByUserId", new String[] { Long.class.getName() });
91      public static final FinderPath FINDER_PATH_FIND_BY_SESSIONID = new FinderPath(UserTrackerModelImpl.ENTITY_CACHE_ENABLED,
92              UserTrackerModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
93              "findBySessionId",
94              new String[] {
95                  String.class.getName(),
96                  
97              "java.lang.Integer", "java.lang.Integer",
98                  "com.liferay.portal.kernel.util.OrderByComparator"
99              });
100     public static final FinderPath FINDER_PATH_COUNT_BY_SESSIONID = new FinderPath(UserTrackerModelImpl.ENTITY_CACHE_ENABLED,
101             UserTrackerModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
102             "countBySessionId", new String[] { String.class.getName() });
103     public static final FinderPath FINDER_PATH_FIND_ALL = new FinderPath(UserTrackerModelImpl.ENTITY_CACHE_ENABLED,
104             UserTrackerModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
105             "findAll", new String[0]);
106     public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(UserTrackerModelImpl.ENTITY_CACHE_ENABLED,
107             UserTrackerModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
108             "countAll", new String[0]);
109 
110     public void cacheResult(UserTracker userTracker) {
111         EntityCacheUtil.putResult(UserTrackerModelImpl.ENTITY_CACHE_ENABLED,
112             UserTrackerImpl.class, userTracker.getPrimaryKey(), userTracker);
113     }
114 
115     public void cacheResult(List<UserTracker> userTrackers) {
116         for (UserTracker userTracker : userTrackers) {
117             if (EntityCacheUtil.getResult(
118                         UserTrackerModelImpl.ENTITY_CACHE_ENABLED,
119                         UserTrackerImpl.class, userTracker.getPrimaryKey(), this) == null) {
120                 cacheResult(userTracker);
121             }
122         }
123     }
124 
125     public void clearCache() {
126         CacheRegistry.clear(UserTrackerImpl.class.getName());
127         EntityCacheUtil.clearCache(UserTrackerImpl.class.getName());
128         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
129         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
130     }
131 
132     public void clearCache(UserTracker userTracker) {
133         EntityCacheUtil.removeResult(UserTrackerModelImpl.ENTITY_CACHE_ENABLED,
134             UserTrackerImpl.class, userTracker.getPrimaryKey());
135     }
136 
137     public UserTracker create(long userTrackerId) {
138         UserTracker userTracker = new UserTrackerImpl();
139 
140         userTracker.setNew(true);
141         userTracker.setPrimaryKey(userTrackerId);
142 
143         return userTracker;
144     }
145 
146     public UserTracker remove(Serializable primaryKey)
147         throws NoSuchModelException, SystemException {
148         return remove(((Long)primaryKey).longValue());
149     }
150 
151     public UserTracker remove(long userTrackerId)
152         throws NoSuchUserTrackerException, SystemException {
153         Session session = null;
154 
155         try {
156             session = openSession();
157 
158             UserTracker userTracker = (UserTracker)session.get(UserTrackerImpl.class,
159                     new Long(userTrackerId));
160 
161             if (userTracker == null) {
162                 if (_log.isWarnEnabled()) {
163                     _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + userTrackerId);
164                 }
165 
166                 throw new NoSuchUserTrackerException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
167                     userTrackerId);
168             }
169 
170             return remove(userTracker);
171         }
172         catch (NoSuchUserTrackerException nsee) {
173             throw nsee;
174         }
175         catch (Exception e) {
176             throw processException(e);
177         }
178         finally {
179             closeSession(session);
180         }
181     }
182 
183     protected UserTracker removeImpl(UserTracker userTracker)
184         throws SystemException {
185         userTracker = toUnwrappedModel(userTracker);
186 
187         Session session = null;
188 
189         try {
190             session = openSession();
191 
192             BatchSessionUtil.delete(session, userTracker);
193         }
194         catch (Exception e) {
195             throw processException(e);
196         }
197         finally {
198             closeSession(session);
199         }
200 
201         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
202 
203         EntityCacheUtil.removeResult(UserTrackerModelImpl.ENTITY_CACHE_ENABLED,
204             UserTrackerImpl.class, userTracker.getPrimaryKey());
205 
206         return userTracker;
207     }
208 
209     /**
210      * @deprecated Use {@link BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)}.
211      */
212     public UserTracker update(UserTracker userTracker)
213         throws SystemException {
214         if (_log.isWarnEnabled()) {
215             _log.warn(
216                 "Using the deprecated update(UserTracker userTracker) method. Use update(UserTracker userTracker, boolean merge) instead.");
217         }
218 
219         return update(userTracker, false);
220     }
221 
222     public UserTracker updateImpl(
223         com.liferay.portal.model.UserTracker userTracker, boolean merge)
224         throws SystemException {
225         userTracker = toUnwrappedModel(userTracker);
226 
227         Session session = null;
228 
229         try {
230             session = openSession();
231 
232             BatchSessionUtil.update(session, userTracker, merge);
233 
234             userTracker.setNew(false);
235         }
236         catch (Exception e) {
237             throw processException(e);
238         }
239         finally {
240             closeSession(session);
241         }
242 
243         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
244 
245         EntityCacheUtil.putResult(UserTrackerModelImpl.ENTITY_CACHE_ENABLED,
246             UserTrackerImpl.class, userTracker.getPrimaryKey(), userTracker);
247 
248         return userTracker;
249     }
250 
251     protected UserTracker toUnwrappedModel(UserTracker userTracker) {
252         if (userTracker instanceof UserTrackerImpl) {
253             return userTracker;
254         }
255 
256         UserTrackerImpl userTrackerImpl = new UserTrackerImpl();
257 
258         userTrackerImpl.setNew(userTracker.isNew());
259         userTrackerImpl.setPrimaryKey(userTracker.getPrimaryKey());
260 
261         userTrackerImpl.setUserTrackerId(userTracker.getUserTrackerId());
262         userTrackerImpl.setCompanyId(userTracker.getCompanyId());
263         userTrackerImpl.setUserId(userTracker.getUserId());
264         userTrackerImpl.setModifiedDate(userTracker.getModifiedDate());
265         userTrackerImpl.setSessionId(userTracker.getSessionId());
266         userTrackerImpl.setRemoteAddr(userTracker.getRemoteAddr());
267         userTrackerImpl.setRemoteHost(userTracker.getRemoteHost());
268         userTrackerImpl.setUserAgent(userTracker.getUserAgent());
269 
270         return userTrackerImpl;
271     }
272 
273     public UserTracker findByPrimaryKey(Serializable primaryKey)
274         throws NoSuchModelException, SystemException {
275         return findByPrimaryKey(((Long)primaryKey).longValue());
276     }
277 
278     public UserTracker findByPrimaryKey(long userTrackerId)
279         throws NoSuchUserTrackerException, SystemException {
280         UserTracker userTracker = fetchByPrimaryKey(userTrackerId);
281 
282         if (userTracker == null) {
283             if (_log.isWarnEnabled()) {
284                 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + userTrackerId);
285             }
286 
287             throw new NoSuchUserTrackerException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
288                 userTrackerId);
289         }
290 
291         return userTracker;
292     }
293 
294     public UserTracker fetchByPrimaryKey(Serializable primaryKey)
295         throws SystemException {
296         return fetchByPrimaryKey(((Long)primaryKey).longValue());
297     }
298 
299     public UserTracker fetchByPrimaryKey(long userTrackerId)
300         throws SystemException {
301         UserTracker userTracker = (UserTracker)EntityCacheUtil.getResult(UserTrackerModelImpl.ENTITY_CACHE_ENABLED,
302                 UserTrackerImpl.class, userTrackerId, this);
303 
304         if (userTracker == null) {
305             Session session = null;
306 
307             try {
308                 session = openSession();
309 
310                 userTracker = (UserTracker)session.get(UserTrackerImpl.class,
311                         new Long(userTrackerId));
312             }
313             catch (Exception e) {
314                 throw processException(e);
315             }
316             finally {
317                 if (userTracker != null) {
318                     cacheResult(userTracker);
319                 }
320 
321                 closeSession(session);
322             }
323         }
324 
325         return userTracker;
326     }
327 
328     public List<UserTracker> findByCompanyId(long companyId)
329         throws SystemException {
330         return findByCompanyId(companyId, QueryUtil.ALL_POS, QueryUtil.ALL_POS,
331             null);
332     }
333 
334     public List<UserTracker> findByCompanyId(long companyId, int start, int end)
335         throws SystemException {
336         return findByCompanyId(companyId, start, end, null);
337     }
338 
339     public List<UserTracker> findByCompanyId(long companyId, int start,
340         int end, OrderByComparator orderByComparator) throws SystemException {
341         Object[] finderArgs = new Object[] {
342                 companyId,
343                 
344                 String.valueOf(start), String.valueOf(end),
345                 String.valueOf(orderByComparator)
346             };
347 
348         List<UserTracker> list = (List<UserTracker>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_COMPANYID,
349                 finderArgs, this);
350 
351         if (list == null) {
352             StringBundler query = null;
353 
354             if (orderByComparator != null) {
355                 query = new StringBundler(3 +
356                         (orderByComparator.getOrderByFields().length * 3));
357             }
358             else {
359                 query = new StringBundler(2);
360             }
361 
362             query.append(_SQL_SELECT_USERTRACKER_WHERE);
363 
364             query.append(_FINDER_COLUMN_COMPANYID_COMPANYID_2);
365 
366             if (orderByComparator != null) {
367                 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
368                     orderByComparator);
369             }
370 
371             String sql = query.toString();
372 
373             Session session = null;
374 
375             try {
376                 session = openSession();
377 
378                 Query q = session.createQuery(sql);
379 
380                 QueryPos qPos = QueryPos.getInstance(q);
381 
382                 qPos.add(companyId);
383 
384                 list = (List<UserTracker>)QueryUtil.list(q, getDialect(),
385                         start, end);
386             }
387             catch (Exception e) {
388                 throw processException(e);
389             }
390             finally {
391                 if (list == null) {
392                     list = new ArrayList<UserTracker>();
393                 }
394 
395                 cacheResult(list);
396 
397                 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_COMPANYID,
398                     finderArgs, list);
399 
400                 closeSession(session);
401             }
402         }
403 
404         return list;
405     }
406 
407     public UserTracker findByCompanyId_First(long companyId,
408         OrderByComparator orderByComparator)
409         throws NoSuchUserTrackerException, SystemException {
410         List<UserTracker> list = findByCompanyId(companyId, 0, 1,
411                 orderByComparator);
412 
413         if (list.isEmpty()) {
414             StringBundler msg = new StringBundler(4);
415 
416             msg.append(_NO_SUCH_ENTITY_WITH_KEY);
417 
418             msg.append("companyId=");
419             msg.append(companyId);
420 
421             msg.append(StringPool.CLOSE_CURLY_BRACE);
422 
423             throw new NoSuchUserTrackerException(msg.toString());
424         }
425         else {
426             return list.get(0);
427         }
428     }
429 
430     public UserTracker findByCompanyId_Last(long companyId,
431         OrderByComparator orderByComparator)
432         throws NoSuchUserTrackerException, SystemException {
433         int count = countByCompanyId(companyId);
434 
435         List<UserTracker> list = findByCompanyId(companyId, count - 1, count,
436                 orderByComparator);
437 
438         if (list.isEmpty()) {
439             StringBundler msg = new StringBundler(4);
440 
441             msg.append(_NO_SUCH_ENTITY_WITH_KEY);
442 
443             msg.append("companyId=");
444             msg.append(companyId);
445 
446             msg.append(StringPool.CLOSE_CURLY_BRACE);
447 
448             throw new NoSuchUserTrackerException(msg.toString());
449         }
450         else {
451             return list.get(0);
452         }
453     }
454 
455     public UserTracker[] findByCompanyId_PrevAndNext(long userTrackerId,
456         long companyId, OrderByComparator orderByComparator)
457         throws NoSuchUserTrackerException, SystemException {
458         UserTracker userTracker = findByPrimaryKey(userTrackerId);
459 
460         Session session = null;
461 
462         try {
463             session = openSession();
464 
465             UserTracker[] array = new UserTrackerImpl[3];
466 
467             array[0] = getByCompanyId_PrevAndNext(session, userTracker,
468                     companyId, orderByComparator, true);
469 
470             array[1] = userTracker;
471 
472             array[2] = getByCompanyId_PrevAndNext(session, userTracker,
473                     companyId, orderByComparator, false);
474 
475             return array;
476         }
477         catch (Exception e) {
478             throw processException(e);
479         }
480         finally {
481             closeSession(session);
482         }
483     }
484 
485     protected UserTracker getByCompanyId_PrevAndNext(Session session,
486         UserTracker userTracker, long companyId,
487         OrderByComparator orderByComparator, boolean previous) {
488         StringBundler query = null;
489 
490         if (orderByComparator != null) {
491             query = new StringBundler(6 +
492                     (orderByComparator.getOrderByFields().length * 6));
493         }
494         else {
495             query = new StringBundler(3);
496         }
497 
498         query.append(_SQL_SELECT_USERTRACKER_WHERE);
499 
500         query.append(_FINDER_COLUMN_COMPANYID_COMPANYID_2);
501 
502         if (orderByComparator != null) {
503             String[] orderByFields = orderByComparator.getOrderByFields();
504 
505             if (orderByFields.length > 0) {
506                 query.append(WHERE_AND);
507             }
508 
509             for (int i = 0; i < orderByFields.length; i++) {
510                 query.append(_ORDER_BY_ENTITY_ALIAS);
511                 query.append(orderByFields[i]);
512 
513                 if ((i + 1) < orderByFields.length) {
514                     if (orderByComparator.isAscending() ^ previous) {
515                         query.append(WHERE_GREATER_THAN_HAS_NEXT);
516                     }
517                     else {
518                         query.append(WHERE_LESSER_THAN_HAS_NEXT);
519                     }
520                 }
521                 else {
522                     if (orderByComparator.isAscending() ^ previous) {
523                         query.append(WHERE_GREATER_THAN);
524                     }
525                     else {
526                         query.append(WHERE_LESSER_THAN);
527                     }
528                 }
529             }
530 
531             query.append(ORDER_BY_CLAUSE);
532 
533             for (int i = 0; i < orderByFields.length; i++) {
534                 query.append(_ORDER_BY_ENTITY_ALIAS);
535                 query.append(orderByFields[i]);
536 
537                 if ((i + 1) < orderByFields.length) {
538                     if (orderByComparator.isAscending() ^ previous) {
539                         query.append(ORDER_BY_ASC_HAS_NEXT);
540                     }
541                     else {
542                         query.append(ORDER_BY_DESC_HAS_NEXT);
543                     }
544                 }
545                 else {
546                     if (orderByComparator.isAscending() ^ previous) {
547                         query.append(ORDER_BY_ASC);
548                     }
549                     else {
550                         query.append(ORDER_BY_DESC);
551                     }
552                 }
553             }
554         }
555 
556         String sql = query.toString();
557 
558         Query q = session.createQuery(sql);
559 
560         q.setFirstResult(0);
561         q.setMaxResults(2);
562 
563         QueryPos qPos = QueryPos.getInstance(q);
564 
565         qPos.add(companyId);
566 
567         if (orderByComparator != null) {
568             Object[] values = orderByComparator.getOrderByValues(userTracker);
569 
570             for (Object value : values) {
571                 qPos.add(value);
572             }
573         }
574 
575         List<UserTracker> list = q.list();
576 
577         if (list.size() == 2) {
578             return list.get(1);
579         }
580         else {
581             return null;
582         }
583     }
584 
585     public List<UserTracker> findByUserId(long userId)
586         throws SystemException {
587         return findByUserId(userId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
588     }
589 
590     public List<UserTracker> findByUserId(long userId, int start, int end)
591         throws SystemException {
592         return findByUserId(userId, start, end, null);
593     }
594 
595     public List<UserTracker> findByUserId(long userId, int start, int end,
596         OrderByComparator orderByComparator) throws SystemException {
597         Object[] finderArgs = new Object[] {
598                 userId,
599                 
600                 String.valueOf(start), String.valueOf(end),
601                 String.valueOf(orderByComparator)
602             };
603 
604         List<UserTracker> list = (List<UserTracker>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_USERID,
605                 finderArgs, this);
606 
607         if (list == null) {
608             StringBundler query = null;
609 
610             if (orderByComparator != null) {
611                 query = new StringBundler(3 +
612                         (orderByComparator.getOrderByFields().length * 3));
613             }
614             else {
615                 query = new StringBundler(2);
616             }
617 
618             query.append(_SQL_SELECT_USERTRACKER_WHERE);
619 
620             query.append(_FINDER_COLUMN_USERID_USERID_2);
621 
622             if (orderByComparator != null) {
623                 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
624                     orderByComparator);
625             }
626 
627             String sql = query.toString();
628 
629             Session session = null;
630 
631             try {
632                 session = openSession();
633 
634                 Query q = session.createQuery(sql);
635 
636                 QueryPos qPos = QueryPos.getInstance(q);
637 
638                 qPos.add(userId);
639 
640                 list = (List<UserTracker>)QueryUtil.list(q, getDialect(),
641                         start, end);
642             }
643             catch (Exception e) {
644                 throw processException(e);
645             }
646             finally {
647                 if (list == null) {
648                     list = new ArrayList<UserTracker>();
649                 }
650 
651                 cacheResult(list);
652 
653                 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_USERID,
654                     finderArgs, list);
655 
656                 closeSession(session);
657             }
658         }
659 
660         return list;
661     }
662 
663     public UserTracker findByUserId_First(long userId,
664         OrderByComparator orderByComparator)
665         throws NoSuchUserTrackerException, SystemException {
666         List<UserTracker> list = findByUserId(userId, 0, 1, orderByComparator);
667 
668         if (list.isEmpty()) {
669             StringBundler msg = new StringBundler(4);
670 
671             msg.append(_NO_SUCH_ENTITY_WITH_KEY);
672 
673             msg.append("userId=");
674             msg.append(userId);
675 
676             msg.append(StringPool.CLOSE_CURLY_BRACE);
677 
678             throw new NoSuchUserTrackerException(msg.toString());
679         }
680         else {
681             return list.get(0);
682         }
683     }
684 
685     public UserTracker findByUserId_Last(long userId,
686         OrderByComparator orderByComparator)
687         throws NoSuchUserTrackerException, SystemException {
688         int count = countByUserId(userId);
689 
690         List<UserTracker> list = findByUserId(userId, count - 1, count,
691                 orderByComparator);
692 
693         if (list.isEmpty()) {
694             StringBundler msg = new StringBundler(4);
695 
696             msg.append(_NO_SUCH_ENTITY_WITH_KEY);
697 
698             msg.append("userId=");
699             msg.append(userId);
700 
701             msg.append(StringPool.CLOSE_CURLY_BRACE);
702 
703             throw new NoSuchUserTrackerException(msg.toString());
704         }
705         else {
706             return list.get(0);
707         }
708     }
709 
710     public UserTracker[] findByUserId_PrevAndNext(long userTrackerId,
711         long userId, OrderByComparator orderByComparator)
712         throws NoSuchUserTrackerException, SystemException {
713         UserTracker userTracker = findByPrimaryKey(userTrackerId);
714 
715         Session session = null;
716 
717         try {
718             session = openSession();
719 
720             UserTracker[] array = new UserTrackerImpl[3];
721 
722             array[0] = getByUserId_PrevAndNext(session, userTracker, userId,
723                     orderByComparator, true);
724 
725             array[1] = userTracker;
726 
727             array[2] = getByUserId_PrevAndNext(session, userTracker, userId,
728                     orderByComparator, false);
729 
730             return array;
731         }
732         catch (Exception e) {
733             throw processException(e);
734         }
735         finally {
736             closeSession(session);
737         }
738     }
739 
740     protected UserTracker getByUserId_PrevAndNext(Session session,
741         UserTracker userTracker, long userId,
742         OrderByComparator orderByComparator, boolean previous) {
743         StringBundler query = null;
744 
745         if (orderByComparator != null) {
746             query = new StringBundler(6 +
747                     (orderByComparator.getOrderByFields().length * 6));
748         }
749         else {
750             query = new StringBundler(3);
751         }
752 
753         query.append(_SQL_SELECT_USERTRACKER_WHERE);
754 
755         query.append(_FINDER_COLUMN_USERID_USERID_2);
756 
757         if (orderByComparator != null) {
758             String[] orderByFields = orderByComparator.getOrderByFields();
759 
760             if (orderByFields.length > 0) {
761                 query.append(WHERE_AND);
762             }
763 
764             for (int i = 0; i < orderByFields.length; i++) {
765                 query.append(_ORDER_BY_ENTITY_ALIAS);
766                 query.append(orderByFields[i]);
767 
768                 if ((i + 1) < orderByFields.length) {
769                     if (orderByComparator.isAscending() ^ previous) {
770                         query.append(WHERE_GREATER_THAN_HAS_NEXT);
771                     }
772                     else {
773                         query.append(WHERE_LESSER_THAN_HAS_NEXT);
774                     }
775                 }
776                 else {
777                     if (orderByComparator.isAscending() ^ previous) {
778                         query.append(WHERE_GREATER_THAN);
779                     }
780                     else {
781                         query.append(WHERE_LESSER_THAN);
782                     }
783                 }
784             }
785 
786             query.append(ORDER_BY_CLAUSE);
787 
788             for (int i = 0; i < orderByFields.length; i++) {
789                 query.append(_ORDER_BY_ENTITY_ALIAS);
790                 query.append(orderByFields[i]);
791 
792                 if ((i + 1) < orderByFields.length) {
793                     if (orderByComparator.isAscending() ^ previous) {
794                         query.append(ORDER_BY_ASC_HAS_NEXT);
795                     }
796                     else {
797                         query.append(ORDER_BY_DESC_HAS_NEXT);
798                     }
799                 }
800                 else {
801                     if (orderByComparator.isAscending() ^ previous) {
802                         query.append(ORDER_BY_ASC);
803                     }
804                     else {
805                         query.append(ORDER_BY_DESC);
806                     }
807                 }
808             }
809         }
810 
811         String sql = query.toString();
812 
813         Query q = session.createQuery(sql);
814 
815         q.setFirstResult(0);
816         q.setMaxResults(2);
817 
818         QueryPos qPos = QueryPos.getInstance(q);
819 
820         qPos.add(userId);
821 
822         if (orderByComparator != null) {
823             Object[] values = orderByComparator.getOrderByValues(userTracker);
824 
825             for (Object value : values) {
826                 qPos.add(value);
827             }
828         }
829 
830         List<UserTracker> list = q.list();
831 
832         if (list.size() == 2) {
833             return list.get(1);
834         }
835         else {
836             return null;
837         }
838     }
839 
840     public List<UserTracker> findBySessionId(String sessionId)
841         throws SystemException {
842         return findBySessionId(sessionId, QueryUtil.ALL_POS, QueryUtil.ALL_POS,
843             null);
844     }
845 
846     public List<UserTracker> findBySessionId(String sessionId, int start,
847         int end) throws SystemException {
848         return findBySessionId(sessionId, start, end, null);
849     }
850 
851     public List<UserTracker> findBySessionId(String sessionId, int start,
852         int end, OrderByComparator orderByComparator) throws SystemException {
853         Object[] finderArgs = new Object[] {
854                 sessionId,
855                 
856                 String.valueOf(start), String.valueOf(end),
857                 String.valueOf(orderByComparator)
858             };
859 
860         List<UserTracker> list = (List<UserTracker>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_SESSIONID,
861                 finderArgs, this);
862 
863         if (list == null) {
864             StringBundler query = null;
865 
866             if (orderByComparator != null) {
867                 query = new StringBundler(3 +
868                         (orderByComparator.getOrderByFields().length * 3));
869             }
870             else {
871                 query = new StringBundler(2);
872             }
873 
874             query.append(_SQL_SELECT_USERTRACKER_WHERE);
875 
876             if (sessionId == null) {
877                 query.append(_FINDER_COLUMN_SESSIONID_SESSIONID_1);
878             }
879             else {
880                 if (sessionId.equals(StringPool.BLANK)) {
881                     query.append(_FINDER_COLUMN_SESSIONID_SESSIONID_3);
882                 }
883                 else {
884                     query.append(_FINDER_COLUMN_SESSIONID_SESSIONID_2);
885                 }
886             }
887 
888             if (orderByComparator != null) {
889                 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
890                     orderByComparator);
891             }
892 
893             String sql = query.toString();
894 
895             Session session = null;
896 
897             try {
898                 session = openSession();
899 
900                 Query q = session.createQuery(sql);
901 
902                 QueryPos qPos = QueryPos.getInstance(q);
903 
904                 if (sessionId != null) {
905                     qPos.add(sessionId);
906                 }
907 
908                 list = (List<UserTracker>)QueryUtil.list(q, getDialect(),
909                         start, end);
910             }
911             catch (Exception e) {
912                 throw processException(e);
913             }
914             finally {
915                 if (list == null) {
916                     list = new ArrayList<UserTracker>();
917                 }
918 
919                 cacheResult(list);
920 
921                 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_SESSIONID,
922                     finderArgs, list);
923 
924                 closeSession(session);
925             }
926         }
927 
928         return list;
929     }
930 
931     public UserTracker findBySessionId_First(String sessionId,
932         OrderByComparator orderByComparator)
933         throws NoSuchUserTrackerException, SystemException {
934         List<UserTracker> list = findBySessionId(sessionId, 0, 1,
935                 orderByComparator);
936 
937         if (list.isEmpty()) {
938             StringBundler msg = new StringBundler(4);
939 
940             msg.append(_NO_SUCH_ENTITY_WITH_KEY);
941 
942             msg.append("sessionId=");
943             msg.append(sessionId);
944 
945             msg.append(StringPool.CLOSE_CURLY_BRACE);
946 
947             throw new NoSuchUserTrackerException(msg.toString());
948         }
949         else {
950             return list.get(0);
951         }
952     }
953 
954     public UserTracker findBySessionId_Last(String sessionId,
955         OrderByComparator orderByComparator)
956         throws NoSuchUserTrackerException, SystemException {
957         int count = countBySessionId(sessionId);
958 
959         List<UserTracker> list = findBySessionId(sessionId, count - 1, count,
960                 orderByComparator);
961 
962         if (list.isEmpty()) {
963             StringBundler msg = new StringBundler(4);
964 
965             msg.append(_NO_SUCH_ENTITY_WITH_KEY);
966 
967             msg.append("sessionId=");
968             msg.append(sessionId);
969 
970             msg.append(StringPool.CLOSE_CURLY_BRACE);
971 
972             throw new NoSuchUserTrackerException(msg.toString());
973         }
974         else {
975             return list.get(0);
976         }
977     }
978 
979     public UserTracker[] findBySessionId_PrevAndNext(long userTrackerId,
980         String sessionId, OrderByComparator orderByComparator)
981         throws NoSuchUserTrackerException, SystemException {
982         UserTracker userTracker = findByPrimaryKey(userTrackerId);
983 
984         Session session = null;
985 
986         try {
987             session = openSession();
988 
989             UserTracker[] array = new UserTrackerImpl[3];
990 
991             array[0] = getBySessionId_PrevAndNext(session, userTracker,
992                     sessionId, orderByComparator, true);
993 
994             array[1] = userTracker;
995 
996             array[2] = getBySessionId_PrevAndNext(session, userTracker,
997                     sessionId, orderByComparator, false);
998 
999             return array;
1000        }
1001        catch (Exception e) {
1002            throw processException(e);
1003        }
1004        finally {
1005            closeSession(session);
1006        }
1007    }
1008
1009    protected UserTracker getBySessionId_PrevAndNext(Session session,
1010        UserTracker userTracker, String sessionId,
1011        OrderByComparator orderByComparator, boolean previous) {
1012        StringBundler query = null;
1013
1014        if (orderByComparator != null) {
1015            query = new StringBundler(6 +
1016                    (orderByComparator.getOrderByFields().length * 6));
1017        }
1018        else {
1019            query = new StringBundler(3);
1020        }
1021
1022        query.append(_SQL_SELECT_USERTRACKER_WHERE);
1023
1024        if (sessionId == null) {
1025            query.append(_FINDER_COLUMN_SESSIONID_SESSIONID_1);
1026        }
1027        else {
1028            if (sessionId.equals(StringPool.BLANK)) {
1029                query.append(_FINDER_COLUMN_SESSIONID_SESSIONID_3);
1030            }
1031            else {
1032                query.append(_FINDER_COLUMN_SESSIONID_SESSIONID_2);
1033            }
1034        }
1035
1036        if (orderByComparator != null) {
1037            String[] orderByFields = orderByComparator.getOrderByFields();
1038
1039            if (orderByFields.length > 0) {
1040                query.append(WHERE_AND);
1041            }
1042
1043            for (int i = 0; i < orderByFields.length; i++) {
1044                query.append(_ORDER_BY_ENTITY_ALIAS);
1045                query.append(orderByFields[i]);
1046
1047                if ((i + 1) < orderByFields.length) {
1048                    if (orderByComparator.isAscending() ^ previous) {
1049                        query.append(WHERE_GREATER_THAN_HAS_NEXT);
1050                    }
1051                    else {
1052                        query.append(WHERE_LESSER_THAN_HAS_NEXT);
1053                    }
1054                }
1055                else {
1056                    if (orderByComparator.isAscending() ^ previous) {
1057                        query.append(WHERE_GREATER_THAN);
1058                    }
1059                    else {
1060                        query.append(WHERE_LESSER_THAN);
1061                    }
1062                }
1063            }
1064
1065            query.append(ORDER_BY_CLAUSE);
1066
1067            for (int i = 0; i < orderByFields.length; i++) {
1068                query.append(_ORDER_BY_ENTITY_ALIAS);
1069                query.append(orderByFields[i]);
1070
1071                if ((i + 1) < orderByFields.length) {
1072                    if (orderByComparator.isAscending() ^ previous) {
1073                        query.append(ORDER_BY_ASC_HAS_NEXT);
1074                    }
1075                    else {
1076                        query.append(ORDER_BY_DESC_HAS_NEXT);
1077                    }
1078                }
1079                else {
1080                    if (orderByComparator.isAscending() ^ previous) {
1081                        query.append(ORDER_BY_ASC);
1082                    }
1083                    else {
1084                        query.append(ORDER_BY_DESC);
1085                    }
1086                }
1087            }
1088        }
1089
1090        String sql = query.toString();
1091
1092        Query q = session.createQuery(sql);
1093
1094        q.setFirstResult(0);
1095        q.setMaxResults(2);
1096
1097        QueryPos qPos = QueryPos.getInstance(q);
1098
1099        if (sessionId != null) {
1100            qPos.add(sessionId);
1101        }
1102
1103        if (orderByComparator != null) {
1104            Object[] values = orderByComparator.getOrderByValues(userTracker);
1105
1106            for (Object value : values) {
1107                qPos.add(value);
1108            }
1109        }
1110
1111        List<UserTracker> list = q.list();
1112
1113        if (list.size() == 2) {
1114            return list.get(1);
1115        }
1116        else {
1117            return null;
1118        }
1119    }
1120
1121    public List<UserTracker> findAll() throws SystemException {
1122        return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
1123    }
1124
1125    public List<UserTracker> findAll(int start, int end)
1126        throws SystemException {
1127        return findAll(start, end, null);
1128    }
1129
1130    public List<UserTracker> findAll(int start, int end,
1131        OrderByComparator orderByComparator) throws SystemException {
1132        Object[] finderArgs = new Object[] {
1133                String.valueOf(start), String.valueOf(end),
1134                String.valueOf(orderByComparator)
1135            };
1136
1137        List<UserTracker> list = (List<UserTracker>)FinderCacheUtil.getResult(FINDER_PATH_FIND_ALL,
1138                finderArgs, this);
1139
1140        if (list == null) {
1141            StringBundler query = null;
1142            String sql = null;
1143
1144            if (orderByComparator != null) {
1145                query = new StringBundler(2 +
1146                        (orderByComparator.getOrderByFields().length * 3));
1147
1148                query.append(_SQL_SELECT_USERTRACKER);
1149
1150                appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
1151                    orderByComparator);
1152
1153                sql = query.toString();
1154            }
1155            else {
1156                sql = _SQL_SELECT_USERTRACKER;
1157            }
1158
1159            Session session = null;
1160
1161            try {
1162                session = openSession();
1163
1164                Query q = session.createQuery(sql);
1165
1166                if (orderByComparator == null) {
1167                    list = (List<UserTracker>)QueryUtil.list(q, getDialect(),
1168                            start, end, false);
1169
1170                    Collections.sort(list);
1171                }
1172                else {
1173                    list = (List<UserTracker>)QueryUtil.list(q, getDialect(),
1174                            start, end);
1175                }
1176            }
1177            catch (Exception e) {
1178                throw processException(e);
1179            }
1180            finally {
1181                if (list == null) {
1182                    list = new ArrayList<UserTracker>();
1183                }
1184
1185                cacheResult(list);
1186
1187                FinderCacheUtil.putResult(FINDER_PATH_FIND_ALL, finderArgs, list);
1188
1189                closeSession(session);
1190            }
1191        }
1192
1193        return list;
1194    }
1195
1196    public void removeByCompanyId(long companyId) throws SystemException {
1197        for (UserTracker userTracker : findByCompanyId(companyId)) {
1198            remove(userTracker);
1199        }
1200    }
1201
1202    public void removeByUserId(long userId) throws SystemException {
1203        for (UserTracker userTracker : findByUserId(userId)) {
1204            remove(userTracker);
1205        }
1206    }
1207
1208    public void removeBySessionId(String sessionId) throws SystemException {
1209        for (UserTracker userTracker : findBySessionId(sessionId)) {
1210            remove(userTracker);
1211        }
1212    }
1213
1214    public void removeAll() throws SystemException {
1215        for (UserTracker userTracker : findAll()) {
1216            remove(userTracker);
1217        }
1218    }
1219
1220    public int countByCompanyId(long companyId) throws SystemException {
1221        Object[] finderArgs = new Object[] { companyId };
1222
1223        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_COMPANYID,
1224                finderArgs, this);
1225
1226        if (count == null) {
1227            StringBundler query = new StringBundler(2);
1228
1229            query.append(_SQL_COUNT_USERTRACKER_WHERE);
1230
1231            query.append(_FINDER_COLUMN_COMPANYID_COMPANYID_2);
1232
1233            String sql = query.toString();
1234
1235            Session session = null;
1236
1237            try {
1238                session = openSession();
1239
1240                Query q = session.createQuery(sql);
1241
1242                QueryPos qPos = QueryPos.getInstance(q);
1243
1244                qPos.add(companyId);
1245
1246                count = (Long)q.uniqueResult();
1247            }
1248            catch (Exception e) {
1249                throw processException(e);
1250            }
1251            finally {
1252                if (count == null) {
1253                    count = Long.valueOf(0);
1254                }
1255
1256                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_COMPANYID,
1257                    finderArgs, count);
1258
1259                closeSession(session);
1260            }
1261        }
1262
1263        return count.intValue();
1264    }
1265
1266    public int countByUserId(long userId) throws SystemException {
1267        Object[] finderArgs = new Object[] { userId };
1268
1269        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_USERID,
1270                finderArgs, this);
1271
1272        if (count == null) {
1273            StringBundler query = new StringBundler(2);
1274
1275            query.append(_SQL_COUNT_USERTRACKER_WHERE);
1276
1277            query.append(_FINDER_COLUMN_USERID_USERID_2);
1278
1279            String sql = query.toString();
1280
1281            Session session = null;
1282
1283            try {
1284                session = openSession();
1285
1286                Query q = session.createQuery(sql);
1287
1288                QueryPos qPos = QueryPos.getInstance(q);
1289
1290                qPos.add(userId);
1291
1292                count = (Long)q.uniqueResult();
1293            }
1294            catch (Exception e) {
1295                throw processException(e);
1296            }
1297            finally {
1298                if (count == null) {
1299                    count = Long.valueOf(0);
1300                }
1301
1302                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_USERID,
1303                    finderArgs, count);
1304
1305                closeSession(session);
1306            }
1307        }
1308
1309        return count.intValue();
1310    }
1311
1312    public int countBySessionId(String sessionId) throws SystemException {
1313        Object[] finderArgs = new Object[] { sessionId };
1314
1315        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_SESSIONID,
1316                finderArgs, this);
1317
1318        if (count == null) {
1319            StringBundler query = new StringBundler(2);
1320
1321            query.append(_SQL_COUNT_USERTRACKER_WHERE);
1322
1323            if (sessionId == null) {
1324                query.append(_FINDER_COLUMN_SESSIONID_SESSIONID_1);
1325            }
1326            else {
1327                if (sessionId.equals(StringPool.BLANK)) {
1328                    query.append(_FINDER_COLUMN_SESSIONID_SESSIONID_3);
1329                }
1330                else {
1331                    query.append(_FINDER_COLUMN_SESSIONID_SESSIONID_2);
1332                }
1333            }
1334
1335            String sql = query.toString();
1336
1337            Session session = null;
1338
1339            try {
1340                session = openSession();
1341
1342                Query q = session.createQuery(sql);
1343
1344                QueryPos qPos = QueryPos.getInstance(q);
1345
1346                if (sessionId != null) {
1347                    qPos.add(sessionId);
1348                }
1349
1350                count = (Long)q.uniqueResult();
1351            }
1352            catch (Exception e) {
1353                throw processException(e);
1354            }
1355            finally {
1356                if (count == null) {
1357                    count = Long.valueOf(0);
1358                }
1359
1360                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_SESSIONID,
1361                    finderArgs, count);
1362
1363                closeSession(session);
1364            }
1365        }
1366
1367        return count.intValue();
1368    }
1369
1370    public int countAll() throws SystemException {
1371        Object[] finderArgs = new Object[0];
1372
1373        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
1374                finderArgs, this);
1375
1376        if (count == null) {
1377            Session session = null;
1378
1379            try {
1380                session = openSession();
1381
1382                Query q = session.createQuery(_SQL_COUNT_USERTRACKER);
1383
1384                count = (Long)q.uniqueResult();
1385            }
1386            catch (Exception e) {
1387                throw processException(e);
1388            }
1389            finally {
1390                if (count == null) {
1391                    count = Long.valueOf(0);
1392                }
1393
1394                FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL, finderArgs,
1395                    count);
1396
1397                closeSession(session);
1398            }
1399        }
1400
1401        return count.intValue();
1402    }
1403
1404    public void afterPropertiesSet() {
1405        String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
1406                    com.liferay.portal.util.PropsUtil.get(
1407                        "value.object.listener.com.liferay.portal.model.UserTracker")));
1408
1409        if (listenerClassNames.length > 0) {
1410            try {
1411                List<ModelListener<UserTracker>> listenersList = new ArrayList<ModelListener<UserTracker>>();
1412
1413                for (String listenerClassName : listenerClassNames) {
1414                    listenersList.add((ModelListener<UserTracker>)InstanceFactory.newInstance(
1415                            listenerClassName));
1416                }
1417
1418                listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
1419            }
1420            catch (Exception e) {
1421                _log.error(e);
1422            }
1423        }
1424    }
1425
1426    public void destroy() {
1427        EntityCacheUtil.removeCache(UserTrackerImpl.class.getName());
1428        FinderCacheUtil.removeCache(FINDER_CLASS_NAME_ENTITY);
1429        FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST);
1430    }
1431
1432    @BeanReference(type = AccountPersistence.class)
1433    protected AccountPersistence accountPersistence;
1434    @BeanReference(type = AddressPersistence.class)
1435    protected AddressPersistence addressPersistence;
1436    @BeanReference(type = BrowserTrackerPersistence.class)
1437    protected BrowserTrackerPersistence browserTrackerPersistence;
1438    @BeanReference(type = ClassNamePersistence.class)
1439    protected ClassNamePersistence classNamePersistence;
1440    @BeanReference(type = CompanyPersistence.class)
1441    protected CompanyPersistence companyPersistence;
1442    @BeanReference(type = ContactPersistence.class)
1443    protected ContactPersistence contactPersistence;
1444    @BeanReference(type = CountryPersistence.class)
1445    protected CountryPersistence countryPersistence;
1446    @BeanReference(type = EmailAddressPersistence.class)
1447    protected EmailAddressPersistence emailAddressPersistence;
1448    @BeanReference(type = GroupPersistence.class)
1449    protected GroupPersistence groupPersistence;
1450    @BeanReference(type = ImagePersistence.class)
1451    protected ImagePersistence imagePersistence;
1452    @BeanReference(type = LayoutPersistence.class)
1453    protected LayoutPersistence layoutPersistence;
1454    @BeanReference(type = LayoutSetPersistence.class)
1455    protected LayoutSetPersistence layoutSetPersistence;
1456    @BeanReference(type = ListTypePersistence.class)
1457    protected ListTypePersistence listTypePersistence;
1458    @BeanReference(type = LockPersistence.class)
1459    protected LockPersistence lockPersistence;
1460    @BeanReference(type = MembershipRequestPersistence.class)
1461    protected MembershipRequestPersistence membershipRequestPersistence;
1462    @BeanReference(type = OrganizationPersistence.class)
1463    protected OrganizationPersistence organizationPersistence;
1464    @BeanReference(type = OrgGroupPermissionPersistence.class)
1465    protected OrgGroupPermissionPersistence orgGroupPermissionPersistence;
1466    @BeanReference(type = OrgGroupRolePersistence.class)
1467    protected OrgGroupRolePersistence orgGroupRolePersistence;
1468    @BeanReference(type = OrgLaborPersistence.class)
1469    protected OrgLaborPersistence orgLaborPersistence;
1470    @BeanReference(type = PasswordPolicyPersistence.class)
1471    protected PasswordPolicyPersistence passwordPolicyPersistence;
1472    @BeanReference(type = PasswordPolicyRelPersistence.class)
1473    protected PasswordPolicyRelPersistence passwordPolicyRelPersistence;
1474    @BeanReference(type = PasswordTrackerPersistence.class)
1475    protected PasswordTrackerPersistence passwordTrackerPersistence;
1476    @BeanReference(type = PermissionPersistence.class)
1477    protected PermissionPersistence permissionPersistence;
1478    @BeanReference(type = PhonePersistence.class)
1479    protected PhonePersistence phonePersistence;
1480    @BeanReference(type = PluginSettingPersistence.class)
1481    protected PluginSettingPersistence pluginSettingPersistence;
1482    @BeanReference(type = PortletPersistence.class)
1483    protected PortletPersistence portletPersistence;
1484    @BeanReference(type = PortletItemPersistence.class)
1485    protected PortletItemPersistence portletItemPersistence;
1486    @BeanReference(type = PortletPreferencesPersistence.class)
1487    protected PortletPreferencesPersistence portletPreferencesPersistence;
1488    @BeanReference(type = RegionPersistence.class)
1489    protected RegionPersistence regionPersistence;
1490    @BeanReference(type = ReleasePersistence.class)
1491    protected ReleasePersistence releasePersistence;
1492    @BeanReference(type = ResourcePersistence.class)
1493    protected ResourcePersistence resourcePersistence;
1494    @BeanReference(type = ResourceActionPersistence.class)
1495    protected ResourceActionPersistence resourceActionPersistence;
1496    @BeanReference(type = ResourceCodePersistence.class)
1497    protected ResourceCodePersistence resourceCodePersistence;
1498    @BeanReference(type = ResourcePermissionPersistence.class)
1499    protected ResourcePermissionPersistence resourcePermissionPersistence;
1500    @BeanReference(type = RolePersistence.class)
1501    protected RolePersistence rolePersistence;
1502    @BeanReference(type = ServiceComponentPersistence.class)
1503    protected ServiceComponentPersistence serviceComponentPersistence;
1504    @BeanReference(type = ShardPersistence.class)
1505    protected ShardPersistence shardPersistence;
1506    @BeanReference(type = SubscriptionPersistence.class)
1507    protected SubscriptionPersistence subscriptionPersistence;
1508    @BeanReference(type = UserPersistence.class)
1509    protected UserPersistence userPersistence;
1510    @BeanReference(type = UserGroupPersistence.class)
1511    protected UserGroupPersistence userGroupPersistence;
1512    @BeanReference(type = UserGroupGroupRolePersistence.class)
1513    protected UserGroupGroupRolePersistence userGroupGroupRolePersistence;
1514    @BeanReference(type = UserGroupRolePersistence.class)
1515    protected UserGroupRolePersistence userGroupRolePersistence;
1516    @BeanReference(type = UserIdMapperPersistence.class)
1517    protected UserIdMapperPersistence userIdMapperPersistence;
1518    @BeanReference(type = UserTrackerPersistence.class)
1519    protected UserTrackerPersistence userTrackerPersistence;
1520    @BeanReference(type = UserTrackerPathPersistence.class)
1521    protected UserTrackerPathPersistence userTrackerPathPersistence;
1522    @BeanReference(type = WebDAVPropsPersistence.class)
1523    protected WebDAVPropsPersistence webDAVPropsPersistence;
1524    @BeanReference(type = WebsitePersistence.class)
1525    protected WebsitePersistence websitePersistence;
1526    private static final String _SQL_SELECT_USERTRACKER = "SELECT userTracker FROM UserTracker userTracker";
1527    private static final String _SQL_SELECT_USERTRACKER_WHERE = "SELECT userTracker FROM UserTracker userTracker WHERE ";
1528    private static final String _SQL_COUNT_USERTRACKER = "SELECT COUNT(userTracker) FROM UserTracker userTracker";
1529    private static final String _SQL_COUNT_USERTRACKER_WHERE = "SELECT COUNT(userTracker) FROM UserTracker userTracker WHERE ";
1530    private static final String _FINDER_COLUMN_COMPANYID_COMPANYID_2 = "userTracker.companyId = ?";
1531    private static final String _FINDER_COLUMN_USERID_USERID_2 = "userTracker.userId = ?";
1532    private static final String _FINDER_COLUMN_SESSIONID_SESSIONID_1 = "userTracker.sessionId IS NULL";
1533    private static final String _FINDER_COLUMN_SESSIONID_SESSIONID_2 = "userTracker.sessionId = ?";
1534    private static final String _FINDER_COLUMN_SESSIONID_SESSIONID_3 = "(userTracker.sessionId IS NULL OR userTracker.sessionId = ?)";
1535    private static final String _ORDER_BY_ENTITY_ALIAS = "userTracker.";
1536    private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No UserTracker exists with the primary key ";
1537    private static final String _NO_SUCH_ENTITY_WITH_KEY = "No UserTracker exists with the key {";
1538    private static Log _log = LogFactoryUtil.getLog(UserTrackerPersistenceImpl.class);
1539}