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