001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import com.liferay.portal.NoSuchModelException;
018    import com.liferay.portal.NoSuchUserTrackerException;
019    import com.liferay.portal.kernel.annotation.BeanReference;
020    import com.liferay.portal.kernel.cache.CacheRegistryUtil;
021    import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
022    import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
023    import com.liferay.portal.kernel.dao.orm.FinderPath;
024    import com.liferay.portal.kernel.dao.orm.Query;
025    import com.liferay.portal.kernel.dao.orm.QueryPos;
026    import com.liferay.portal.kernel.dao.orm.QueryUtil;
027    import com.liferay.portal.kernel.dao.orm.Session;
028    import com.liferay.portal.kernel.exception.SystemException;
029    import com.liferay.portal.kernel.log.Log;
030    import com.liferay.portal.kernel.log.LogFactoryUtil;
031    import com.liferay.portal.kernel.util.GetterUtil;
032    import com.liferay.portal.kernel.util.InstanceFactory;
033    import com.liferay.portal.kernel.util.OrderByComparator;
034    import com.liferay.portal.kernel.util.StringBundler;
035    import com.liferay.portal.kernel.util.StringPool;
036    import com.liferay.portal.kernel.util.StringUtil;
037    import com.liferay.portal.model.ModelListener;
038    import com.liferay.portal.model.UserTracker;
039    import com.liferay.portal.model.impl.UserTrackerImpl;
040    import com.liferay.portal.model.impl.UserTrackerModelImpl;
041    import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
042    
043    import java.io.Serializable;
044    
045    import java.util.ArrayList;
046    import java.util.Collections;
047    import java.util.List;
048    
049    /**
050     * The persistence implementation for the user tracker service.
051     *
052     * <p>
053     * Never modify or reference this class directly. Always use {@link UserTrackerUtil} to access the user tracker persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
054     * </p>
055     *
056     * <p>
057     * Caching information and settings can be found in <code>portal.properties</code>
058     * </p>
059     *
060     * @author Brian Wing Shun Chan
061     * @see UserTrackerPersistence
062     * @see UserTrackerUtil
063     * @generated
064     */
065    public class UserTrackerPersistenceImpl extends BasePersistenceImpl<UserTracker>
066            implements UserTrackerPersistence {
067            public static final String FINDER_CLASS_NAME_ENTITY = UserTrackerImpl.class.getName();
068            public static final String FINDER_CLASS_NAME_LIST = FINDER_CLASS_NAME_ENTITY +
069                    ".List";
070            public static final FinderPath FINDER_PATH_FIND_BY_COMPANYID = new FinderPath(UserTrackerModelImpl.ENTITY_CACHE_ENABLED,
071                            UserTrackerModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
072                            "findByCompanyId",
073                            new String[] {
074                                    Long.class.getName(),
075                                    
076                            "java.lang.Integer", "java.lang.Integer",
077                                    "com.liferay.portal.kernel.util.OrderByComparator"
078                            });
079            public static final FinderPath FINDER_PATH_COUNT_BY_COMPANYID = new FinderPath(UserTrackerModelImpl.ENTITY_CACHE_ENABLED,
080                            UserTrackerModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
081                            "countByCompanyId", new String[] { Long.class.getName() });
082            public static final FinderPath FINDER_PATH_FIND_BY_USERID = new FinderPath(UserTrackerModelImpl.ENTITY_CACHE_ENABLED,
083                            UserTrackerModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
084                            "findByUserId",
085                            new String[] {
086                                    Long.class.getName(),
087                                    
088                            "java.lang.Integer", "java.lang.Integer",
089                                    "com.liferay.portal.kernel.util.OrderByComparator"
090                            });
091            public static final FinderPath FINDER_PATH_COUNT_BY_USERID = new FinderPath(UserTrackerModelImpl.ENTITY_CACHE_ENABLED,
092                            UserTrackerModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
093                            "countByUserId", new String[] { Long.class.getName() });
094            public static final FinderPath FINDER_PATH_FIND_BY_SESSIONID = new FinderPath(UserTrackerModelImpl.ENTITY_CACHE_ENABLED,
095                            UserTrackerModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
096                            "findBySessionId",
097                            new String[] {
098                                    String.class.getName(),
099                                    
100                            "java.lang.Integer", "java.lang.Integer",
101                                    "com.liferay.portal.kernel.util.OrderByComparator"
102                            });
103            public static final FinderPath FINDER_PATH_COUNT_BY_SESSIONID = new FinderPath(UserTrackerModelImpl.ENTITY_CACHE_ENABLED,
104                            UserTrackerModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
105                            "countBySessionId", new String[] { String.class.getName() });
106            public static final FinderPath FINDER_PATH_FIND_ALL = new FinderPath(UserTrackerModelImpl.ENTITY_CACHE_ENABLED,
107                            UserTrackerModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
108                            "findAll", new String[0]);
109            public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(UserTrackerModelImpl.ENTITY_CACHE_ENABLED,
110                            UserTrackerModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
111                            "countAll", new String[0]);
112    
113            /**
114             * Caches the user tracker in the entity cache if it is enabled.
115             *
116             * @param userTracker the user tracker to cache
117             */
118            public void cacheResult(UserTracker userTracker) {
119                    EntityCacheUtil.putResult(UserTrackerModelImpl.ENTITY_CACHE_ENABLED,
120                            UserTrackerImpl.class, userTracker.getPrimaryKey(), userTracker);
121            }
122    
123            /**
124             * Caches the user trackers in the entity cache if it is enabled.
125             *
126             * @param userTrackers the user trackers to cache
127             */
128            public void cacheResult(List<UserTracker> userTrackers) {
129                    for (UserTracker userTracker : userTrackers) {
130                            if (EntityCacheUtil.getResult(
131                                                    UserTrackerModelImpl.ENTITY_CACHE_ENABLED,
132                                                    UserTrackerImpl.class, userTracker.getPrimaryKey(), this) == null) {
133                                    cacheResult(userTracker);
134                            }
135                    }
136            }
137    
138            /**
139             * Clears the cache for all user trackers.
140             *
141             * <p>
142             * The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method.
143             * </p>
144             */
145            public void clearCache() {
146                    CacheRegistryUtil.clear(UserTrackerImpl.class.getName());
147                    EntityCacheUtil.clearCache(UserTrackerImpl.class.getName());
148                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
149                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
150            }
151    
152            /**
153             * Clears the cache for the user tracker.
154             *
155             * <p>
156             * The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method.
157             * </p>
158             */
159            public void clearCache(UserTracker userTracker) {
160                    EntityCacheUtil.removeResult(UserTrackerModelImpl.ENTITY_CACHE_ENABLED,
161                            UserTrackerImpl.class, userTracker.getPrimaryKey());
162            }
163    
164            /**
165             * Creates a new user tracker with the primary key. Does not add the user tracker to the database.
166             *
167             * @param userTrackerId the primary key for the new user tracker
168             * @return the new user tracker
169             */
170            public UserTracker create(long userTrackerId) {
171                    UserTracker userTracker = new UserTrackerImpl();
172    
173                    userTracker.setNew(true);
174                    userTracker.setPrimaryKey(userTrackerId);
175    
176                    return userTracker;
177            }
178    
179            /**
180             * Removes the user tracker with the primary key from the database. Also notifies the appropriate model listeners.
181             *
182             * @param primaryKey the primary key of the user tracker to remove
183             * @return the user tracker that was removed
184             * @throws com.liferay.portal.NoSuchModelException if a user tracker with the primary key could not be found
185             * @throws SystemException if a system exception occurred
186             */
187            public UserTracker remove(Serializable primaryKey)
188                    throws NoSuchModelException, SystemException {
189                    return remove(((Long)primaryKey).longValue());
190            }
191    
192            /**
193             * Removes the user tracker with the primary key from the database. Also notifies the appropriate model listeners.
194             *
195             * @param userTrackerId the primary key of the user tracker to remove
196             * @return the user tracker that was removed
197             * @throws com.liferay.portal.NoSuchUserTrackerException if a user tracker with the primary key could not be found
198             * @throws SystemException if a system exception occurred
199             */
200            public UserTracker remove(long userTrackerId)
201                    throws NoSuchUserTrackerException, SystemException {
202                    Session session = null;
203    
204                    try {
205                            session = openSession();
206    
207                            UserTracker userTracker = (UserTracker)session.get(UserTrackerImpl.class,
208                                            new Long(userTrackerId));
209    
210                            if (userTracker == null) {
211                                    if (_log.isWarnEnabled()) {
212                                            _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + userTrackerId);
213                                    }
214    
215                                    throw new NoSuchUserTrackerException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
216                                            userTrackerId);
217                            }
218    
219                            return remove(userTracker);
220                    }
221                    catch (NoSuchUserTrackerException nsee) {
222                            throw nsee;
223                    }
224                    catch (Exception e) {
225                            throw processException(e);
226                    }
227                    finally {
228                            closeSession(session);
229                    }
230            }
231    
232            protected UserTracker removeImpl(UserTracker userTracker)
233                    throws SystemException {
234                    userTracker = toUnwrappedModel(userTracker);
235    
236                    Session session = null;
237    
238                    try {
239                            session = openSession();
240    
241                            if (userTracker.isCachedModel() || BatchSessionUtil.isEnabled()) {
242                                    Object staleObject = session.get(UserTrackerImpl.class,
243                                                    userTracker.getPrimaryKeyObj());
244    
245                                    if (staleObject != null) {
246                                            session.evict(staleObject);
247                                    }
248                            }
249    
250                            session.delete(userTracker);
251    
252                            session.flush();
253                    }
254                    catch (Exception e) {
255                            throw processException(e);
256                    }
257                    finally {
258                            closeSession(session);
259                    }
260    
261                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
262    
263                    EntityCacheUtil.removeResult(UserTrackerModelImpl.ENTITY_CACHE_ENABLED,
264                            UserTrackerImpl.class, userTracker.getPrimaryKey());
265    
266                    return userTracker;
267            }
268    
269            public UserTracker updateImpl(
270                    com.liferay.portal.model.UserTracker userTracker, boolean merge)
271                    throws SystemException {
272                    userTracker = toUnwrappedModel(userTracker);
273    
274                    Session session = null;
275    
276                    try {
277                            session = openSession();
278    
279                            BatchSessionUtil.update(session, userTracker, merge);
280    
281                            userTracker.setNew(false);
282                    }
283                    catch (Exception e) {
284                            throw processException(e);
285                    }
286                    finally {
287                            closeSession(session);
288                    }
289    
290                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
291    
292                    EntityCacheUtil.putResult(UserTrackerModelImpl.ENTITY_CACHE_ENABLED,
293                            UserTrackerImpl.class, userTracker.getPrimaryKey(), userTracker);
294    
295                    return userTracker;
296            }
297    
298            protected UserTracker toUnwrappedModel(UserTracker userTracker) {
299                    if (userTracker instanceof UserTrackerImpl) {
300                            return userTracker;
301                    }
302    
303                    UserTrackerImpl userTrackerImpl = new UserTrackerImpl();
304    
305                    userTrackerImpl.setNew(userTracker.isNew());
306                    userTrackerImpl.setPrimaryKey(userTracker.getPrimaryKey());
307    
308                    userTrackerImpl.setUserTrackerId(userTracker.getUserTrackerId());
309                    userTrackerImpl.setCompanyId(userTracker.getCompanyId());
310                    userTrackerImpl.setUserId(userTracker.getUserId());
311                    userTrackerImpl.setModifiedDate(userTracker.getModifiedDate());
312                    userTrackerImpl.setSessionId(userTracker.getSessionId());
313                    userTrackerImpl.setRemoteAddr(userTracker.getRemoteAddr());
314                    userTrackerImpl.setRemoteHost(userTracker.getRemoteHost());
315                    userTrackerImpl.setUserAgent(userTracker.getUserAgent());
316    
317                    return userTrackerImpl;
318            }
319    
320            /**
321             * Finds the user tracker with the primary key or throws a {@link com.liferay.portal.NoSuchModelException} if it could not be found.
322             *
323             * @param primaryKey the primary key of the user tracker to find
324             * @return the user tracker
325             * @throws com.liferay.portal.NoSuchModelException if a user tracker with the primary key could not be found
326             * @throws SystemException if a system exception occurred
327             */
328            public UserTracker findByPrimaryKey(Serializable primaryKey)
329                    throws NoSuchModelException, SystemException {
330                    return findByPrimaryKey(((Long)primaryKey).longValue());
331            }
332    
333            /**
334             * Finds the user tracker with the primary key or throws a {@link com.liferay.portal.NoSuchUserTrackerException} if it could not be found.
335             *
336             * @param userTrackerId the primary key of the user tracker to find
337             * @return the user tracker
338             * @throws com.liferay.portal.NoSuchUserTrackerException if a user tracker with the primary key could not be found
339             * @throws SystemException if a system exception occurred
340             */
341            public UserTracker findByPrimaryKey(long userTrackerId)
342                    throws NoSuchUserTrackerException, SystemException {
343                    UserTracker userTracker = fetchByPrimaryKey(userTrackerId);
344    
345                    if (userTracker == null) {
346                            if (_log.isWarnEnabled()) {
347                                    _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + userTrackerId);
348                            }
349    
350                            throw new NoSuchUserTrackerException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
351                                    userTrackerId);
352                    }
353    
354                    return userTracker;
355            }
356    
357            /**
358             * Finds the user tracker with the primary key or returns <code>null</code> if it could not be found.
359             *
360             * @param primaryKey the primary key of the user tracker to find
361             * @return the user tracker, or <code>null</code> if a user tracker with the primary key could not be found
362             * @throws SystemException if a system exception occurred
363             */
364            public UserTracker fetchByPrimaryKey(Serializable primaryKey)
365                    throws SystemException {
366                    return fetchByPrimaryKey(((Long)primaryKey).longValue());
367            }
368    
369            /**
370             * Finds the user tracker with the primary key or returns <code>null</code> if it could not be found.
371             *
372             * @param userTrackerId the primary key of the user tracker to find
373             * @return the user tracker, or <code>null</code> if a user tracker with the primary key could not be found
374             * @throws SystemException if a system exception occurred
375             */
376            public UserTracker fetchByPrimaryKey(long userTrackerId)
377                    throws SystemException {
378                    UserTracker userTracker = (UserTracker)EntityCacheUtil.getResult(UserTrackerModelImpl.ENTITY_CACHE_ENABLED,
379                                    UserTrackerImpl.class, userTrackerId, this);
380    
381                    if (userTracker == null) {
382                            Session session = null;
383    
384                            try {
385                                    session = openSession();
386    
387                                    userTracker = (UserTracker)session.get(UserTrackerImpl.class,
388                                                    new Long(userTrackerId));
389                            }
390                            catch (Exception e) {
391                                    throw processException(e);
392                            }
393                            finally {
394                                    if (userTracker != null) {
395                                            cacheResult(userTracker);
396                                    }
397    
398                                    closeSession(session);
399                            }
400                    }
401    
402                    return userTracker;
403            }
404    
405            /**
406             * Finds all the user trackers where companyId = &#63;.
407             *
408             * @param companyId the company id to search with
409             * @return the matching user trackers
410             * @throws SystemException if a system exception occurred
411             */
412            public List<UserTracker> findByCompanyId(long companyId)
413                    throws SystemException {
414                    return findByCompanyId(companyId, QueryUtil.ALL_POS, QueryUtil.ALL_POS,
415                            null);
416            }
417    
418            /**
419             * Finds a range of all the user trackers where companyId = &#63;.
420             *
421             * <p>
422             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
423             * </p>
424             *
425             * @param companyId the company id to search with
426             * @param start the lower bound of the range of user trackers to return
427             * @param end the upper bound of the range of user trackers to return (not inclusive)
428             * @return the range of matching user trackers
429             * @throws SystemException if a system exception occurred
430             */
431            public List<UserTracker> findByCompanyId(long companyId, int start, int end)
432                    throws SystemException {
433                    return findByCompanyId(companyId, start, end, null);
434            }
435    
436            /**
437             * Finds an ordered range of all the user trackers where companyId = &#63;.
438             *
439             * <p>
440             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
441             * </p>
442             *
443             * @param companyId the company id to search with
444             * @param start the lower bound of the range of user trackers to return
445             * @param end the upper bound of the range of user trackers to return (not inclusive)
446             * @param orderByComparator the comparator to order the results by
447             * @return the ordered range of matching user trackers
448             * @throws SystemException if a system exception occurred
449             */
450            public List<UserTracker> findByCompanyId(long companyId, int start,
451                    int end, OrderByComparator orderByComparator) throws SystemException {
452                    Object[] finderArgs = new Object[] {
453                                    companyId,
454                                    
455                                    String.valueOf(start), String.valueOf(end),
456                                    String.valueOf(orderByComparator)
457                            };
458    
459                    List<UserTracker> list = (List<UserTracker>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_COMPANYID,
460                                    finderArgs, this);
461    
462                    if (list == null) {
463                            Session session = null;
464    
465                            try {
466                                    session = openSession();
467    
468                                    StringBundler query = null;
469    
470                                    if (orderByComparator != null) {
471                                            query = new StringBundler(3 +
472                                                            (orderByComparator.getOrderByFields().length * 3));
473                                    }
474                                    else {
475                                            query = new StringBundler(2);
476                                    }
477    
478                                    query.append(_SQL_SELECT_USERTRACKER_WHERE);
479    
480                                    query.append(_FINDER_COLUMN_COMPANYID_COMPANYID_2);
481    
482                                    if (orderByComparator != null) {
483                                            appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
484                                                    orderByComparator);
485                                    }
486    
487                                    String sql = query.toString();
488    
489                                    Query q = session.createQuery(sql);
490    
491                                    QueryPos qPos = QueryPos.getInstance(q);
492    
493                                    qPos.add(companyId);
494    
495                                    list = (List<UserTracker>)QueryUtil.list(q, getDialect(),
496                                                    start, end);
497                            }
498                            catch (Exception e) {
499                                    throw processException(e);
500                            }
501                            finally {
502                                    if (list == null) {
503                                            list = new ArrayList<UserTracker>();
504                                    }
505    
506                                    cacheResult(list);
507    
508                                    FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_COMPANYID,
509                                            finderArgs, list);
510    
511                                    closeSession(session);
512                            }
513                    }
514    
515                    return list;
516            }
517    
518            /**
519             * Finds the first user tracker in the ordered set where companyId = &#63;.
520             *
521             * <p>
522             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
523             * </p>
524             *
525             * @param companyId the company id to search with
526             * @param orderByComparator the comparator to order the set by
527             * @return the first matching user tracker
528             * @throws com.liferay.portal.NoSuchUserTrackerException if a matching user tracker could not be found
529             * @throws SystemException if a system exception occurred
530             */
531            public UserTracker findByCompanyId_First(long companyId,
532                    OrderByComparator orderByComparator)
533                    throws NoSuchUserTrackerException, SystemException {
534                    List<UserTracker> list = findByCompanyId(companyId, 0, 1,
535                                    orderByComparator);
536    
537                    if (list.isEmpty()) {
538                            StringBundler msg = new StringBundler(4);
539    
540                            msg.append(_NO_SUCH_ENTITY_WITH_KEY);
541    
542                            msg.append("companyId=");
543                            msg.append(companyId);
544    
545                            msg.append(StringPool.CLOSE_CURLY_BRACE);
546    
547                            throw new NoSuchUserTrackerException(msg.toString());
548                    }
549                    else {
550                            return list.get(0);
551                    }
552            }
553    
554            /**
555             * Finds the last user tracker in the ordered set where companyId = &#63;.
556             *
557             * <p>
558             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
559             * </p>
560             *
561             * @param companyId the company id to search with
562             * @param orderByComparator the comparator to order the set by
563             * @return the last matching user tracker
564             * @throws com.liferay.portal.NoSuchUserTrackerException if a matching user tracker could not be found
565             * @throws SystemException if a system exception occurred
566             */
567            public UserTracker findByCompanyId_Last(long companyId,
568                    OrderByComparator orderByComparator)
569                    throws NoSuchUserTrackerException, SystemException {
570                    int count = countByCompanyId(companyId);
571    
572                    List<UserTracker> list = findByCompanyId(companyId, count - 1, count,
573                                    orderByComparator);
574    
575                    if (list.isEmpty()) {
576                            StringBundler msg = new StringBundler(4);
577    
578                            msg.append(_NO_SUCH_ENTITY_WITH_KEY);
579    
580                            msg.append("companyId=");
581                            msg.append(companyId);
582    
583                            msg.append(StringPool.CLOSE_CURLY_BRACE);
584    
585                            throw new NoSuchUserTrackerException(msg.toString());
586                    }
587                    else {
588                            return list.get(0);
589                    }
590            }
591    
592            /**
593             * Finds the user trackers before and after the current user tracker in the ordered set where companyId = &#63;.
594             *
595             * <p>
596             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
597             * </p>
598             *
599             * @param userTrackerId the primary key of the current user tracker
600             * @param companyId the company id to search with
601             * @param orderByComparator the comparator to order the set by
602             * @return the previous, current, and next user tracker
603             * @throws com.liferay.portal.NoSuchUserTrackerException if a user tracker with the primary key could not be found
604             * @throws SystemException if a system exception occurred
605             */
606            public UserTracker[] findByCompanyId_PrevAndNext(long userTrackerId,
607                    long companyId, OrderByComparator orderByComparator)
608                    throws NoSuchUserTrackerException, SystemException {
609                    UserTracker userTracker = findByPrimaryKey(userTrackerId);
610    
611                    Session session = null;
612    
613                    try {
614                            session = openSession();
615    
616                            UserTracker[] array = new UserTrackerImpl[3];
617    
618                            array[0] = getByCompanyId_PrevAndNext(session, userTracker,
619                                            companyId, orderByComparator, true);
620    
621                            array[1] = userTracker;
622    
623                            array[2] = getByCompanyId_PrevAndNext(session, userTracker,
624                                            companyId, orderByComparator, false);
625    
626                            return array;
627                    }
628                    catch (Exception e) {
629                            throw processException(e);
630                    }
631                    finally {
632                            closeSession(session);
633                    }
634            }
635    
636            protected UserTracker getByCompanyId_PrevAndNext(Session session,
637                    UserTracker userTracker, long companyId,
638                    OrderByComparator orderByComparator, boolean previous) {
639                    StringBundler query = null;
640    
641                    if (orderByComparator != null) {
642                            query = new StringBundler(6 +
643                                            (orderByComparator.getOrderByFields().length * 6));
644                    }
645                    else {
646                            query = new StringBundler(3);
647                    }
648    
649                    query.append(_SQL_SELECT_USERTRACKER_WHERE);
650    
651                    query.append(_FINDER_COLUMN_COMPANYID_COMPANYID_2);
652    
653                    if (orderByComparator != null) {
654                            String[] orderByFields = orderByComparator.getOrderByFields();
655    
656                            if (orderByFields.length > 0) {
657                                    query.append(WHERE_AND);
658                            }
659    
660                            for (int i = 0; i < orderByFields.length; i++) {
661                                    query.append(_ORDER_BY_ENTITY_ALIAS);
662                                    query.append(orderByFields[i]);
663    
664                                    if ((i + 1) < orderByFields.length) {
665                                            if (orderByComparator.isAscending() ^ previous) {
666                                                    query.append(WHERE_GREATER_THAN_HAS_NEXT);
667                                            }
668                                            else {
669                                                    query.append(WHERE_LESSER_THAN_HAS_NEXT);
670                                            }
671                                    }
672                                    else {
673                                            if (orderByComparator.isAscending() ^ previous) {
674                                                    query.append(WHERE_GREATER_THAN);
675                                            }
676                                            else {
677                                                    query.append(WHERE_LESSER_THAN);
678                                            }
679                                    }
680                            }
681    
682                            query.append(ORDER_BY_CLAUSE);
683    
684                            for (int i = 0; i < orderByFields.length; i++) {
685                                    query.append(_ORDER_BY_ENTITY_ALIAS);
686                                    query.append(orderByFields[i]);
687    
688                                    if ((i + 1) < orderByFields.length) {
689                                            if (orderByComparator.isAscending() ^ previous) {
690                                                    query.append(ORDER_BY_ASC_HAS_NEXT);
691                                            }
692                                            else {
693                                                    query.append(ORDER_BY_DESC_HAS_NEXT);
694                                            }
695                                    }
696                                    else {
697                                            if (orderByComparator.isAscending() ^ previous) {
698                                                    query.append(ORDER_BY_ASC);
699                                            }
700                                            else {
701                                                    query.append(ORDER_BY_DESC);
702                                            }
703                                    }
704                            }
705                    }
706    
707                    String sql = query.toString();
708    
709                    Query q = session.createQuery(sql);
710    
711                    q.setFirstResult(0);
712                    q.setMaxResults(2);
713    
714                    QueryPos qPos = QueryPos.getInstance(q);
715    
716                    qPos.add(companyId);
717    
718                    if (orderByComparator != null) {
719                            Object[] values = orderByComparator.getOrderByValues(userTracker);
720    
721                            for (Object value : values) {
722                                    qPos.add(value);
723                            }
724                    }
725    
726                    List<UserTracker> list = q.list();
727    
728                    if (list.size() == 2) {
729                            return list.get(1);
730                    }
731                    else {
732                            return null;
733                    }
734            }
735    
736            /**
737             * Finds all the user trackers where userId = &#63;.
738             *
739             * @param userId the user id to search with
740             * @return the matching user trackers
741             * @throws SystemException if a system exception occurred
742             */
743            public List<UserTracker> findByUserId(long userId)
744                    throws SystemException {
745                    return findByUserId(userId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
746            }
747    
748            /**
749             * Finds a range of all the user trackers where userId = &#63;.
750             *
751             * <p>
752             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
753             * </p>
754             *
755             * @param userId the user id to search with
756             * @param start the lower bound of the range of user trackers to return
757             * @param end the upper bound of the range of user trackers to return (not inclusive)
758             * @return the range of matching user trackers
759             * @throws SystemException if a system exception occurred
760             */
761            public List<UserTracker> findByUserId(long userId, int start, int end)
762                    throws SystemException {
763                    return findByUserId(userId, start, end, null);
764            }
765    
766            /**
767             * Finds an ordered range of all the user trackers where userId = &#63;.
768             *
769             * <p>
770             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
771             * </p>
772             *
773             * @param userId the user id to search with
774             * @param start the lower bound of the range of user trackers to return
775             * @param end the upper bound of the range of user trackers to return (not inclusive)
776             * @param orderByComparator the comparator to order the results by
777             * @return the ordered range of matching user trackers
778             * @throws SystemException if a system exception occurred
779             */
780            public List<UserTracker> findByUserId(long userId, int start, int end,
781                    OrderByComparator orderByComparator) throws SystemException {
782                    Object[] finderArgs = new Object[] {
783                                    userId,
784                                    
785                                    String.valueOf(start), String.valueOf(end),
786                                    String.valueOf(orderByComparator)
787                            };
788    
789                    List<UserTracker> list = (List<UserTracker>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_USERID,
790                                    finderArgs, this);
791    
792                    if (list == null) {
793                            Session session = null;
794    
795                            try {
796                                    session = openSession();
797    
798                                    StringBundler query = null;
799    
800                                    if (orderByComparator != null) {
801                                            query = new StringBundler(3 +
802                                                            (orderByComparator.getOrderByFields().length * 3));
803                                    }
804                                    else {
805                                            query = new StringBundler(2);
806                                    }
807    
808                                    query.append(_SQL_SELECT_USERTRACKER_WHERE);
809    
810                                    query.append(_FINDER_COLUMN_USERID_USERID_2);
811    
812                                    if (orderByComparator != null) {
813                                            appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
814                                                    orderByComparator);
815                                    }
816    
817                                    String sql = query.toString();
818    
819                                    Query q = session.createQuery(sql);
820    
821                                    QueryPos qPos = QueryPos.getInstance(q);
822    
823                                    qPos.add(userId);
824    
825                                    list = (List<UserTracker>)QueryUtil.list(q, getDialect(),
826                                                    start, end);
827                            }
828                            catch (Exception e) {
829                                    throw processException(e);
830                            }
831                            finally {
832                                    if (list == null) {
833                                            list = new ArrayList<UserTracker>();
834                                    }
835    
836                                    cacheResult(list);
837    
838                                    FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_USERID,
839                                            finderArgs, list);
840    
841                                    closeSession(session);
842                            }
843                    }
844    
845                    return list;
846            }
847    
848            /**
849             * Finds the first user tracker in the ordered set where userId = &#63;.
850             *
851             * <p>
852             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
853             * </p>
854             *
855             * @param userId the user id to search with
856             * @param orderByComparator the comparator to order the set by
857             * @return the first matching user tracker
858             * @throws com.liferay.portal.NoSuchUserTrackerException if a matching user tracker could not be found
859             * @throws SystemException if a system exception occurred
860             */
861            public UserTracker findByUserId_First(long userId,
862                    OrderByComparator orderByComparator)
863                    throws NoSuchUserTrackerException, SystemException {
864                    List<UserTracker> list = findByUserId(userId, 0, 1, orderByComparator);
865    
866                    if (list.isEmpty()) {
867                            StringBundler msg = new StringBundler(4);
868    
869                            msg.append(_NO_SUCH_ENTITY_WITH_KEY);
870    
871                            msg.append("userId=");
872                            msg.append(userId);
873    
874                            msg.append(StringPool.CLOSE_CURLY_BRACE);
875    
876                            throw new NoSuchUserTrackerException(msg.toString());
877                    }
878                    else {
879                            return list.get(0);
880                    }
881            }
882    
883            /**
884             * Finds the last user tracker in the ordered set where userId = &#63;.
885             *
886             * <p>
887             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
888             * </p>
889             *
890             * @param userId the user id to search with
891             * @param orderByComparator the comparator to order the set by
892             * @return the last matching user tracker
893             * @throws com.liferay.portal.NoSuchUserTrackerException if a matching user tracker could not be found
894             * @throws SystemException if a system exception occurred
895             */
896            public UserTracker findByUserId_Last(long userId,
897                    OrderByComparator orderByComparator)
898                    throws NoSuchUserTrackerException, SystemException {
899                    int count = countByUserId(userId);
900    
901                    List<UserTracker> list = findByUserId(userId, count - 1, count,
902                                    orderByComparator);
903    
904                    if (list.isEmpty()) {
905                            StringBundler msg = new StringBundler(4);
906    
907                            msg.append(_NO_SUCH_ENTITY_WITH_KEY);
908    
909                            msg.append("userId=");
910                            msg.append(userId);
911    
912                            msg.append(StringPool.CLOSE_CURLY_BRACE);
913    
914                            throw new NoSuchUserTrackerException(msg.toString());
915                    }
916                    else {
917                            return list.get(0);
918                    }
919            }
920    
921            /**
922             * Finds the user trackers before and after the current user tracker in the ordered set where userId = &#63;.
923             *
924             * <p>
925             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
926             * </p>
927             *
928             * @param userTrackerId the primary key of the current user tracker
929             * @param userId the user id to search with
930             * @param orderByComparator the comparator to order the set by
931             * @return the previous, current, and next user tracker
932             * @throws com.liferay.portal.NoSuchUserTrackerException if a user tracker with the primary key could not be found
933             * @throws SystemException if a system exception occurred
934             */
935            public UserTracker[] findByUserId_PrevAndNext(long userTrackerId,
936                    long userId, OrderByComparator orderByComparator)
937                    throws NoSuchUserTrackerException, SystemException {
938                    UserTracker userTracker = findByPrimaryKey(userTrackerId);
939    
940                    Session session = null;
941    
942                    try {
943                            session = openSession();
944    
945                            UserTracker[] array = new UserTrackerImpl[3];
946    
947                            array[0] = getByUserId_PrevAndNext(session, userTracker, userId,
948                                            orderByComparator, true);
949    
950                            array[1] = userTracker;
951    
952                            array[2] = getByUserId_PrevAndNext(session, userTracker, userId,
953                                            orderByComparator, false);
954    
955                            return array;
956                    }
957                    catch (Exception e) {
958                            throw processException(e);
959                    }
960                    finally {
961                            closeSession(session);
962                    }
963            }
964    
965            protected UserTracker getByUserId_PrevAndNext(Session session,
966                    UserTracker userTracker, long userId,
967                    OrderByComparator orderByComparator, boolean previous) {
968                    StringBundler query = null;
969    
970                    if (orderByComparator != null) {
971                            query = new StringBundler(6 +
972                                            (orderByComparator.getOrderByFields().length * 6));
973                    }
974                    else {
975                            query = new StringBundler(3);
976                    }
977    
978                    query.append(_SQL_SELECT_USERTRACKER_WHERE);
979    
980                    query.append(_FINDER_COLUMN_USERID_USERID_2);
981    
982                    if (orderByComparator != null) {
983                            String[] orderByFields = orderByComparator.getOrderByFields();
984    
985                            if (orderByFields.length > 0) {
986                                    query.append(WHERE_AND);
987                            }
988    
989                            for (int i = 0; i < orderByFields.length; i++) {
990                                    query.append(_ORDER_BY_ENTITY_ALIAS);
991                                    query.append(orderByFields[i]);
992    
993                                    if ((i + 1) < orderByFields.length) {
994                                            if (orderByComparator.isAscending() ^ previous) {
995                                                    query.append(WHERE_GREATER_THAN_HAS_NEXT);
996                                            }
997                                            else {
998                                                    query.append(WHERE_LESSER_THAN_HAS_NEXT);
999                                            }
1000                                    }
1001                                    else {
1002                                            if (orderByComparator.isAscending() ^ previous) {
1003                                                    query.append(WHERE_GREATER_THAN);
1004                                            }
1005                                            else {
1006                                                    query.append(WHERE_LESSER_THAN);
1007                                            }
1008                                    }
1009                            }
1010    
1011                            query.append(ORDER_BY_CLAUSE);
1012    
1013                            for (int i = 0; i < orderByFields.length; i++) {
1014                                    query.append(_ORDER_BY_ENTITY_ALIAS);
1015                                    query.append(orderByFields[i]);
1016    
1017                                    if ((i + 1) < orderByFields.length) {
1018                                            if (orderByComparator.isAscending() ^ previous) {
1019                                                    query.append(ORDER_BY_ASC_HAS_NEXT);
1020                                            }
1021                                            else {
1022                                                    query.append(ORDER_BY_DESC_HAS_NEXT);
1023                                            }
1024                                    }
1025                                    else {
1026                                            if (orderByComparator.isAscending() ^ previous) {
1027                                                    query.append(ORDER_BY_ASC);
1028                                            }
1029                                            else {
1030                                                    query.append(ORDER_BY_DESC);
1031                                            }
1032                                    }
1033                            }
1034                    }
1035    
1036                    String sql = query.toString();
1037    
1038                    Query q = session.createQuery(sql);
1039    
1040                    q.setFirstResult(0);
1041                    q.setMaxResults(2);
1042    
1043                    QueryPos qPos = QueryPos.getInstance(q);
1044    
1045                    qPos.add(userId);
1046    
1047                    if (orderByComparator != null) {
1048                            Object[] values = orderByComparator.getOrderByValues(userTracker);
1049    
1050                            for (Object value : values) {
1051                                    qPos.add(value);
1052                            }
1053                    }
1054    
1055                    List<UserTracker> list = q.list();
1056    
1057                    if (list.size() == 2) {
1058                            return list.get(1);
1059                    }
1060                    else {
1061                            return null;
1062                    }
1063            }
1064    
1065            /**
1066             * Finds all the user trackers where sessionId = &#63;.
1067             *
1068             * @param sessionId the session id to search with
1069             * @return the matching user trackers
1070             * @throws SystemException if a system exception occurred
1071             */
1072            public List<UserTracker> findBySessionId(String sessionId)
1073                    throws SystemException {
1074                    return findBySessionId(sessionId, QueryUtil.ALL_POS, QueryUtil.ALL_POS,
1075                            null);
1076            }
1077    
1078            /**
1079             * Finds a range of all the user trackers where sessionId = &#63;.
1080             *
1081             * <p>
1082             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
1083             * </p>
1084             *
1085             * @param sessionId the session id to search with
1086             * @param start the lower bound of the range of user trackers to return
1087             * @param end the upper bound of the range of user trackers to return (not inclusive)
1088             * @return the range of matching user trackers
1089             * @throws SystemException if a system exception occurred
1090             */
1091            public List<UserTracker> findBySessionId(String sessionId, int start,
1092                    int end) throws SystemException {
1093                    return findBySessionId(sessionId, start, end, null);
1094            }
1095    
1096            /**
1097             * Finds an ordered range of all the user trackers where sessionId = &#63;.
1098             *
1099             * <p>
1100             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
1101             * </p>
1102             *
1103             * @param sessionId the session id to search with
1104             * @param start the lower bound of the range of user trackers to return
1105             * @param end the upper bound of the range of user trackers to return (not inclusive)
1106             * @param orderByComparator the comparator to order the results by
1107             * @return the ordered range of matching user trackers
1108             * @throws SystemException if a system exception occurred
1109             */
1110            public List<UserTracker> findBySessionId(String sessionId, int start,
1111                    int end, OrderByComparator orderByComparator) throws SystemException {
1112                    Object[] finderArgs = new Object[] {
1113                                    sessionId,
1114                                    
1115                                    String.valueOf(start), String.valueOf(end),
1116                                    String.valueOf(orderByComparator)
1117                            };
1118    
1119                    List<UserTracker> list = (List<UserTracker>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_SESSIONID,
1120                                    finderArgs, this);
1121    
1122                    if (list == null) {
1123                            Session session = null;
1124    
1125                            try {
1126                                    session = openSession();
1127    
1128                                    StringBundler query = null;
1129    
1130                                    if (orderByComparator != null) {
1131                                            query = new StringBundler(3 +
1132                                                            (orderByComparator.getOrderByFields().length * 3));
1133                                    }
1134                                    else {
1135                                            query = new StringBundler(2);
1136                                    }
1137    
1138                                    query.append(_SQL_SELECT_USERTRACKER_WHERE);
1139    
1140                                    if (sessionId == null) {
1141                                            query.append(_FINDER_COLUMN_SESSIONID_SESSIONID_1);
1142                                    }
1143                                    else {
1144                                            if (sessionId.equals(StringPool.BLANK)) {
1145                                                    query.append(_FINDER_COLUMN_SESSIONID_SESSIONID_3);
1146                                            }
1147                                            else {
1148                                                    query.append(_FINDER_COLUMN_SESSIONID_SESSIONID_2);
1149                                            }
1150                                    }
1151    
1152                                    if (orderByComparator != null) {
1153                                            appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
1154                                                    orderByComparator);
1155                                    }
1156    
1157                                    String sql = query.toString();
1158    
1159                                    Query q = session.createQuery(sql);
1160    
1161                                    QueryPos qPos = QueryPos.getInstance(q);
1162    
1163                                    if (sessionId != null) {
1164                                            qPos.add(sessionId);
1165                                    }
1166    
1167                                    list = (List<UserTracker>)QueryUtil.list(q, getDialect(),
1168                                                    start, end);
1169                            }
1170                            catch (Exception e) {
1171                                    throw processException(e);
1172                            }
1173                            finally {
1174                                    if (list == null) {
1175                                            list = new ArrayList<UserTracker>();
1176                                    }
1177    
1178                                    cacheResult(list);
1179    
1180                                    FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_SESSIONID,
1181                                            finderArgs, list);
1182    
1183                                    closeSession(session);
1184                            }
1185                    }
1186    
1187                    return list;
1188            }
1189    
1190            /**
1191             * Finds the first user tracker in the ordered set where sessionId = &#63;.
1192             *
1193             * <p>
1194             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
1195             * </p>
1196             *
1197             * @param sessionId the session id to search with
1198             * @param orderByComparator the comparator to order the set by
1199             * @return the first matching user tracker
1200             * @throws com.liferay.portal.NoSuchUserTrackerException if a matching user tracker could not be found
1201             * @throws SystemException if a system exception occurred
1202             */
1203            public UserTracker findBySessionId_First(String sessionId,
1204                    OrderByComparator orderByComparator)
1205                    throws NoSuchUserTrackerException, SystemException {
1206                    List<UserTracker> list = findBySessionId(sessionId, 0, 1,
1207                                    orderByComparator);
1208    
1209                    if (list.isEmpty()) {
1210                            StringBundler msg = new StringBundler(4);
1211    
1212                            msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1213    
1214                            msg.append("sessionId=");
1215                            msg.append(sessionId);
1216    
1217                            msg.append(StringPool.CLOSE_CURLY_BRACE);
1218    
1219                            throw new NoSuchUserTrackerException(msg.toString());
1220                    }
1221                    else {
1222                            return list.get(0);
1223                    }
1224            }
1225    
1226            /**
1227             * Finds the last user tracker in the ordered set where sessionId = &#63;.
1228             *
1229             * <p>
1230             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
1231             * </p>
1232             *
1233             * @param sessionId the session id to search with
1234             * @param orderByComparator the comparator to order the set by
1235             * @return the last matching user tracker
1236             * @throws com.liferay.portal.NoSuchUserTrackerException if a matching user tracker could not be found
1237             * @throws SystemException if a system exception occurred
1238             */
1239            public UserTracker findBySessionId_Last(String sessionId,
1240                    OrderByComparator orderByComparator)
1241                    throws NoSuchUserTrackerException, SystemException {
1242                    int count = countBySessionId(sessionId);
1243    
1244                    List<UserTracker> list = findBySessionId(sessionId, count - 1, count,
1245                                    orderByComparator);
1246    
1247                    if (list.isEmpty()) {
1248                            StringBundler msg = new StringBundler(4);
1249    
1250                            msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1251    
1252                            msg.append("sessionId=");
1253                            msg.append(sessionId);
1254    
1255                            msg.append(StringPool.CLOSE_CURLY_BRACE);
1256    
1257                            throw new NoSuchUserTrackerException(msg.toString());
1258                    }
1259                    else {
1260                            return list.get(0);
1261                    }
1262            }
1263    
1264            /**
1265             * Finds the user trackers before and after the current user tracker in the ordered set where sessionId = &#63;.
1266             *
1267             * <p>
1268             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
1269             * </p>
1270             *
1271             * @param userTrackerId the primary key of the current user tracker
1272             * @param sessionId the session id to search with
1273             * @param orderByComparator the comparator to order the set by
1274             * @return the previous, current, and next user tracker
1275             * @throws com.liferay.portal.NoSuchUserTrackerException if a user tracker with the primary key could not be found
1276             * @throws SystemException if a system exception occurred
1277             */
1278            public UserTracker[] findBySessionId_PrevAndNext(long userTrackerId,
1279                    String sessionId, OrderByComparator orderByComparator)
1280                    throws NoSuchUserTrackerException, SystemException {
1281                    UserTracker userTracker = findByPrimaryKey(userTrackerId);
1282    
1283                    Session session = null;
1284    
1285                    try {
1286                            session = openSession();
1287    
1288                            UserTracker[] array = new UserTrackerImpl[3];
1289    
1290                            array[0] = getBySessionId_PrevAndNext(session, userTracker,
1291                                            sessionId, orderByComparator, true);
1292    
1293                            array[1] = userTracker;
1294    
1295                            array[2] = getBySessionId_PrevAndNext(session, userTracker,
1296                                            sessionId, orderByComparator, false);
1297    
1298                            return array;
1299                    }
1300                    catch (Exception e) {
1301                            throw processException(e);
1302                    }
1303                    finally {
1304                            closeSession(session);
1305                    }
1306            }
1307    
1308            protected UserTracker getBySessionId_PrevAndNext(Session session,
1309                    UserTracker userTracker, String sessionId,
1310                    OrderByComparator orderByComparator, boolean previous) {
1311                    StringBundler query = null;
1312    
1313                    if (orderByComparator != null) {
1314                            query = new StringBundler(6 +
1315                                            (orderByComparator.getOrderByFields().length * 6));
1316                    }
1317                    else {
1318                            query = new StringBundler(3);
1319                    }
1320    
1321                    query.append(_SQL_SELECT_USERTRACKER_WHERE);
1322    
1323                    if (sessionId == null) {
1324                            query.append(_FINDER_COLUMN_SESSIONID_SESSIONID_1);
1325                    }
1326                    else {
1327                            if (sessionId.equals(StringPool.BLANK)) {
1328                                    query.append(_FINDER_COLUMN_SESSIONID_SESSIONID_3);
1329                            }
1330                            else {
1331                                    query.append(_FINDER_COLUMN_SESSIONID_SESSIONID_2);
1332                            }
1333                    }
1334    
1335                    if (orderByComparator != null) {
1336                            String[] orderByFields = orderByComparator.getOrderByFields();
1337    
1338                            if (orderByFields.length > 0) {
1339                                    query.append(WHERE_AND);
1340                            }
1341    
1342                            for (int i = 0; i < orderByFields.length; i++) {
1343                                    query.append(_ORDER_BY_ENTITY_ALIAS);
1344                                    query.append(orderByFields[i]);
1345    
1346                                    if ((i + 1) < orderByFields.length) {
1347                                            if (orderByComparator.isAscending() ^ previous) {
1348                                                    query.append(WHERE_GREATER_THAN_HAS_NEXT);
1349                                            }
1350                                            else {
1351                                                    query.append(WHERE_LESSER_THAN_HAS_NEXT);
1352                                            }
1353                                    }
1354                                    else {
1355                                            if (orderByComparator.isAscending() ^ previous) {
1356                                                    query.append(WHERE_GREATER_THAN);
1357                                            }
1358                                            else {
1359                                                    query.append(WHERE_LESSER_THAN);
1360                                            }
1361                                    }
1362                            }
1363    
1364                            query.append(ORDER_BY_CLAUSE);
1365    
1366                            for (int i = 0; i < orderByFields.length; i++) {
1367                                    query.append(_ORDER_BY_ENTITY_ALIAS);
1368                                    query.append(orderByFields[i]);
1369    
1370                                    if ((i + 1) < orderByFields.length) {
1371                                            if (orderByComparator.isAscending() ^ previous) {
1372                                                    query.append(ORDER_BY_ASC_HAS_NEXT);
1373                                            }
1374                                            else {
1375                                                    query.append(ORDER_BY_DESC_HAS_NEXT);
1376                                            }
1377                                    }
1378                                    else {
1379                                            if (orderByComparator.isAscending() ^ previous) {
1380                                                    query.append(ORDER_BY_ASC);
1381                                            }
1382                                            else {
1383                                                    query.append(ORDER_BY_DESC);
1384                                            }
1385                                    }
1386                            }
1387                    }
1388    
1389                    String sql = query.toString();
1390    
1391                    Query q = session.createQuery(sql);
1392    
1393                    q.setFirstResult(0);
1394                    q.setMaxResults(2);
1395    
1396                    QueryPos qPos = QueryPos.getInstance(q);
1397    
1398                    if (sessionId != null) {
1399                            qPos.add(sessionId);
1400                    }
1401    
1402                    if (orderByComparator != null) {
1403                            Object[] values = orderByComparator.getOrderByValues(userTracker);
1404    
1405                            for (Object value : values) {
1406                                    qPos.add(value);
1407                            }
1408                    }
1409    
1410                    List<UserTracker> list = q.list();
1411    
1412                    if (list.size() == 2) {
1413                            return list.get(1);
1414                    }
1415                    else {
1416                            return null;
1417                    }
1418            }
1419    
1420            /**
1421             * Finds all the user trackers.
1422             *
1423             * @return the user trackers
1424             * @throws SystemException if a system exception occurred
1425             */
1426            public List<UserTracker> findAll() throws SystemException {
1427                    return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
1428            }
1429    
1430            /**
1431             * Finds a range of all the user trackers.
1432             *
1433             * <p>
1434             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
1435             * </p>
1436             *
1437             * @param start the lower bound of the range of user trackers to return
1438             * @param end the upper bound of the range of user trackers to return (not inclusive)
1439             * @return the range of user trackers
1440             * @throws SystemException if a system exception occurred
1441             */
1442            public List<UserTracker> findAll(int start, int end)
1443                    throws SystemException {
1444                    return findAll(start, end, null);
1445            }
1446    
1447            /**
1448             * Finds an ordered range of all the user trackers.
1449             *
1450             * <p>
1451             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
1452             * </p>
1453             *
1454             * @param start the lower bound of the range of user trackers to return
1455             * @param end the upper bound of the range of user trackers to return (not inclusive)
1456             * @param orderByComparator the comparator to order the results by
1457             * @return the ordered range of user trackers
1458             * @throws SystemException if a system exception occurred
1459             */
1460            public List<UserTracker> findAll(int start, int end,
1461                    OrderByComparator orderByComparator) throws SystemException {
1462                    Object[] finderArgs = new Object[] {
1463                                    String.valueOf(start), String.valueOf(end),
1464                                    String.valueOf(orderByComparator)
1465                            };
1466    
1467                    List<UserTracker> list = (List<UserTracker>)FinderCacheUtil.getResult(FINDER_PATH_FIND_ALL,
1468                                    finderArgs, this);
1469    
1470                    if (list == null) {
1471                            Session session = null;
1472    
1473                            try {
1474                                    session = openSession();
1475    
1476                                    StringBundler query = null;
1477                                    String sql = null;
1478    
1479                                    if (orderByComparator != null) {
1480                                            query = new StringBundler(2 +
1481                                                            (orderByComparator.getOrderByFields().length * 3));
1482    
1483                                            query.append(_SQL_SELECT_USERTRACKER);
1484    
1485                                            appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
1486                                                    orderByComparator);
1487    
1488                                            sql = query.toString();
1489                                    }
1490                                    else {
1491                                            sql = _SQL_SELECT_USERTRACKER;
1492                                    }
1493    
1494                                    Query q = session.createQuery(sql);
1495    
1496                                    if (orderByComparator == null) {
1497                                            list = (List<UserTracker>)QueryUtil.list(q, getDialect(),
1498                                                            start, end, false);
1499    
1500                                            Collections.sort(list);
1501                                    }
1502                                    else {
1503                                            list = (List<UserTracker>)QueryUtil.list(q, getDialect(),
1504                                                            start, end);
1505                                    }
1506                            }
1507                            catch (Exception e) {
1508                                    throw processException(e);
1509                            }
1510                            finally {
1511                                    if (list == null) {
1512                                            list = new ArrayList<UserTracker>();
1513                                    }
1514    
1515                                    cacheResult(list);
1516    
1517                                    FinderCacheUtil.putResult(FINDER_PATH_FIND_ALL, finderArgs, list);
1518    
1519                                    closeSession(session);
1520                            }
1521                    }
1522    
1523                    return list;
1524            }
1525    
1526            /**
1527             * Removes all the user trackers where companyId = &#63; from the database.
1528             *
1529             * @param companyId the company id to search with
1530             * @throws SystemException if a system exception occurred
1531             */
1532            public void removeByCompanyId(long companyId) throws SystemException {
1533                    for (UserTracker userTracker : findByCompanyId(companyId)) {
1534                            remove(userTracker);
1535                    }
1536            }
1537    
1538            /**
1539             * Removes all the user trackers where userId = &#63; from the database.
1540             *
1541             * @param userId the user id to search with
1542             * @throws SystemException if a system exception occurred
1543             */
1544            public void removeByUserId(long userId) throws SystemException {
1545                    for (UserTracker userTracker : findByUserId(userId)) {
1546                            remove(userTracker);
1547                    }
1548            }
1549    
1550            /**
1551             * Removes all the user trackers where sessionId = &#63; from the database.
1552             *
1553             * @param sessionId the session id to search with
1554             * @throws SystemException if a system exception occurred
1555             */
1556            public void removeBySessionId(String sessionId) throws SystemException {
1557                    for (UserTracker userTracker : findBySessionId(sessionId)) {
1558                            remove(userTracker);
1559                    }
1560            }
1561    
1562            /**
1563             * Removes all the user trackers from the database.
1564             *
1565             * @throws SystemException if a system exception occurred
1566             */
1567            public void removeAll() throws SystemException {
1568                    for (UserTracker userTracker : findAll()) {
1569                            remove(userTracker);
1570                    }
1571            }
1572    
1573            /**
1574             * Counts all the user trackers where companyId = &#63;.
1575             *
1576             * @param companyId the company id to search with
1577             * @return the number of matching user trackers
1578             * @throws SystemException if a system exception occurred
1579             */
1580            public int countByCompanyId(long companyId) throws SystemException {
1581                    Object[] finderArgs = new Object[] { companyId };
1582    
1583                    Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_COMPANYID,
1584                                    finderArgs, this);
1585    
1586                    if (count == null) {
1587                            Session session = null;
1588    
1589                            try {
1590                                    session = openSession();
1591    
1592                                    StringBundler query = new StringBundler(2);
1593    
1594                                    query.append(_SQL_COUNT_USERTRACKER_WHERE);
1595    
1596                                    query.append(_FINDER_COLUMN_COMPANYID_COMPANYID_2);
1597    
1598                                    String sql = query.toString();
1599    
1600                                    Query q = session.createQuery(sql);
1601    
1602                                    QueryPos qPos = QueryPos.getInstance(q);
1603    
1604                                    qPos.add(companyId);
1605    
1606                                    count = (Long)q.uniqueResult();
1607                            }
1608                            catch (Exception e) {
1609                                    throw processException(e);
1610                            }
1611                            finally {
1612                                    if (count == null) {
1613                                            count = Long.valueOf(0);
1614                                    }
1615    
1616                                    FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_COMPANYID,
1617                                            finderArgs, count);
1618    
1619                                    closeSession(session);
1620                            }
1621                    }
1622    
1623                    return count.intValue();
1624            }
1625    
1626            /**
1627             * Counts all the user trackers where userId = &#63;.
1628             *
1629             * @param userId the user id to search with
1630             * @return the number of matching user trackers
1631             * @throws SystemException if a system exception occurred
1632             */
1633            public int countByUserId(long userId) throws SystemException {
1634                    Object[] finderArgs = new Object[] { userId };
1635    
1636                    Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_USERID,
1637                                    finderArgs, this);
1638    
1639                    if (count == null) {
1640                            Session session = null;
1641    
1642                            try {
1643                                    session = openSession();
1644    
1645                                    StringBundler query = new StringBundler(2);
1646    
1647                                    query.append(_SQL_COUNT_USERTRACKER_WHERE);
1648    
1649                                    query.append(_FINDER_COLUMN_USERID_USERID_2);
1650    
1651                                    String sql = query.toString();
1652    
1653                                    Query q = session.createQuery(sql);
1654    
1655                                    QueryPos qPos = QueryPos.getInstance(q);
1656    
1657                                    qPos.add(userId);
1658    
1659                                    count = (Long)q.uniqueResult();
1660                            }
1661                            catch (Exception e) {
1662                                    throw processException(e);
1663                            }
1664                            finally {
1665                                    if (count == null) {
1666                                            count = Long.valueOf(0);
1667                                    }
1668    
1669                                    FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_USERID,
1670                                            finderArgs, count);
1671    
1672                                    closeSession(session);
1673                            }
1674                    }
1675    
1676                    return count.intValue();
1677            }
1678    
1679            /**
1680             * Counts all the user trackers where sessionId = &#63;.
1681             *
1682             * @param sessionId the session id to search with
1683             * @return the number of matching user trackers
1684             * @throws SystemException if a system exception occurred
1685             */
1686            public int countBySessionId(String sessionId) throws SystemException {
1687                    Object[] finderArgs = new Object[] { sessionId };
1688    
1689                    Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_SESSIONID,
1690                                    finderArgs, this);
1691    
1692                    if (count == null) {
1693                            Session session = null;
1694    
1695                            try {
1696                                    session = openSession();
1697    
1698                                    StringBundler query = new StringBundler(2);
1699    
1700                                    query.append(_SQL_COUNT_USERTRACKER_WHERE);
1701    
1702                                    if (sessionId == null) {
1703                                            query.append(_FINDER_COLUMN_SESSIONID_SESSIONID_1);
1704                                    }
1705                                    else {
1706                                            if (sessionId.equals(StringPool.BLANK)) {
1707                                                    query.append(_FINDER_COLUMN_SESSIONID_SESSIONID_3);
1708                                            }
1709                                            else {
1710                                                    query.append(_FINDER_COLUMN_SESSIONID_SESSIONID_2);
1711                                            }
1712                                    }
1713    
1714                                    String sql = query.toString();
1715    
1716                                    Query q = session.createQuery(sql);
1717    
1718                                    QueryPos qPos = QueryPos.getInstance(q);
1719    
1720                                    if (sessionId != null) {
1721                                            qPos.add(sessionId);
1722                                    }
1723    
1724                                    count = (Long)q.uniqueResult();
1725                            }
1726                            catch (Exception e) {
1727                                    throw processException(e);
1728                            }
1729                            finally {
1730                                    if (count == null) {
1731                                            count = Long.valueOf(0);
1732                                    }
1733    
1734                                    FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_SESSIONID,
1735                                            finderArgs, count);
1736    
1737                                    closeSession(session);
1738                            }
1739                    }
1740    
1741                    return count.intValue();
1742            }
1743    
1744            /**
1745             * Counts all the user trackers.
1746             *
1747             * @return the number of user trackers
1748             * @throws SystemException if a system exception occurred
1749             */
1750            public int countAll() throws SystemException {
1751                    Object[] finderArgs = new Object[0];
1752    
1753                    Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
1754                                    finderArgs, this);
1755    
1756                    if (count == null) {
1757                            Session session = null;
1758    
1759                            try {
1760                                    session = openSession();
1761    
1762                                    Query q = session.createQuery(_SQL_COUNT_USERTRACKER);
1763    
1764                                    count = (Long)q.uniqueResult();
1765                            }
1766                            catch (Exception e) {
1767                                    throw processException(e);
1768                            }
1769                            finally {
1770                                    if (count == null) {
1771                                            count = Long.valueOf(0);
1772                                    }
1773    
1774                                    FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL, finderArgs,
1775                                            count);
1776    
1777                                    closeSession(session);
1778                            }
1779                    }
1780    
1781                    return count.intValue();
1782            }
1783    
1784            /**
1785             * Initializes the user tracker persistence.
1786             */
1787            public void afterPropertiesSet() {
1788                    String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
1789                                            com.liferay.portal.util.PropsUtil.get(
1790                                                    "value.object.listener.com.liferay.portal.model.UserTracker")));
1791    
1792                    if (listenerClassNames.length > 0) {
1793                            try {
1794                                    List<ModelListener<UserTracker>> listenersList = new ArrayList<ModelListener<UserTracker>>();
1795    
1796                                    for (String listenerClassName : listenerClassNames) {
1797                                            listenersList.add((ModelListener<UserTracker>)InstanceFactory.newInstance(
1798                                                            listenerClassName));
1799                                    }
1800    
1801                                    listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
1802                            }
1803                            catch (Exception e) {
1804                                    _log.error(e);
1805                            }
1806                    }
1807            }
1808    
1809            @BeanReference(type = AccountPersistence.class)
1810            protected AccountPersistence accountPersistence;
1811            @BeanReference(type = AddressPersistence.class)
1812            protected AddressPersistence addressPersistence;
1813            @BeanReference(type = BrowserTrackerPersistence.class)
1814            protected BrowserTrackerPersistence browserTrackerPersistence;
1815            @BeanReference(type = ClassNamePersistence.class)
1816            protected ClassNamePersistence classNamePersistence;
1817            @BeanReference(type = ClusterGroupPersistence.class)
1818            protected ClusterGroupPersistence clusterGroupPersistence;
1819            @BeanReference(type = CompanyPersistence.class)
1820            protected CompanyPersistence companyPersistence;
1821            @BeanReference(type = ContactPersistence.class)
1822            protected ContactPersistence contactPersistence;
1823            @BeanReference(type = CountryPersistence.class)
1824            protected CountryPersistence countryPersistence;
1825            @BeanReference(type = EmailAddressPersistence.class)
1826            protected EmailAddressPersistence emailAddressPersistence;
1827            @BeanReference(type = GroupPersistence.class)
1828            protected GroupPersistence groupPersistence;
1829            @BeanReference(type = ImagePersistence.class)
1830            protected ImagePersistence imagePersistence;
1831            @BeanReference(type = LayoutPersistence.class)
1832            protected LayoutPersistence layoutPersistence;
1833            @BeanReference(type = LayoutPrototypePersistence.class)
1834            protected LayoutPrototypePersistence layoutPrototypePersistence;
1835            @BeanReference(type = LayoutSetPersistence.class)
1836            protected LayoutSetPersistence layoutSetPersistence;
1837            @BeanReference(type = LayoutSetPrototypePersistence.class)
1838            protected LayoutSetPrototypePersistence layoutSetPrototypePersistence;
1839            @BeanReference(type = ListTypePersistence.class)
1840            protected ListTypePersistence listTypePersistence;
1841            @BeanReference(type = LockPersistence.class)
1842            protected LockPersistence lockPersistence;
1843            @BeanReference(type = MembershipRequestPersistence.class)
1844            protected MembershipRequestPersistence membershipRequestPersistence;
1845            @BeanReference(type = OrganizationPersistence.class)
1846            protected OrganizationPersistence organizationPersistence;
1847            @BeanReference(type = OrgGroupPermissionPersistence.class)
1848            protected OrgGroupPermissionPersistence orgGroupPermissionPersistence;
1849            @BeanReference(type = OrgGroupRolePersistence.class)
1850            protected OrgGroupRolePersistence orgGroupRolePersistence;
1851            @BeanReference(type = OrgLaborPersistence.class)
1852            protected OrgLaborPersistence orgLaborPersistence;
1853            @BeanReference(type = PasswordPolicyPersistence.class)
1854            protected PasswordPolicyPersistence passwordPolicyPersistence;
1855            @BeanReference(type = PasswordPolicyRelPersistence.class)
1856            protected PasswordPolicyRelPersistence passwordPolicyRelPersistence;
1857            @BeanReference(type = PasswordTrackerPersistence.class)
1858            protected PasswordTrackerPersistence passwordTrackerPersistence;
1859            @BeanReference(type = PermissionPersistence.class)
1860            protected PermissionPersistence permissionPersistence;
1861            @BeanReference(type = PhonePersistence.class)
1862            protected PhonePersistence phonePersistence;
1863            @BeanReference(type = PluginSettingPersistence.class)
1864            protected PluginSettingPersistence pluginSettingPersistence;
1865            @BeanReference(type = PortletPersistence.class)
1866            protected PortletPersistence portletPersistence;
1867            @BeanReference(type = PortletItemPersistence.class)
1868            protected PortletItemPersistence portletItemPersistence;
1869            @BeanReference(type = PortletPreferencesPersistence.class)
1870            protected PortletPreferencesPersistence portletPreferencesPersistence;
1871            @BeanReference(type = RegionPersistence.class)
1872            protected RegionPersistence regionPersistence;
1873            @BeanReference(type = ReleasePersistence.class)
1874            protected ReleasePersistence releasePersistence;
1875            @BeanReference(type = ResourcePersistence.class)
1876            protected ResourcePersistence resourcePersistence;
1877            @BeanReference(type = ResourceActionPersistence.class)
1878            protected ResourceActionPersistence resourceActionPersistence;
1879            @BeanReference(type = ResourceCodePersistence.class)
1880            protected ResourceCodePersistence resourceCodePersistence;
1881            @BeanReference(type = ResourcePermissionPersistence.class)
1882            protected ResourcePermissionPersistence resourcePermissionPersistence;
1883            @BeanReference(type = RolePersistence.class)
1884            protected RolePersistence rolePersistence;
1885            @BeanReference(type = ServiceComponentPersistence.class)
1886            protected ServiceComponentPersistence serviceComponentPersistence;
1887            @BeanReference(type = ShardPersistence.class)
1888            protected ShardPersistence shardPersistence;
1889            @BeanReference(type = SubscriptionPersistence.class)
1890            protected SubscriptionPersistence subscriptionPersistence;
1891            @BeanReference(type = TicketPersistence.class)
1892            protected TicketPersistence ticketPersistence;
1893            @BeanReference(type = TeamPersistence.class)
1894            protected TeamPersistence teamPersistence;
1895            @BeanReference(type = UserPersistence.class)
1896            protected UserPersistence userPersistence;
1897            @BeanReference(type = UserGroupPersistence.class)
1898            protected UserGroupPersistence userGroupPersistence;
1899            @BeanReference(type = UserGroupGroupRolePersistence.class)
1900            protected UserGroupGroupRolePersistence userGroupGroupRolePersistence;
1901            @BeanReference(type = UserGroupRolePersistence.class)
1902            protected UserGroupRolePersistence userGroupRolePersistence;
1903            @BeanReference(type = UserIdMapperPersistence.class)
1904            protected UserIdMapperPersistence userIdMapperPersistence;
1905            @BeanReference(type = UserTrackerPersistence.class)
1906            protected UserTrackerPersistence userTrackerPersistence;
1907            @BeanReference(type = UserTrackerPathPersistence.class)
1908            protected UserTrackerPathPersistence userTrackerPathPersistence;
1909            @BeanReference(type = WebDAVPropsPersistence.class)
1910            protected WebDAVPropsPersistence webDAVPropsPersistence;
1911            @BeanReference(type = WebsitePersistence.class)
1912            protected WebsitePersistence websitePersistence;
1913            @BeanReference(type = WorkflowDefinitionLinkPersistence.class)
1914            protected WorkflowDefinitionLinkPersistence workflowDefinitionLinkPersistence;
1915            @BeanReference(type = WorkflowInstanceLinkPersistence.class)
1916            protected WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence;
1917            private static final String _SQL_SELECT_USERTRACKER = "SELECT userTracker FROM UserTracker userTracker";
1918            private static final String _SQL_SELECT_USERTRACKER_WHERE = "SELECT userTracker FROM UserTracker userTracker WHERE ";
1919            private static final String _SQL_COUNT_USERTRACKER = "SELECT COUNT(userTracker) FROM UserTracker userTracker";
1920            private static final String _SQL_COUNT_USERTRACKER_WHERE = "SELECT COUNT(userTracker) FROM UserTracker userTracker WHERE ";
1921            private static final String _FINDER_COLUMN_COMPANYID_COMPANYID_2 = "userTracker.companyId = ?";
1922            private static final String _FINDER_COLUMN_USERID_USERID_2 = "userTracker.userId = ?";
1923            private static final String _FINDER_COLUMN_SESSIONID_SESSIONID_1 = "userTracker.sessionId IS NULL";
1924            private static final String _FINDER_COLUMN_SESSIONID_SESSIONID_2 = "userTracker.sessionId = ?";
1925            private static final String _FINDER_COLUMN_SESSIONID_SESSIONID_3 = "(userTracker.sessionId IS NULL OR userTracker.sessionId = ?)";
1926            private static final String _ORDER_BY_ENTITY_ALIAS = "userTracker.";
1927            private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No UserTracker exists with the primary key ";
1928            private static final String _NO_SUCH_ENTITY_WITH_KEY = "No UserTracker exists with the key {";
1929            private static Log _log = LogFactoryUtil.getLog(UserTrackerPersistenceImpl.class);
1930    }