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