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