001    /**
002     * Copyright (c) 2000-present 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.impl;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.NoSuchUserTrackerPathException;
020    import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
021    import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
022    import com.liferay.portal.kernel.dao.orm.FinderPath;
023    import com.liferay.portal.kernel.dao.orm.Query;
024    import com.liferay.portal.kernel.dao.orm.QueryPos;
025    import com.liferay.portal.kernel.dao.orm.QueryUtil;
026    import com.liferay.portal.kernel.dao.orm.Session;
027    import com.liferay.portal.kernel.log.Log;
028    import com.liferay.portal.kernel.log.LogFactoryUtil;
029    import com.liferay.portal.kernel.util.OrderByComparator;
030    import com.liferay.portal.kernel.util.SetUtil;
031    import com.liferay.portal.kernel.util.StringBundler;
032    import com.liferay.portal.kernel.util.StringPool;
033    import com.liferay.portal.model.CacheModel;
034    import com.liferay.portal.model.MVCCModel;
035    import com.liferay.portal.model.UserTrackerPath;
036    import com.liferay.portal.model.impl.UserTrackerPathImpl;
037    import com.liferay.portal.model.impl.UserTrackerPathModelImpl;
038    import com.liferay.portal.service.persistence.UserTrackerPathPersistence;
039    
040    import java.io.Serializable;
041    
042    import java.util.Collections;
043    import java.util.HashMap;
044    import java.util.HashSet;
045    import java.util.Iterator;
046    import java.util.List;
047    import java.util.Map;
048    import java.util.Set;
049    
050    /**
051     * The persistence implementation for the user tracker path service.
052     *
053     * <p>
054     * Caching information and settings can be found in <code>portal.properties</code>
055     * </p>
056     *
057     * @author Brian Wing Shun Chan
058     * @see UserTrackerPathPersistence
059     * @see com.liferay.portal.service.persistence.UserTrackerPathUtil
060     * @generated
061     */
062    @ProviderType
063    public class UserTrackerPathPersistenceImpl extends BasePersistenceImpl<UserTrackerPath>
064            implements UserTrackerPathPersistence {
065            /*
066             * NOTE FOR DEVELOPERS:
067             *
068             * Never modify or reference this class directly. Always use {@link UserTrackerPathUtil} to access the user tracker path persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
069             */
070            public static final String FINDER_CLASS_NAME_ENTITY = UserTrackerPathImpl.class.getName();
071            public static final String FINDER_CLASS_NAME_LIST_WITH_PAGINATION = FINDER_CLASS_NAME_ENTITY +
072                    ".List1";
073            public static final String FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION = FINDER_CLASS_NAME_ENTITY +
074                    ".List2";
075            public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_ALL = new FinderPath(UserTrackerPathModelImpl.ENTITY_CACHE_ENABLED,
076                            UserTrackerPathModelImpl.FINDER_CACHE_ENABLED,
077                            UserTrackerPathImpl.class, FINDER_CLASS_NAME_LIST_WITH_PAGINATION,
078                            "findAll", new String[0]);
079            public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL = new FinderPath(UserTrackerPathModelImpl.ENTITY_CACHE_ENABLED,
080                            UserTrackerPathModelImpl.FINDER_CACHE_ENABLED,
081                            UserTrackerPathImpl.class,
082                            FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findAll", new String[0]);
083            public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(UserTrackerPathModelImpl.ENTITY_CACHE_ENABLED,
084                            UserTrackerPathModelImpl.FINDER_CACHE_ENABLED, Long.class,
085                            FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countAll", new String[0]);
086            public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_BY_USERTRACKERID =
087                    new FinderPath(UserTrackerPathModelImpl.ENTITY_CACHE_ENABLED,
088                            UserTrackerPathModelImpl.FINDER_CACHE_ENABLED,
089                            UserTrackerPathImpl.class, FINDER_CLASS_NAME_LIST_WITH_PAGINATION,
090                            "findByUserTrackerId",
091                            new String[] {
092                                    Long.class.getName(),
093                                    
094                            Integer.class.getName(), Integer.class.getName(),
095                                    OrderByComparator.class.getName()
096                            });
097            public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_USERTRACKERID =
098                    new FinderPath(UserTrackerPathModelImpl.ENTITY_CACHE_ENABLED,
099                            UserTrackerPathModelImpl.FINDER_CACHE_ENABLED,
100                            UserTrackerPathImpl.class,
101                            FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findByUserTrackerId",
102                            new String[] { Long.class.getName() },
103                            UserTrackerPathModelImpl.USERTRACKERID_COLUMN_BITMASK);
104            public static final FinderPath FINDER_PATH_COUNT_BY_USERTRACKERID = new FinderPath(UserTrackerPathModelImpl.ENTITY_CACHE_ENABLED,
105                            UserTrackerPathModelImpl.FINDER_CACHE_ENABLED, Long.class,
106                            FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByUserTrackerId",
107                            new String[] { Long.class.getName() });
108    
109            /**
110             * Returns all the user tracker paths where userTrackerId = &#63;.
111             *
112             * @param userTrackerId the user tracker ID
113             * @return the matching user tracker paths
114             */
115            @Override
116            public List<UserTrackerPath> findByUserTrackerId(long userTrackerId) {
117                    return findByUserTrackerId(userTrackerId, QueryUtil.ALL_POS,
118                            QueryUtil.ALL_POS, null);
119            }
120    
121            /**
122             * Returns a range of all the user tracker paths where userTrackerId = &#63;.
123             *
124             * <p>
125             * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link UserTrackerPathModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
126             * </p>
127             *
128             * @param userTrackerId the user tracker ID
129             * @param start the lower bound of the range of user tracker paths
130             * @param end the upper bound of the range of user tracker paths (not inclusive)
131             * @return the range of matching user tracker paths
132             */
133            @Override
134            public List<UserTrackerPath> findByUserTrackerId(long userTrackerId,
135                    int start, int end) {
136                    return findByUserTrackerId(userTrackerId, start, end, null);
137            }
138    
139            /**
140             * Returns an ordered range of all the user tracker paths where userTrackerId = &#63;.
141             *
142             * <p>
143             * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link UserTrackerPathModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
144             * </p>
145             *
146             * @param userTrackerId the user tracker ID
147             * @param start the lower bound of the range of user tracker paths
148             * @param end the upper bound of the range of user tracker paths (not inclusive)
149             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
150             * @return the ordered range of matching user tracker paths
151             */
152            @Override
153            public List<UserTrackerPath> findByUserTrackerId(long userTrackerId,
154                    int start, int end, OrderByComparator<UserTrackerPath> orderByComparator) {
155                    boolean pagination = true;
156                    FinderPath finderPath = null;
157                    Object[] finderArgs = null;
158    
159                    if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
160                                    (orderByComparator == null)) {
161                            pagination = false;
162                            finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_USERTRACKERID;
163                            finderArgs = new Object[] { userTrackerId };
164                    }
165                    else {
166                            finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_USERTRACKERID;
167                            finderArgs = new Object[] {
168                                            userTrackerId,
169                                            
170                                            start, end, orderByComparator
171                                    };
172                    }
173    
174                    List<UserTrackerPath> list = (List<UserTrackerPath>)FinderCacheUtil.getResult(finderPath,
175                                    finderArgs, this);
176    
177                    if ((list != null) && !list.isEmpty()) {
178                            for (UserTrackerPath userTrackerPath : list) {
179                                    if ((userTrackerId != userTrackerPath.getUserTrackerId())) {
180                                            list = null;
181    
182                                            break;
183                                    }
184                            }
185                    }
186    
187                    if (list == null) {
188                            StringBundler query = null;
189    
190                            if (orderByComparator != null) {
191                                    query = new StringBundler(3 +
192                                                    (orderByComparator.getOrderByFields().length * 3));
193                            }
194                            else {
195                                    query = new StringBundler(3);
196                            }
197    
198                            query.append(_SQL_SELECT_USERTRACKERPATH_WHERE);
199    
200                            query.append(_FINDER_COLUMN_USERTRACKERID_USERTRACKERID_2);
201    
202                            if (orderByComparator != null) {
203                                    appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
204                                            orderByComparator);
205                            }
206                            else
207                             if (pagination) {
208                                    query.append(UserTrackerPathModelImpl.ORDER_BY_JPQL);
209                            }
210    
211                            String sql = query.toString();
212    
213                            Session session = null;
214    
215                            try {
216                                    session = openSession();
217    
218                                    Query q = session.createQuery(sql);
219    
220                                    QueryPos qPos = QueryPos.getInstance(q);
221    
222                                    qPos.add(userTrackerId);
223    
224                                    if (!pagination) {
225                                            list = (List<UserTrackerPath>)QueryUtil.list(q,
226                                                            getDialect(), start, end, false);
227    
228                                            Collections.sort(list);
229    
230                                            list = Collections.unmodifiableList(list);
231                                    }
232                                    else {
233                                            list = (List<UserTrackerPath>)QueryUtil.list(q,
234                                                            getDialect(), start, end);
235                                    }
236    
237                                    cacheResult(list);
238    
239                                    FinderCacheUtil.putResult(finderPath, finderArgs, list);
240                            }
241                            catch (Exception e) {
242                                    FinderCacheUtil.removeResult(finderPath, finderArgs);
243    
244                                    throw processException(e);
245                            }
246                            finally {
247                                    closeSession(session);
248                            }
249                    }
250    
251                    return list;
252            }
253    
254            /**
255             * Returns the first user tracker path in the ordered set where userTrackerId = &#63;.
256             *
257             * @param userTrackerId the user tracker ID
258             * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
259             * @return the first matching user tracker path
260             * @throws NoSuchUserTrackerPathException if a matching user tracker path could not be found
261             */
262            @Override
263            public UserTrackerPath findByUserTrackerId_First(long userTrackerId,
264                    OrderByComparator<UserTrackerPath> orderByComparator)
265                    throws NoSuchUserTrackerPathException {
266                    UserTrackerPath userTrackerPath = fetchByUserTrackerId_First(userTrackerId,
267                                    orderByComparator);
268    
269                    if (userTrackerPath != null) {
270                            return userTrackerPath;
271                    }
272    
273                    StringBundler msg = new StringBundler(4);
274    
275                    msg.append(_NO_SUCH_ENTITY_WITH_KEY);
276    
277                    msg.append("userTrackerId=");
278                    msg.append(userTrackerId);
279    
280                    msg.append(StringPool.CLOSE_CURLY_BRACE);
281    
282                    throw new NoSuchUserTrackerPathException(msg.toString());
283            }
284    
285            /**
286             * Returns the first user tracker path in the ordered set where userTrackerId = &#63;.
287             *
288             * @param userTrackerId the user tracker ID
289             * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
290             * @return the first matching user tracker path, or <code>null</code> if a matching user tracker path could not be found
291             */
292            @Override
293            public UserTrackerPath fetchByUserTrackerId_First(long userTrackerId,
294                    OrderByComparator<UserTrackerPath> orderByComparator) {
295                    List<UserTrackerPath> list = findByUserTrackerId(userTrackerId, 0, 1,
296                                    orderByComparator);
297    
298                    if (!list.isEmpty()) {
299                            return list.get(0);
300                    }
301    
302                    return null;
303            }
304    
305            /**
306             * Returns the last user tracker path in the ordered set where userTrackerId = &#63;.
307             *
308             * @param userTrackerId the user tracker ID
309             * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
310             * @return the last matching user tracker path
311             * @throws NoSuchUserTrackerPathException if a matching user tracker path could not be found
312             */
313            @Override
314            public UserTrackerPath findByUserTrackerId_Last(long userTrackerId,
315                    OrderByComparator<UserTrackerPath> orderByComparator)
316                    throws NoSuchUserTrackerPathException {
317                    UserTrackerPath userTrackerPath = fetchByUserTrackerId_Last(userTrackerId,
318                                    orderByComparator);
319    
320                    if (userTrackerPath != null) {
321                            return userTrackerPath;
322                    }
323    
324                    StringBundler msg = new StringBundler(4);
325    
326                    msg.append(_NO_SUCH_ENTITY_WITH_KEY);
327    
328                    msg.append("userTrackerId=");
329                    msg.append(userTrackerId);
330    
331                    msg.append(StringPool.CLOSE_CURLY_BRACE);
332    
333                    throw new NoSuchUserTrackerPathException(msg.toString());
334            }
335    
336            /**
337             * Returns the last user tracker path in the ordered set where userTrackerId = &#63;.
338             *
339             * @param userTrackerId the user tracker ID
340             * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
341             * @return the last matching user tracker path, or <code>null</code> if a matching user tracker path could not be found
342             */
343            @Override
344            public UserTrackerPath fetchByUserTrackerId_Last(long userTrackerId,
345                    OrderByComparator<UserTrackerPath> orderByComparator) {
346                    int count = countByUserTrackerId(userTrackerId);
347    
348                    if (count == 0) {
349                            return null;
350                    }
351    
352                    List<UserTrackerPath> list = findByUserTrackerId(userTrackerId,
353                                    count - 1, count, orderByComparator);
354    
355                    if (!list.isEmpty()) {
356                            return list.get(0);
357                    }
358    
359                    return null;
360            }
361    
362            /**
363             * Returns the user tracker paths before and after the current user tracker path in the ordered set where userTrackerId = &#63;.
364             *
365             * @param userTrackerPathId the primary key of the current user tracker path
366             * @param userTrackerId the user tracker ID
367             * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
368             * @return the previous, current, and next user tracker path
369             * @throws NoSuchUserTrackerPathException if a user tracker path with the primary key could not be found
370             */
371            @Override
372            public UserTrackerPath[] findByUserTrackerId_PrevAndNext(
373                    long userTrackerPathId, long userTrackerId,
374                    OrderByComparator<UserTrackerPath> orderByComparator)
375                    throws NoSuchUserTrackerPathException {
376                    UserTrackerPath userTrackerPath = findByPrimaryKey(userTrackerPathId);
377    
378                    Session session = null;
379    
380                    try {
381                            session = openSession();
382    
383                            UserTrackerPath[] array = new UserTrackerPathImpl[3];
384    
385                            array[0] = getByUserTrackerId_PrevAndNext(session, userTrackerPath,
386                                            userTrackerId, orderByComparator, true);
387    
388                            array[1] = userTrackerPath;
389    
390                            array[2] = getByUserTrackerId_PrevAndNext(session, userTrackerPath,
391                                            userTrackerId, orderByComparator, false);
392    
393                            return array;
394                    }
395                    catch (Exception e) {
396                            throw processException(e);
397                    }
398                    finally {
399                            closeSession(session);
400                    }
401            }
402    
403            protected UserTrackerPath getByUserTrackerId_PrevAndNext(Session session,
404                    UserTrackerPath userTrackerPath, long userTrackerId,
405                    OrderByComparator<UserTrackerPath> orderByComparator, boolean previous) {
406                    StringBundler query = null;
407    
408                    if (orderByComparator != null) {
409                            query = new StringBundler(6 +
410                                            (orderByComparator.getOrderByFields().length * 6));
411                    }
412                    else {
413                            query = new StringBundler(3);
414                    }
415    
416                    query.append(_SQL_SELECT_USERTRACKERPATH_WHERE);
417    
418                    query.append(_FINDER_COLUMN_USERTRACKERID_USERTRACKERID_2);
419    
420                    if (orderByComparator != null) {
421                            String[] orderByConditionFields = orderByComparator.getOrderByConditionFields();
422    
423                            if (orderByConditionFields.length > 0) {
424                                    query.append(WHERE_AND);
425                            }
426    
427                            for (int i = 0; i < orderByConditionFields.length; i++) {
428                                    query.append(_ORDER_BY_ENTITY_ALIAS);
429                                    query.append(orderByConditionFields[i]);
430    
431                                    if ((i + 1) < orderByConditionFields.length) {
432                                            if (orderByComparator.isAscending() ^ previous) {
433                                                    query.append(WHERE_GREATER_THAN_HAS_NEXT);
434                                            }
435                                            else {
436                                                    query.append(WHERE_LESSER_THAN_HAS_NEXT);
437                                            }
438                                    }
439                                    else {
440                                            if (orderByComparator.isAscending() ^ previous) {
441                                                    query.append(WHERE_GREATER_THAN);
442                                            }
443                                            else {
444                                                    query.append(WHERE_LESSER_THAN);
445                                            }
446                                    }
447                            }
448    
449                            query.append(ORDER_BY_CLAUSE);
450    
451                            String[] orderByFields = orderByComparator.getOrderByFields();
452    
453                            for (int i = 0; i < orderByFields.length; i++) {
454                                    query.append(_ORDER_BY_ENTITY_ALIAS);
455                                    query.append(orderByFields[i]);
456    
457                                    if ((i + 1) < orderByFields.length) {
458                                            if (orderByComparator.isAscending() ^ previous) {
459                                                    query.append(ORDER_BY_ASC_HAS_NEXT);
460                                            }
461                                            else {
462                                                    query.append(ORDER_BY_DESC_HAS_NEXT);
463                                            }
464                                    }
465                                    else {
466                                            if (orderByComparator.isAscending() ^ previous) {
467                                                    query.append(ORDER_BY_ASC);
468                                            }
469                                            else {
470                                                    query.append(ORDER_BY_DESC);
471                                            }
472                                    }
473                            }
474                    }
475                    else {
476                            query.append(UserTrackerPathModelImpl.ORDER_BY_JPQL);
477                    }
478    
479                    String sql = query.toString();
480    
481                    Query q = session.createQuery(sql);
482    
483                    q.setFirstResult(0);
484                    q.setMaxResults(2);
485    
486                    QueryPos qPos = QueryPos.getInstance(q);
487    
488                    qPos.add(userTrackerId);
489    
490                    if (orderByComparator != null) {
491                            Object[] values = orderByComparator.getOrderByConditionValues(userTrackerPath);
492    
493                            for (Object value : values) {
494                                    qPos.add(value);
495                            }
496                    }
497    
498                    List<UserTrackerPath> list = q.list();
499    
500                    if (list.size() == 2) {
501                            return list.get(1);
502                    }
503                    else {
504                            return null;
505                    }
506            }
507    
508            /**
509             * Removes all the user tracker paths where userTrackerId = &#63; from the database.
510             *
511             * @param userTrackerId the user tracker ID
512             */
513            @Override
514            public void removeByUserTrackerId(long userTrackerId) {
515                    for (UserTrackerPath userTrackerPath : findByUserTrackerId(
516                                    userTrackerId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
517                            remove(userTrackerPath);
518                    }
519            }
520    
521            /**
522             * Returns the number of user tracker paths where userTrackerId = &#63;.
523             *
524             * @param userTrackerId the user tracker ID
525             * @return the number of matching user tracker paths
526             */
527            @Override
528            public int countByUserTrackerId(long userTrackerId) {
529                    FinderPath finderPath = FINDER_PATH_COUNT_BY_USERTRACKERID;
530    
531                    Object[] finderArgs = new Object[] { userTrackerId };
532    
533                    Long count = (Long)FinderCacheUtil.getResult(finderPath, finderArgs,
534                                    this);
535    
536                    if (count == null) {
537                            StringBundler query = new StringBundler(2);
538    
539                            query.append(_SQL_COUNT_USERTRACKERPATH_WHERE);
540    
541                            query.append(_FINDER_COLUMN_USERTRACKERID_USERTRACKERID_2);
542    
543                            String sql = query.toString();
544    
545                            Session session = null;
546    
547                            try {
548                                    session = openSession();
549    
550                                    Query q = session.createQuery(sql);
551    
552                                    QueryPos qPos = QueryPos.getInstance(q);
553    
554                                    qPos.add(userTrackerId);
555    
556                                    count = (Long)q.uniqueResult();
557    
558                                    FinderCacheUtil.putResult(finderPath, finderArgs, count);
559                            }
560                            catch (Exception e) {
561                                    FinderCacheUtil.removeResult(finderPath, finderArgs);
562    
563                                    throw processException(e);
564                            }
565                            finally {
566                                    closeSession(session);
567                            }
568                    }
569    
570                    return count.intValue();
571            }
572    
573            private static final String _FINDER_COLUMN_USERTRACKERID_USERTRACKERID_2 = "userTrackerPath.userTrackerId = ?";
574    
575            public UserTrackerPathPersistenceImpl() {
576                    setModelClass(UserTrackerPath.class);
577            }
578    
579            /**
580             * Caches the user tracker path in the entity cache if it is enabled.
581             *
582             * @param userTrackerPath the user tracker path
583             */
584            @Override
585            public void cacheResult(UserTrackerPath userTrackerPath) {
586                    EntityCacheUtil.putResult(UserTrackerPathModelImpl.ENTITY_CACHE_ENABLED,
587                            UserTrackerPathImpl.class, userTrackerPath.getPrimaryKey(),
588                            userTrackerPath);
589    
590                    userTrackerPath.resetOriginalValues();
591            }
592    
593            /**
594             * Caches the user tracker paths in the entity cache if it is enabled.
595             *
596             * @param userTrackerPaths the user tracker paths
597             */
598            @Override
599            public void cacheResult(List<UserTrackerPath> userTrackerPaths) {
600                    for (UserTrackerPath userTrackerPath : userTrackerPaths) {
601                            if (EntityCacheUtil.getResult(
602                                                    UserTrackerPathModelImpl.ENTITY_CACHE_ENABLED,
603                                                    UserTrackerPathImpl.class,
604                                                    userTrackerPath.getPrimaryKey()) == null) {
605                                    cacheResult(userTrackerPath);
606                            }
607                            else {
608                                    userTrackerPath.resetOriginalValues();
609                            }
610                    }
611            }
612    
613            /**
614             * Clears the cache for all user tracker paths.
615             *
616             * <p>
617             * The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method.
618             * </p>
619             */
620            @Override
621            public void clearCache() {
622                    EntityCacheUtil.clearCache(UserTrackerPathImpl.class);
623    
624                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
625                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
626                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
627            }
628    
629            /**
630             * Clears the cache for the user tracker path.
631             *
632             * <p>
633             * The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method.
634             * </p>
635             */
636            @Override
637            public void clearCache(UserTrackerPath userTrackerPath) {
638                    EntityCacheUtil.removeResult(UserTrackerPathModelImpl.ENTITY_CACHE_ENABLED,
639                            UserTrackerPathImpl.class, userTrackerPath.getPrimaryKey());
640    
641                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
642                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
643            }
644    
645            @Override
646            public void clearCache(List<UserTrackerPath> userTrackerPaths) {
647                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
648                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
649    
650                    for (UserTrackerPath userTrackerPath : userTrackerPaths) {
651                            EntityCacheUtil.removeResult(UserTrackerPathModelImpl.ENTITY_CACHE_ENABLED,
652                                    UserTrackerPathImpl.class, userTrackerPath.getPrimaryKey());
653                    }
654            }
655    
656            /**
657             * Creates a new user tracker path with the primary key. Does not add the user tracker path to the database.
658             *
659             * @param userTrackerPathId the primary key for the new user tracker path
660             * @return the new user tracker path
661             */
662            @Override
663            public UserTrackerPath create(long userTrackerPathId) {
664                    UserTrackerPath userTrackerPath = new UserTrackerPathImpl();
665    
666                    userTrackerPath.setNew(true);
667                    userTrackerPath.setPrimaryKey(userTrackerPathId);
668    
669                    return userTrackerPath;
670            }
671    
672            /**
673             * Removes the user tracker path with the primary key from the database. Also notifies the appropriate model listeners.
674             *
675             * @param userTrackerPathId the primary key of the user tracker path
676             * @return the user tracker path that was removed
677             * @throws NoSuchUserTrackerPathException if a user tracker path with the primary key could not be found
678             */
679            @Override
680            public UserTrackerPath remove(long userTrackerPathId)
681                    throws NoSuchUserTrackerPathException {
682                    return remove((Serializable)userTrackerPathId);
683            }
684    
685            /**
686             * Removes the user tracker path with the primary key from the database. Also notifies the appropriate model listeners.
687             *
688             * @param primaryKey the primary key of the user tracker path
689             * @return the user tracker path that was removed
690             * @throws NoSuchUserTrackerPathException if a user tracker path with the primary key could not be found
691             */
692            @Override
693            public UserTrackerPath remove(Serializable primaryKey)
694                    throws NoSuchUserTrackerPathException {
695                    Session session = null;
696    
697                    try {
698                            session = openSession();
699    
700                            UserTrackerPath userTrackerPath = (UserTrackerPath)session.get(UserTrackerPathImpl.class,
701                                            primaryKey);
702    
703                            if (userTrackerPath == null) {
704                                    if (_log.isWarnEnabled()) {
705                                            _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
706                                    }
707    
708                                    throw new NoSuchUserTrackerPathException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
709                                            primaryKey);
710                            }
711    
712                            return remove(userTrackerPath);
713                    }
714                    catch (NoSuchUserTrackerPathException nsee) {
715                            throw nsee;
716                    }
717                    catch (Exception e) {
718                            throw processException(e);
719                    }
720                    finally {
721                            closeSession(session);
722                    }
723            }
724    
725            @Override
726            protected UserTrackerPath removeImpl(UserTrackerPath userTrackerPath) {
727                    userTrackerPath = toUnwrappedModel(userTrackerPath);
728    
729                    Session session = null;
730    
731                    try {
732                            session = openSession();
733    
734                            if (!session.contains(userTrackerPath)) {
735                                    userTrackerPath = (UserTrackerPath)session.get(UserTrackerPathImpl.class,
736                                                    userTrackerPath.getPrimaryKeyObj());
737                            }
738    
739                            if (userTrackerPath != null) {
740                                    session.delete(userTrackerPath);
741                            }
742                    }
743                    catch (Exception e) {
744                            throw processException(e);
745                    }
746                    finally {
747                            closeSession(session);
748                    }
749    
750                    if (userTrackerPath != null) {
751                            clearCache(userTrackerPath);
752                    }
753    
754                    return userTrackerPath;
755            }
756    
757            @Override
758            public UserTrackerPath updateImpl(UserTrackerPath userTrackerPath) {
759                    userTrackerPath = toUnwrappedModel(userTrackerPath);
760    
761                    boolean isNew = userTrackerPath.isNew();
762    
763                    UserTrackerPathModelImpl userTrackerPathModelImpl = (UserTrackerPathModelImpl)userTrackerPath;
764    
765                    Session session = null;
766    
767                    try {
768                            session = openSession();
769    
770                            if (userTrackerPath.isNew()) {
771                                    session.save(userTrackerPath);
772    
773                                    userTrackerPath.setNew(false);
774                            }
775                            else {
776                                    session.merge(userTrackerPath);
777                            }
778                    }
779                    catch (Exception e) {
780                            throw processException(e);
781                    }
782                    finally {
783                            closeSession(session);
784                    }
785    
786                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
787    
788                    if (isNew || !UserTrackerPathModelImpl.COLUMN_BITMASK_ENABLED) {
789                            FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
790                    }
791    
792                    else {
793                            if ((userTrackerPathModelImpl.getColumnBitmask() &
794                                            FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_USERTRACKERID.getColumnBitmask()) != 0) {
795                                    Object[] args = new Object[] {
796                                                    userTrackerPathModelImpl.getOriginalUserTrackerId()
797                                            };
798    
799                                    FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_USERTRACKERID,
800                                            args);
801                                    FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_USERTRACKERID,
802                                            args);
803    
804                                    args = new Object[] { userTrackerPathModelImpl.getUserTrackerId() };
805    
806                                    FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_USERTRACKERID,
807                                            args);
808                                    FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_USERTRACKERID,
809                                            args);
810                            }
811                    }
812    
813                    EntityCacheUtil.putResult(UserTrackerPathModelImpl.ENTITY_CACHE_ENABLED,
814                            UserTrackerPathImpl.class, userTrackerPath.getPrimaryKey(),
815                            userTrackerPath, false);
816    
817                    userTrackerPath.resetOriginalValues();
818    
819                    return userTrackerPath;
820            }
821    
822            protected UserTrackerPath toUnwrappedModel(UserTrackerPath userTrackerPath) {
823                    if (userTrackerPath instanceof UserTrackerPathImpl) {
824                            return userTrackerPath;
825                    }
826    
827                    UserTrackerPathImpl userTrackerPathImpl = new UserTrackerPathImpl();
828    
829                    userTrackerPathImpl.setNew(userTrackerPath.isNew());
830                    userTrackerPathImpl.setPrimaryKey(userTrackerPath.getPrimaryKey());
831    
832                    userTrackerPathImpl.setMvccVersion(userTrackerPath.getMvccVersion());
833                    userTrackerPathImpl.setUserTrackerPathId(userTrackerPath.getUserTrackerPathId());
834                    userTrackerPathImpl.setUserTrackerId(userTrackerPath.getUserTrackerId());
835                    userTrackerPathImpl.setPath(userTrackerPath.getPath());
836                    userTrackerPathImpl.setPathDate(userTrackerPath.getPathDate());
837    
838                    return userTrackerPathImpl;
839            }
840    
841            /**
842             * Returns the user tracker path with the primary key or throws a {@link com.liferay.portal.NoSuchModelException} if it could not be found.
843             *
844             * @param primaryKey the primary key of the user tracker path
845             * @return the user tracker path
846             * @throws NoSuchUserTrackerPathException if a user tracker path with the primary key could not be found
847             */
848            @Override
849            public UserTrackerPath findByPrimaryKey(Serializable primaryKey)
850                    throws NoSuchUserTrackerPathException {
851                    UserTrackerPath userTrackerPath = fetchByPrimaryKey(primaryKey);
852    
853                    if (userTrackerPath == null) {
854                            if (_log.isWarnEnabled()) {
855                                    _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
856                            }
857    
858                            throw new NoSuchUserTrackerPathException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
859                                    primaryKey);
860                    }
861    
862                    return userTrackerPath;
863            }
864    
865            /**
866             * Returns the user tracker path with the primary key or throws a {@link NoSuchUserTrackerPathException} if it could not be found.
867             *
868             * @param userTrackerPathId the primary key of the user tracker path
869             * @return the user tracker path
870             * @throws NoSuchUserTrackerPathException if a user tracker path with the primary key could not be found
871             */
872            @Override
873            public UserTrackerPath findByPrimaryKey(long userTrackerPathId)
874                    throws NoSuchUserTrackerPathException {
875                    return findByPrimaryKey((Serializable)userTrackerPathId);
876            }
877    
878            /**
879             * Returns the user tracker path with the primary key or returns <code>null</code> if it could not be found.
880             *
881             * @param primaryKey the primary key of the user tracker path
882             * @return the user tracker path, or <code>null</code> if a user tracker path with the primary key could not be found
883             */
884            @Override
885            public UserTrackerPath fetchByPrimaryKey(Serializable primaryKey) {
886                    UserTrackerPath userTrackerPath = (UserTrackerPath)EntityCacheUtil.getResult(UserTrackerPathModelImpl.ENTITY_CACHE_ENABLED,
887                                    UserTrackerPathImpl.class, primaryKey);
888    
889                    if (userTrackerPath == _nullUserTrackerPath) {
890                            return null;
891                    }
892    
893                    if (userTrackerPath == null) {
894                            Session session = null;
895    
896                            try {
897                                    session = openSession();
898    
899                                    userTrackerPath = (UserTrackerPath)session.get(UserTrackerPathImpl.class,
900                                                    primaryKey);
901    
902                                    if (userTrackerPath != null) {
903                                            cacheResult(userTrackerPath);
904                                    }
905                                    else {
906                                            EntityCacheUtil.putResult(UserTrackerPathModelImpl.ENTITY_CACHE_ENABLED,
907                                                    UserTrackerPathImpl.class, primaryKey,
908                                                    _nullUserTrackerPath);
909                                    }
910                            }
911                            catch (Exception e) {
912                                    EntityCacheUtil.removeResult(UserTrackerPathModelImpl.ENTITY_CACHE_ENABLED,
913                                            UserTrackerPathImpl.class, primaryKey);
914    
915                                    throw processException(e);
916                            }
917                            finally {
918                                    closeSession(session);
919                            }
920                    }
921    
922                    return userTrackerPath;
923            }
924    
925            /**
926             * Returns the user tracker path with the primary key or returns <code>null</code> if it could not be found.
927             *
928             * @param userTrackerPathId the primary key of the user tracker path
929             * @return the user tracker path, or <code>null</code> if a user tracker path with the primary key could not be found
930             */
931            @Override
932            public UserTrackerPath fetchByPrimaryKey(long userTrackerPathId) {
933                    return fetchByPrimaryKey((Serializable)userTrackerPathId);
934            }
935    
936            @Override
937            public Map<Serializable, UserTrackerPath> fetchByPrimaryKeys(
938                    Set<Serializable> primaryKeys) {
939                    if (primaryKeys.isEmpty()) {
940                            return Collections.emptyMap();
941                    }
942    
943                    Map<Serializable, UserTrackerPath> map = new HashMap<Serializable, UserTrackerPath>();
944    
945                    if (primaryKeys.size() == 1) {
946                            Iterator<Serializable> iterator = primaryKeys.iterator();
947    
948                            Serializable primaryKey = iterator.next();
949    
950                            UserTrackerPath userTrackerPath = fetchByPrimaryKey(primaryKey);
951    
952                            if (userTrackerPath != null) {
953                                    map.put(primaryKey, userTrackerPath);
954                            }
955    
956                            return map;
957                    }
958    
959                    Set<Serializable> uncachedPrimaryKeys = null;
960    
961                    for (Serializable primaryKey : primaryKeys) {
962                            UserTrackerPath userTrackerPath = (UserTrackerPath)EntityCacheUtil.getResult(UserTrackerPathModelImpl.ENTITY_CACHE_ENABLED,
963                                            UserTrackerPathImpl.class, primaryKey);
964    
965                            if (userTrackerPath == null) {
966                                    if (uncachedPrimaryKeys == null) {
967                                            uncachedPrimaryKeys = new HashSet<Serializable>();
968                                    }
969    
970                                    uncachedPrimaryKeys.add(primaryKey);
971                            }
972                            else {
973                                    map.put(primaryKey, userTrackerPath);
974                            }
975                    }
976    
977                    if (uncachedPrimaryKeys == null) {
978                            return map;
979                    }
980    
981                    StringBundler query = new StringBundler((uncachedPrimaryKeys.size() * 2) +
982                                    1);
983    
984                    query.append(_SQL_SELECT_USERTRACKERPATH_WHERE_PKS_IN);
985    
986                    for (Serializable primaryKey : uncachedPrimaryKeys) {
987                            query.append(String.valueOf(primaryKey));
988    
989                            query.append(StringPool.COMMA);
990                    }
991    
992                    query.setIndex(query.index() - 1);
993    
994                    query.append(StringPool.CLOSE_PARENTHESIS);
995    
996                    String sql = query.toString();
997    
998                    Session session = null;
999    
1000                    try {
1001                            session = openSession();
1002    
1003                            Query q = session.createQuery(sql);
1004    
1005                            for (UserTrackerPath userTrackerPath : (List<UserTrackerPath>)q.list()) {
1006                                    map.put(userTrackerPath.getPrimaryKeyObj(), userTrackerPath);
1007    
1008                                    cacheResult(userTrackerPath);
1009    
1010                                    uncachedPrimaryKeys.remove(userTrackerPath.getPrimaryKeyObj());
1011                            }
1012    
1013                            for (Serializable primaryKey : uncachedPrimaryKeys) {
1014                                    EntityCacheUtil.putResult(UserTrackerPathModelImpl.ENTITY_CACHE_ENABLED,
1015                                            UserTrackerPathImpl.class, primaryKey, _nullUserTrackerPath);
1016                            }
1017                    }
1018                    catch (Exception e) {
1019                            throw processException(e);
1020                    }
1021                    finally {
1022                            closeSession(session);
1023                    }
1024    
1025                    return map;
1026            }
1027    
1028            /**
1029             * Returns all the user tracker paths.
1030             *
1031             * @return the user tracker paths
1032             */
1033            @Override
1034            public List<UserTrackerPath> findAll() {
1035                    return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
1036            }
1037    
1038            /**
1039             * Returns a range of all the user tracker paths.
1040             *
1041             * <p>
1042             * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link UserTrackerPathModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
1043             * </p>
1044             *
1045             * @param start the lower bound of the range of user tracker paths
1046             * @param end the upper bound of the range of user tracker paths (not inclusive)
1047             * @return the range of user tracker paths
1048             */
1049            @Override
1050            public List<UserTrackerPath> findAll(int start, int end) {
1051                    return findAll(start, end, null);
1052            }
1053    
1054            /**
1055             * Returns an ordered range of all the user tracker paths.
1056             *
1057             * <p>
1058             * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link UserTrackerPathModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
1059             * </p>
1060             *
1061             * @param start the lower bound of the range of user tracker paths
1062             * @param end the upper bound of the range of user tracker paths (not inclusive)
1063             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
1064             * @return the ordered range of user tracker paths
1065             */
1066            @Override
1067            public List<UserTrackerPath> findAll(int start, int end,
1068                    OrderByComparator<UserTrackerPath> orderByComparator) {
1069                    boolean pagination = true;
1070                    FinderPath finderPath = null;
1071                    Object[] finderArgs = null;
1072    
1073                    if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
1074                                    (orderByComparator == null)) {
1075                            pagination = false;
1076                            finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL;
1077                            finderArgs = FINDER_ARGS_EMPTY;
1078                    }
1079                    else {
1080                            finderPath = FINDER_PATH_WITH_PAGINATION_FIND_ALL;
1081                            finderArgs = new Object[] { start, end, orderByComparator };
1082                    }
1083    
1084                    List<UserTrackerPath> list = (List<UserTrackerPath>)FinderCacheUtil.getResult(finderPath,
1085                                    finderArgs, this);
1086    
1087                    if (list == null) {
1088                            StringBundler query = null;
1089                            String sql = null;
1090    
1091                            if (orderByComparator != null) {
1092                                    query = new StringBundler(2 +
1093                                                    (orderByComparator.getOrderByFields().length * 3));
1094    
1095                                    query.append(_SQL_SELECT_USERTRACKERPATH);
1096    
1097                                    appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
1098                                            orderByComparator);
1099    
1100                                    sql = query.toString();
1101                            }
1102                            else {
1103                                    sql = _SQL_SELECT_USERTRACKERPATH;
1104    
1105                                    if (pagination) {
1106                                            sql = sql.concat(UserTrackerPathModelImpl.ORDER_BY_JPQL);
1107                                    }
1108                            }
1109    
1110                            Session session = null;
1111    
1112                            try {
1113                                    session = openSession();
1114    
1115                                    Query q = session.createQuery(sql);
1116    
1117                                    if (!pagination) {
1118                                            list = (List<UserTrackerPath>)QueryUtil.list(q,
1119                                                            getDialect(), start, end, false);
1120    
1121                                            Collections.sort(list);
1122    
1123                                            list = Collections.unmodifiableList(list);
1124                                    }
1125                                    else {
1126                                            list = (List<UserTrackerPath>)QueryUtil.list(q,
1127                                                            getDialect(), start, end);
1128                                    }
1129    
1130                                    cacheResult(list);
1131    
1132                                    FinderCacheUtil.putResult(finderPath, finderArgs, list);
1133                            }
1134                            catch (Exception e) {
1135                                    FinderCacheUtil.removeResult(finderPath, finderArgs);
1136    
1137                                    throw processException(e);
1138                            }
1139                            finally {
1140                                    closeSession(session);
1141                            }
1142                    }
1143    
1144                    return list;
1145            }
1146    
1147            /**
1148             * Removes all the user tracker paths from the database.
1149             *
1150             */
1151            @Override
1152            public void removeAll() {
1153                    for (UserTrackerPath userTrackerPath : findAll()) {
1154                            remove(userTrackerPath);
1155                    }
1156            }
1157    
1158            /**
1159             * Returns the number of user tracker paths.
1160             *
1161             * @return the number of user tracker paths
1162             */
1163            @Override
1164            public int countAll() {
1165                    Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
1166                                    FINDER_ARGS_EMPTY, this);
1167    
1168                    if (count == null) {
1169                            Session session = null;
1170    
1171                            try {
1172                                    session = openSession();
1173    
1174                                    Query q = session.createQuery(_SQL_COUNT_USERTRACKERPATH);
1175    
1176                                    count = (Long)q.uniqueResult();
1177    
1178                                    FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL,
1179                                            FINDER_ARGS_EMPTY, count);
1180                            }
1181                            catch (Exception e) {
1182                                    FinderCacheUtil.removeResult(FINDER_PATH_COUNT_ALL,
1183                                            FINDER_ARGS_EMPTY);
1184    
1185                                    throw processException(e);
1186                            }
1187                            finally {
1188                                    closeSession(session);
1189                            }
1190                    }
1191    
1192                    return count.intValue();
1193            }
1194    
1195            @Override
1196            protected Set<String> getBadColumnNames() {
1197                    return _badColumnNames;
1198            }
1199    
1200            /**
1201             * Initializes the user tracker path persistence.
1202             */
1203            public void afterPropertiesSet() {
1204            }
1205    
1206            public void destroy() {
1207                    EntityCacheUtil.removeCache(UserTrackerPathImpl.class.getName());
1208                    FinderCacheUtil.removeCache(FINDER_CLASS_NAME_ENTITY);
1209                    FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
1210                    FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
1211            }
1212    
1213            private static final String _SQL_SELECT_USERTRACKERPATH = "SELECT userTrackerPath FROM UserTrackerPath userTrackerPath";
1214            private static final String _SQL_SELECT_USERTRACKERPATH_WHERE_PKS_IN = "SELECT userTrackerPath FROM UserTrackerPath userTrackerPath WHERE userTrackerPathId IN (";
1215            private static final String _SQL_SELECT_USERTRACKERPATH_WHERE = "SELECT userTrackerPath FROM UserTrackerPath userTrackerPath WHERE ";
1216            private static final String _SQL_COUNT_USERTRACKERPATH = "SELECT COUNT(userTrackerPath) FROM UserTrackerPath userTrackerPath";
1217            private static final String _SQL_COUNT_USERTRACKERPATH_WHERE = "SELECT COUNT(userTrackerPath) FROM UserTrackerPath userTrackerPath WHERE ";
1218            private static final String _ORDER_BY_ENTITY_ALIAS = "userTrackerPath.";
1219            private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No UserTrackerPath exists with the primary key ";
1220            private static final String _NO_SUCH_ENTITY_WITH_KEY = "No UserTrackerPath exists with the key {";
1221            private static final Log _log = LogFactoryUtil.getLog(UserTrackerPathPersistenceImpl.class);
1222            private static final Set<String> _badColumnNames = SetUtil.fromArray(new String[] {
1223                                    "path"
1224                            });
1225            private static final UserTrackerPath _nullUserTrackerPath = new UserTrackerPathImpl() {
1226                            @Override
1227                            public Object clone() {
1228                                    return this;
1229                            }
1230    
1231                            @Override
1232                            public CacheModel<UserTrackerPath> toCacheModel() {
1233                                    return _nullUserTrackerPathCacheModel;
1234                            }
1235                    };
1236    
1237            private static final CacheModel<UserTrackerPath> _nullUserTrackerPathCacheModel =
1238                    new NullCacheModel();
1239    
1240            private static class NullCacheModel implements CacheModel<UserTrackerPath>,
1241                    MVCCModel {
1242                    @Override
1243                    public long getMvccVersion() {
1244                            return -1;
1245                    }
1246    
1247                    @Override
1248                    public void setMvccVersion(long mvccVersion) {
1249                    }
1250    
1251                    @Override
1252                    public UserTrackerPath toEntityModel() {
1253                            return _nullUserTrackerPath;
1254                    }
1255            }
1256    }