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