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,
098                            FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "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, FINDER_CLASS_NAME_LIST_WITH_PAGINATION,
102                            "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    
311                    else {
312                            if ((passwordTrackerModelImpl.getColumnBitmask() &
313                                            FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_USERID.getColumnBitmask()) != 0) {
314                                    Object[] args = new Object[] {
315                                                    Long.valueOf(passwordTrackerModelImpl.getOriginalUserId())
316                                            };
317    
318                                    FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_USERID, args);
319                                    FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_USERID,
320                                            args);
321    
322                                    args = new Object[] {
323                                                    Long.valueOf(passwordTrackerModelImpl.getUserId())
324                                            };
325    
326                                    FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_USERID, args);
327                                    FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_USERID,
328                                            args);
329                            }
330                    }
331    
332                    EntityCacheUtil.putResult(PasswordTrackerModelImpl.ENTITY_CACHE_ENABLED,
333                            PasswordTrackerImpl.class, passwordTracker.getPrimaryKey(),
334                            passwordTracker);
335    
336                    return passwordTracker;
337            }
338    
339            protected PasswordTracker toUnwrappedModel(PasswordTracker passwordTracker) {
340                    if (passwordTracker instanceof PasswordTrackerImpl) {
341                            return passwordTracker;
342                    }
343    
344                    PasswordTrackerImpl passwordTrackerImpl = new PasswordTrackerImpl();
345    
346                    passwordTrackerImpl.setNew(passwordTracker.isNew());
347                    passwordTrackerImpl.setPrimaryKey(passwordTracker.getPrimaryKey());
348    
349                    passwordTrackerImpl.setPasswordTrackerId(passwordTracker.getPasswordTrackerId());
350                    passwordTrackerImpl.setUserId(passwordTracker.getUserId());
351                    passwordTrackerImpl.setCreateDate(passwordTracker.getCreateDate());
352                    passwordTrackerImpl.setPassword(passwordTracker.getPassword());
353    
354                    return passwordTrackerImpl;
355            }
356    
357            /**
358             * Returns the password tracker with the primary key or throws a {@link com.liferay.portal.NoSuchModelException} if it could not be found.
359             *
360             * @param primaryKey the primary key of the password tracker
361             * @return the password tracker
362             * @throws com.liferay.portal.NoSuchModelException if a password tracker with the primary key could not be found
363             * @throws SystemException if a system exception occurred
364             */
365            @Override
366            public PasswordTracker findByPrimaryKey(Serializable primaryKey)
367                    throws NoSuchModelException, SystemException {
368                    return findByPrimaryKey(((Long)primaryKey).longValue());
369            }
370    
371            /**
372             * Returns the password tracker with the primary key or throws a {@link com.liferay.portal.NoSuchPasswordTrackerException} if it could not be found.
373             *
374             * @param passwordTrackerId the primary key of the password tracker
375             * @return the password tracker
376             * @throws com.liferay.portal.NoSuchPasswordTrackerException if a password tracker with the primary key could not be found
377             * @throws SystemException if a system exception occurred
378             */
379            public PasswordTracker findByPrimaryKey(long passwordTrackerId)
380                    throws NoSuchPasswordTrackerException, SystemException {
381                    PasswordTracker passwordTracker = fetchByPrimaryKey(passwordTrackerId);
382    
383                    if (passwordTracker == null) {
384                            if (_log.isWarnEnabled()) {
385                                    _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + passwordTrackerId);
386                            }
387    
388                            throw new NoSuchPasswordTrackerException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
389                                    passwordTrackerId);
390                    }
391    
392                    return passwordTracker;
393            }
394    
395            /**
396             * Returns the password tracker with the primary key or returns <code>null</code> if it could not be found.
397             *
398             * @param primaryKey the primary key of the password tracker
399             * @return the password tracker, or <code>null</code> if a password tracker with the primary key could not be found
400             * @throws SystemException if a system exception occurred
401             */
402            @Override
403            public PasswordTracker fetchByPrimaryKey(Serializable primaryKey)
404                    throws SystemException {
405                    return fetchByPrimaryKey(((Long)primaryKey).longValue());
406            }
407    
408            /**
409             * Returns the password tracker with the primary key or returns <code>null</code> if it could not be found.
410             *
411             * @param passwordTrackerId the primary key of the password tracker
412             * @return the password tracker, or <code>null</code> if a password tracker with the primary key could not be found
413             * @throws SystemException if a system exception occurred
414             */
415            public PasswordTracker fetchByPrimaryKey(long passwordTrackerId)
416                    throws SystemException {
417                    PasswordTracker passwordTracker = (PasswordTracker)EntityCacheUtil.getResult(PasswordTrackerModelImpl.ENTITY_CACHE_ENABLED,
418                                    PasswordTrackerImpl.class, passwordTrackerId);
419    
420                    if (passwordTracker == _nullPasswordTracker) {
421                            return null;
422                    }
423    
424                    if (passwordTracker == null) {
425                            Session session = null;
426    
427                            boolean hasException = false;
428    
429                            try {
430                                    session = openSession();
431    
432                                    passwordTracker = (PasswordTracker)session.get(PasswordTrackerImpl.class,
433                                                    Long.valueOf(passwordTrackerId));
434                            }
435                            catch (Exception e) {
436                                    hasException = true;
437    
438                                    throw processException(e);
439                            }
440                            finally {
441                                    if (passwordTracker != null) {
442                                            cacheResult(passwordTracker);
443                                    }
444                                    else if (!hasException) {
445                                            EntityCacheUtil.putResult(PasswordTrackerModelImpl.ENTITY_CACHE_ENABLED,
446                                                    PasswordTrackerImpl.class, passwordTrackerId,
447                                                    _nullPasswordTracker);
448                                    }
449    
450                                    closeSession(session);
451                            }
452                    }
453    
454                    return passwordTracker;
455            }
456    
457            /**
458             * Returns all the password trackers where userId = &#63;.
459             *
460             * @param userId the user ID
461             * @return the matching password trackers
462             * @throws SystemException if a system exception occurred
463             */
464            public List<PasswordTracker> findByUserId(long userId)
465                    throws SystemException {
466                    return findByUserId(userId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
467            }
468    
469            /**
470             * Returns a range of all the password trackers where userId = &#63;.
471             *
472             * <p>
473             * 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.
474             * </p>
475             *
476             * @param userId the user ID
477             * @param start the lower bound of the range of password trackers
478             * @param end the upper bound of the range of password trackers (not inclusive)
479             * @return the range of matching password trackers
480             * @throws SystemException if a system exception occurred
481             */
482            public List<PasswordTracker> findByUserId(long userId, int start, int end)
483                    throws SystemException {
484                    return findByUserId(userId, start, end, null);
485            }
486    
487            /**
488             * Returns an ordered range of all the password trackers where userId = &#63;.
489             *
490             * <p>
491             * 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.
492             * </p>
493             *
494             * @param userId the user ID
495             * @param start the lower bound of the range of password trackers
496             * @param end the upper bound of the range of password trackers (not inclusive)
497             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
498             * @return the ordered range of matching password trackers
499             * @throws SystemException if a system exception occurred
500             */
501            public List<PasswordTracker> findByUserId(long userId, int start, int end,
502                    OrderByComparator orderByComparator) throws SystemException {
503                    FinderPath finderPath = null;
504                    Object[] finderArgs = null;
505    
506                    if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
507                                    (orderByComparator == null)) {
508                            finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_USERID;
509                            finderArgs = new Object[] { userId };
510                    }
511                    else {
512                            finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_USERID;
513                            finderArgs = new Object[] { userId, start, end, orderByComparator };
514                    }
515    
516                    List<PasswordTracker> list = (List<PasswordTracker>)FinderCacheUtil.getResult(finderPath,
517                                    finderArgs, this);
518    
519                    if (list == null) {
520                            StringBundler query = null;
521    
522                            if (orderByComparator != null) {
523                                    query = new StringBundler(3 +
524                                                    (orderByComparator.getOrderByFields().length * 3));
525                            }
526                            else {
527                                    query = new StringBundler(3);
528                            }
529    
530                            query.append(_SQL_SELECT_PASSWORDTRACKER_WHERE);
531    
532                            query.append(_FINDER_COLUMN_USERID_USERID_2);
533    
534                            if (orderByComparator != null) {
535                                    appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
536                                            orderByComparator);
537                            }
538    
539                            else {
540                                    query.append(PasswordTrackerModelImpl.ORDER_BY_JPQL);
541                            }
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(userId);
555    
556                                    list = (List<PasswordTracker>)QueryUtil.list(q, getDialect(),
557                                                    start, end);
558                            }
559                            catch (Exception e) {
560                                    throw processException(e);
561                            }
562                            finally {
563                                    if (list == null) {
564                                            FinderCacheUtil.removeResult(finderPath, finderArgs);
565                                    }
566                                    else {
567                                            cacheResult(list);
568    
569                                            FinderCacheUtil.putResult(finderPath, finderArgs, list);
570                                    }
571    
572                                    closeSession(session);
573                            }
574                    }
575    
576                    return list;
577            }
578    
579            /**
580             * Returns the first password tracker in the ordered set where userId = &#63;.
581             *
582             * <p>
583             * 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.
584             * </p>
585             *
586             * @param userId the user ID
587             * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
588             * @return the first matching password tracker
589             * @throws com.liferay.portal.NoSuchPasswordTrackerException if a matching password tracker could not be found
590             * @throws SystemException if a system exception occurred
591             */
592            public PasswordTracker findByUserId_First(long userId,
593                    OrderByComparator orderByComparator)
594                    throws NoSuchPasswordTrackerException, SystemException {
595                    List<PasswordTracker> list = findByUserId(userId, 0, 1,
596                                    orderByComparator);
597    
598                    if (list.isEmpty()) {
599                            StringBundler msg = new StringBundler(4);
600    
601                            msg.append(_NO_SUCH_ENTITY_WITH_KEY);
602    
603                            msg.append("userId=");
604                            msg.append(userId);
605    
606                            msg.append(StringPool.CLOSE_CURLY_BRACE);
607    
608                            throw new NoSuchPasswordTrackerException(msg.toString());
609                    }
610                    else {
611                            return list.get(0);
612                    }
613            }
614    
615            /**
616             * Returns the last password tracker in the ordered set where userId = &#63;.
617             *
618             * <p>
619             * 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.
620             * </p>
621             *
622             * @param userId the user ID
623             * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
624             * @return the last matching password tracker
625             * @throws com.liferay.portal.NoSuchPasswordTrackerException if a matching password tracker could not be found
626             * @throws SystemException if a system exception occurred
627             */
628            public PasswordTracker findByUserId_Last(long userId,
629                    OrderByComparator orderByComparator)
630                    throws NoSuchPasswordTrackerException, SystemException {
631                    int count = countByUserId(userId);
632    
633                    List<PasswordTracker> list = findByUserId(userId, count - 1, count,
634                                    orderByComparator);
635    
636                    if (list.isEmpty()) {
637                            StringBundler msg = new StringBundler(4);
638    
639                            msg.append(_NO_SUCH_ENTITY_WITH_KEY);
640    
641                            msg.append("userId=");
642                            msg.append(userId);
643    
644                            msg.append(StringPool.CLOSE_CURLY_BRACE);
645    
646                            throw new NoSuchPasswordTrackerException(msg.toString());
647                    }
648                    else {
649                            return list.get(0);
650                    }
651            }
652    
653            /**
654             * Returns the password trackers before and after the current password tracker in the ordered set where userId = &#63;.
655             *
656             * <p>
657             * 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.
658             * </p>
659             *
660             * @param passwordTrackerId the primary key of the current password tracker
661             * @param userId the user ID
662             * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
663             * @return the previous, current, and next password tracker
664             * @throws com.liferay.portal.NoSuchPasswordTrackerException if a password tracker with the primary key could not be found
665             * @throws SystemException if a system exception occurred
666             */
667            public PasswordTracker[] findByUserId_PrevAndNext(long passwordTrackerId,
668                    long userId, OrderByComparator orderByComparator)
669                    throws NoSuchPasswordTrackerException, SystemException {
670                    PasswordTracker passwordTracker = findByPrimaryKey(passwordTrackerId);
671    
672                    Session session = null;
673    
674                    try {
675                            session = openSession();
676    
677                            PasswordTracker[] array = new PasswordTrackerImpl[3];
678    
679                            array[0] = getByUserId_PrevAndNext(session, passwordTracker,
680                                            userId, orderByComparator, true);
681    
682                            array[1] = passwordTracker;
683    
684                            array[2] = getByUserId_PrevAndNext(session, passwordTracker,
685                                            userId, orderByComparator, false);
686    
687                            return array;
688                    }
689                    catch (Exception e) {
690                            throw processException(e);
691                    }
692                    finally {
693                            closeSession(session);
694                    }
695            }
696    
697            protected PasswordTracker getByUserId_PrevAndNext(Session session,
698                    PasswordTracker passwordTracker, long userId,
699                    OrderByComparator orderByComparator, boolean previous) {
700                    StringBundler query = null;
701    
702                    if (orderByComparator != null) {
703                            query = new StringBundler(6 +
704                                            (orderByComparator.getOrderByFields().length * 6));
705                    }
706                    else {
707                            query = new StringBundler(3);
708                    }
709    
710                    query.append(_SQL_SELECT_PASSWORDTRACKER_WHERE);
711    
712                    query.append(_FINDER_COLUMN_USERID_USERID_2);
713    
714                    if (orderByComparator != null) {
715                            String[] orderByConditionFields = orderByComparator.getOrderByConditionFields();
716    
717                            if (orderByConditionFields.length > 0) {
718                                    query.append(WHERE_AND);
719                            }
720    
721                            for (int i = 0; i < orderByConditionFields.length; i++) {
722                                    query.append(_ORDER_BY_ENTITY_ALIAS);
723                                    query.append(orderByConditionFields[i]);
724    
725                                    if ((i + 1) < orderByConditionFields.length) {
726                                            if (orderByComparator.isAscending() ^ previous) {
727                                                    query.append(WHERE_GREATER_THAN_HAS_NEXT);
728                                            }
729                                            else {
730                                                    query.append(WHERE_LESSER_THAN_HAS_NEXT);
731                                            }
732                                    }
733                                    else {
734                                            if (orderByComparator.isAscending() ^ previous) {
735                                                    query.append(WHERE_GREATER_THAN);
736                                            }
737                                            else {
738                                                    query.append(WHERE_LESSER_THAN);
739                                            }
740                                    }
741                            }
742    
743                            query.append(ORDER_BY_CLAUSE);
744    
745                            String[] orderByFields = orderByComparator.getOrderByFields();
746    
747                            for (int i = 0; i < orderByFields.length; i++) {
748                                    query.append(_ORDER_BY_ENTITY_ALIAS);
749                                    query.append(orderByFields[i]);
750    
751                                    if ((i + 1) < orderByFields.length) {
752                                            if (orderByComparator.isAscending() ^ previous) {
753                                                    query.append(ORDER_BY_ASC_HAS_NEXT);
754                                            }
755                                            else {
756                                                    query.append(ORDER_BY_DESC_HAS_NEXT);
757                                            }
758                                    }
759                                    else {
760                                            if (orderByComparator.isAscending() ^ previous) {
761                                                    query.append(ORDER_BY_ASC);
762                                            }
763                                            else {
764                                                    query.append(ORDER_BY_DESC);
765                                            }
766                                    }
767                            }
768                    }
769    
770                    else {
771                            query.append(PasswordTrackerModelImpl.ORDER_BY_JPQL);
772                    }
773    
774                    String sql = query.toString();
775    
776                    Query q = session.createQuery(sql);
777    
778                    q.setFirstResult(0);
779                    q.setMaxResults(2);
780    
781                    QueryPos qPos = QueryPos.getInstance(q);
782    
783                    qPos.add(userId);
784    
785                    if (orderByComparator != null) {
786                            Object[] values = orderByComparator.getOrderByConditionValues(passwordTracker);
787    
788                            for (Object value : values) {
789                                    qPos.add(value);
790                            }
791                    }
792    
793                    List<PasswordTracker> list = q.list();
794    
795                    if (list.size() == 2) {
796                            return list.get(1);
797                    }
798                    else {
799                            return null;
800                    }
801            }
802    
803            /**
804             * Returns all the password trackers.
805             *
806             * @return the password trackers
807             * @throws SystemException if a system exception occurred
808             */
809            public List<PasswordTracker> findAll() throws SystemException {
810                    return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
811            }
812    
813            /**
814             * Returns a range of all the password trackers.
815             *
816             * <p>
817             * 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.
818             * </p>
819             *
820             * @param start the lower bound of the range of password trackers
821             * @param end the upper bound of the range of password trackers (not inclusive)
822             * @return the range of password trackers
823             * @throws SystemException if a system exception occurred
824             */
825            public List<PasswordTracker> findAll(int start, int end)
826                    throws SystemException {
827                    return findAll(start, end, null);
828            }
829    
830            /**
831             * Returns an ordered range of all the password trackers.
832             *
833             * <p>
834             * 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.
835             * </p>
836             *
837             * @param start the lower bound of the range of password trackers
838             * @param end the upper bound of the range of password trackers (not inclusive)
839             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
840             * @return the ordered range of password trackers
841             * @throws SystemException if a system exception occurred
842             */
843            public List<PasswordTracker> findAll(int start, int end,
844                    OrderByComparator orderByComparator) throws SystemException {
845                    FinderPath finderPath = null;
846                    Object[] finderArgs = new Object[] { start, end, orderByComparator };
847    
848                    if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
849                                    (orderByComparator == null)) {
850                            finderPath = FINDER_PATH_WITH_PAGINATION_FIND_ALL;
851                            finderArgs = FINDER_ARGS_EMPTY;
852                    }
853                    else {
854                            finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL;
855                            finderArgs = new Object[] { start, end, orderByComparator };
856                    }
857    
858                    List<PasswordTracker> list = (List<PasswordTracker>)FinderCacheUtil.getResult(finderPath,
859                                    finderArgs, this);
860    
861                    if (list == null) {
862                            StringBundler query = null;
863                            String sql = null;
864    
865                            if (orderByComparator != null) {
866                                    query = new StringBundler(2 +
867                                                    (orderByComparator.getOrderByFields().length * 3));
868    
869                                    query.append(_SQL_SELECT_PASSWORDTRACKER);
870    
871                                    appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
872                                            orderByComparator);
873    
874                                    sql = query.toString();
875                            }
876                            else {
877                                    sql = _SQL_SELECT_PASSWORDTRACKER.concat(PasswordTrackerModelImpl.ORDER_BY_JPQL);
878                            }
879    
880                            Session session = null;
881    
882                            try {
883                                    session = openSession();
884    
885                                    Query q = session.createQuery(sql);
886    
887                                    if (orderByComparator == null) {
888                                            list = (List<PasswordTracker>)QueryUtil.list(q,
889                                                            getDialect(), start, end, false);
890    
891                                            Collections.sort(list);
892                                    }
893                                    else {
894                                            list = (List<PasswordTracker>)QueryUtil.list(q,
895                                                            getDialect(), start, end);
896                                    }
897                            }
898                            catch (Exception e) {
899                                    throw processException(e);
900                            }
901                            finally {
902                                    if (list == null) {
903                                            FinderCacheUtil.removeResult(finderPath, finderArgs);
904                                    }
905                                    else {
906                                            cacheResult(list);
907    
908                                            FinderCacheUtil.putResult(finderPath, finderArgs, list);
909                                    }
910    
911                                    closeSession(session);
912                            }
913                    }
914    
915                    return list;
916            }
917    
918            /**
919             * Removes all the password trackers where userId = &#63; from the database.
920             *
921             * @param userId the user ID
922             * @throws SystemException if a system exception occurred
923             */
924            public void removeByUserId(long userId) throws SystemException {
925                    for (PasswordTracker passwordTracker : findByUserId(userId)) {
926                            remove(passwordTracker);
927                    }
928            }
929    
930            /**
931             * Removes all the password trackers from the database.
932             *
933             * @throws SystemException if a system exception occurred
934             */
935            public void removeAll() throws SystemException {
936                    for (PasswordTracker passwordTracker : findAll()) {
937                            remove(passwordTracker);
938                    }
939            }
940    
941            /**
942             * Returns the number of password trackers where userId = &#63;.
943             *
944             * @param userId the user ID
945             * @return the number of matching password trackers
946             * @throws SystemException if a system exception occurred
947             */
948            public int countByUserId(long userId) throws SystemException {
949                    Object[] finderArgs = new Object[] { userId };
950    
951                    Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_USERID,
952                                    finderArgs, this);
953    
954                    if (count == null) {
955                            StringBundler query = new StringBundler(2);
956    
957                            query.append(_SQL_COUNT_PASSWORDTRACKER_WHERE);
958    
959                            query.append(_FINDER_COLUMN_USERID_USERID_2);
960    
961                            String sql = query.toString();
962    
963                            Session session = null;
964    
965                            try {
966                                    session = openSession();
967    
968                                    Query q = session.createQuery(sql);
969    
970                                    QueryPos qPos = QueryPos.getInstance(q);
971    
972                                    qPos.add(userId);
973    
974                                    count = (Long)q.uniqueResult();
975                            }
976                            catch (Exception e) {
977                                    throw processException(e);
978                            }
979                            finally {
980                                    if (count == null) {
981                                            count = Long.valueOf(0);
982                                    }
983    
984                                    FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_USERID,
985                                            finderArgs, count);
986    
987                                    closeSession(session);
988                            }
989                    }
990    
991                    return count.intValue();
992            }
993    
994            /**
995             * Returns the number of password trackers.
996             *
997             * @return the number of password trackers
998             * @throws SystemException if a system exception occurred
999             */
1000            public int countAll() throws SystemException {
1001                    Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
1002                                    FINDER_ARGS_EMPTY, this);
1003    
1004                    if (count == null) {
1005                            Session session = null;
1006    
1007                            try {
1008                                    session = openSession();
1009    
1010                                    Query q = session.createQuery(_SQL_COUNT_PASSWORDTRACKER);
1011    
1012                                    count = (Long)q.uniqueResult();
1013                            }
1014                            catch (Exception e) {
1015                                    throw processException(e);
1016                            }
1017                            finally {
1018                                    if (count == null) {
1019                                            count = Long.valueOf(0);
1020                                    }
1021    
1022                                    FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL,
1023                                            FINDER_ARGS_EMPTY, count);
1024    
1025                                    closeSession(session);
1026                            }
1027                    }
1028    
1029                    return count.intValue();
1030            }
1031    
1032            /**
1033             * Initializes the password tracker persistence.
1034             */
1035            public void afterPropertiesSet() {
1036                    String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
1037                                            com.liferay.portal.util.PropsUtil.get(
1038                                                    "value.object.listener.com.liferay.portal.model.PasswordTracker")));
1039    
1040                    if (listenerClassNames.length > 0) {
1041                            try {
1042                                    List<ModelListener<PasswordTracker>> listenersList = new ArrayList<ModelListener<PasswordTracker>>();
1043    
1044                                    for (String listenerClassName : listenerClassNames) {
1045                                            listenersList.add((ModelListener<PasswordTracker>)InstanceFactory.newInstance(
1046                                                            listenerClassName));
1047                                    }
1048    
1049                                    listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
1050                            }
1051                            catch (Exception e) {
1052                                    _log.error(e);
1053                            }
1054                    }
1055            }
1056    
1057            public void destroy() {
1058                    EntityCacheUtil.removeCache(PasswordTrackerImpl.class.getName());
1059                    FinderCacheUtil.removeCache(FINDER_CLASS_NAME_ENTITY);
1060                    FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
1061            }
1062    
1063            @BeanReference(type = AccountPersistence.class)
1064            protected AccountPersistence accountPersistence;
1065            @BeanReference(type = AddressPersistence.class)
1066            protected AddressPersistence addressPersistence;
1067            @BeanReference(type = BrowserTrackerPersistence.class)
1068            protected BrowserTrackerPersistence browserTrackerPersistence;
1069            @BeanReference(type = ClassNamePersistence.class)
1070            protected ClassNamePersistence classNamePersistence;
1071            @BeanReference(type = ClusterGroupPersistence.class)
1072            protected ClusterGroupPersistence clusterGroupPersistence;
1073            @BeanReference(type = CompanyPersistence.class)
1074            protected CompanyPersistence companyPersistence;
1075            @BeanReference(type = ContactPersistence.class)
1076            protected ContactPersistence contactPersistence;
1077            @BeanReference(type = CountryPersistence.class)
1078            protected CountryPersistence countryPersistence;
1079            @BeanReference(type = EmailAddressPersistence.class)
1080            protected EmailAddressPersistence emailAddressPersistence;
1081            @BeanReference(type = GroupPersistence.class)
1082            protected GroupPersistence groupPersistence;
1083            @BeanReference(type = ImagePersistence.class)
1084            protected ImagePersistence imagePersistence;
1085            @BeanReference(type = LayoutPersistence.class)
1086            protected LayoutPersistence layoutPersistence;
1087            @BeanReference(type = LayoutBranchPersistence.class)
1088            protected LayoutBranchPersistence layoutBranchPersistence;
1089            @BeanReference(type = LayoutPrototypePersistence.class)
1090            protected LayoutPrototypePersistence layoutPrototypePersistence;
1091            @BeanReference(type = LayoutRevisionPersistence.class)
1092            protected LayoutRevisionPersistence layoutRevisionPersistence;
1093            @BeanReference(type = LayoutSetPersistence.class)
1094            protected LayoutSetPersistence layoutSetPersistence;
1095            @BeanReference(type = LayoutSetBranchPersistence.class)
1096            protected LayoutSetBranchPersistence layoutSetBranchPersistence;
1097            @BeanReference(type = LayoutSetPrototypePersistence.class)
1098            protected LayoutSetPrototypePersistence layoutSetPrototypePersistence;
1099            @BeanReference(type = ListTypePersistence.class)
1100            protected ListTypePersistence listTypePersistence;
1101            @BeanReference(type = LockPersistence.class)
1102            protected LockPersistence lockPersistence;
1103            @BeanReference(type = MembershipRequestPersistence.class)
1104            protected MembershipRequestPersistence membershipRequestPersistence;
1105            @BeanReference(type = OrganizationPersistence.class)
1106            protected OrganizationPersistence organizationPersistence;
1107            @BeanReference(type = OrgGroupPermissionPersistence.class)
1108            protected OrgGroupPermissionPersistence orgGroupPermissionPersistence;
1109            @BeanReference(type = OrgGroupRolePersistence.class)
1110            protected OrgGroupRolePersistence orgGroupRolePersistence;
1111            @BeanReference(type = OrgLaborPersistence.class)
1112            protected OrgLaborPersistence orgLaborPersistence;
1113            @BeanReference(type = PasswordPolicyPersistence.class)
1114            protected PasswordPolicyPersistence passwordPolicyPersistence;
1115            @BeanReference(type = PasswordPolicyRelPersistence.class)
1116            protected PasswordPolicyRelPersistence passwordPolicyRelPersistence;
1117            @BeanReference(type = PasswordTrackerPersistence.class)
1118            protected PasswordTrackerPersistence passwordTrackerPersistence;
1119            @BeanReference(type = PermissionPersistence.class)
1120            protected PermissionPersistence permissionPersistence;
1121            @BeanReference(type = PhonePersistence.class)
1122            protected PhonePersistence phonePersistence;
1123            @BeanReference(type = PluginSettingPersistence.class)
1124            protected PluginSettingPersistence pluginSettingPersistence;
1125            @BeanReference(type = PortalPreferencesPersistence.class)
1126            protected PortalPreferencesPersistence portalPreferencesPersistence;
1127            @BeanReference(type = PortletPersistence.class)
1128            protected PortletPersistence portletPersistence;
1129            @BeanReference(type = PortletItemPersistence.class)
1130            protected PortletItemPersistence portletItemPersistence;
1131            @BeanReference(type = PortletPreferencesPersistence.class)
1132            protected PortletPreferencesPersistence portletPreferencesPersistence;
1133            @BeanReference(type = RegionPersistence.class)
1134            protected RegionPersistence regionPersistence;
1135            @BeanReference(type = ReleasePersistence.class)
1136            protected ReleasePersistence releasePersistence;
1137            @BeanReference(type = RepositoryPersistence.class)
1138            protected RepositoryPersistence repositoryPersistence;
1139            @BeanReference(type = RepositoryEntryPersistence.class)
1140            protected RepositoryEntryPersistence repositoryEntryPersistence;
1141            @BeanReference(type = ResourcePersistence.class)
1142            protected ResourcePersistence resourcePersistence;
1143            @BeanReference(type = ResourceActionPersistence.class)
1144            protected ResourceActionPersistence resourceActionPersistence;
1145            @BeanReference(type = ResourceBlockPersistence.class)
1146            protected ResourceBlockPersistence resourceBlockPersistence;
1147            @BeanReference(type = ResourceBlockPermissionPersistence.class)
1148            protected ResourceBlockPermissionPersistence resourceBlockPermissionPersistence;
1149            @BeanReference(type = ResourceCodePersistence.class)
1150            protected ResourceCodePersistence resourceCodePersistence;
1151            @BeanReference(type = ResourcePermissionPersistence.class)
1152            protected ResourcePermissionPersistence resourcePermissionPersistence;
1153            @BeanReference(type = ResourceTypePermissionPersistence.class)
1154            protected ResourceTypePermissionPersistence resourceTypePermissionPersistence;
1155            @BeanReference(type = RolePersistence.class)
1156            protected RolePersistence rolePersistence;
1157            @BeanReference(type = ServiceComponentPersistence.class)
1158            protected ServiceComponentPersistence serviceComponentPersistence;
1159            @BeanReference(type = ShardPersistence.class)
1160            protected ShardPersistence shardPersistence;
1161            @BeanReference(type = SubscriptionPersistence.class)
1162            protected SubscriptionPersistence subscriptionPersistence;
1163            @BeanReference(type = TeamPersistence.class)
1164            protected TeamPersistence teamPersistence;
1165            @BeanReference(type = TicketPersistence.class)
1166            protected TicketPersistence ticketPersistence;
1167            @BeanReference(type = UserPersistence.class)
1168            protected UserPersistence userPersistence;
1169            @BeanReference(type = UserGroupPersistence.class)
1170            protected UserGroupPersistence userGroupPersistence;
1171            @BeanReference(type = UserGroupGroupRolePersistence.class)
1172            protected UserGroupGroupRolePersistence userGroupGroupRolePersistence;
1173            @BeanReference(type = UserGroupRolePersistence.class)
1174            protected UserGroupRolePersistence userGroupRolePersistence;
1175            @BeanReference(type = UserIdMapperPersistence.class)
1176            protected UserIdMapperPersistence userIdMapperPersistence;
1177            @BeanReference(type = UserNotificationEventPersistence.class)
1178            protected UserNotificationEventPersistence userNotificationEventPersistence;
1179            @BeanReference(type = UserTrackerPersistence.class)
1180            protected UserTrackerPersistence userTrackerPersistence;
1181            @BeanReference(type = UserTrackerPathPersistence.class)
1182            protected UserTrackerPathPersistence userTrackerPathPersistence;
1183            @BeanReference(type = VirtualHostPersistence.class)
1184            protected VirtualHostPersistence virtualHostPersistence;
1185            @BeanReference(type = WebDAVPropsPersistence.class)
1186            protected WebDAVPropsPersistence webDAVPropsPersistence;
1187            @BeanReference(type = WebsitePersistence.class)
1188            protected WebsitePersistence websitePersistence;
1189            @BeanReference(type = WorkflowDefinitionLinkPersistence.class)
1190            protected WorkflowDefinitionLinkPersistence workflowDefinitionLinkPersistence;
1191            @BeanReference(type = WorkflowInstanceLinkPersistence.class)
1192            protected WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence;
1193            private static final String _SQL_SELECT_PASSWORDTRACKER = "SELECT passwordTracker FROM PasswordTracker passwordTracker";
1194            private static final String _SQL_SELECT_PASSWORDTRACKER_WHERE = "SELECT passwordTracker FROM PasswordTracker passwordTracker WHERE ";
1195            private static final String _SQL_COUNT_PASSWORDTRACKER = "SELECT COUNT(passwordTracker) FROM PasswordTracker passwordTracker";
1196            private static final String _SQL_COUNT_PASSWORDTRACKER_WHERE = "SELECT COUNT(passwordTracker) FROM PasswordTracker passwordTracker WHERE ";
1197            private static final String _FINDER_COLUMN_USERID_USERID_2 = "passwordTracker.userId = ?";
1198            private static final String _ORDER_BY_ENTITY_ALIAS = "passwordTracker.";
1199            private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No PasswordTracker exists with the primary key ";
1200            private static final String _NO_SUCH_ENTITY_WITH_KEY = "No PasswordTracker exists with the key {";
1201            private static final boolean _HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE = com.liferay.portal.util.PropsValues.HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE;
1202            private static Log _log = LogFactoryUtil.getLog(PasswordTrackerPersistenceImpl.class);
1203            private static PasswordTracker _nullPasswordTracker = new PasswordTrackerImpl() {
1204                            @Override
1205                            public Object clone() {
1206                                    return this;
1207                            }
1208    
1209                            @Override
1210                            public CacheModel<PasswordTracker> toCacheModel() {
1211                                    return _nullPasswordTrackerCacheModel;
1212                            }
1213                    };
1214    
1215            private static CacheModel<PasswordTracker> _nullPasswordTrackerCacheModel = new CacheModel<PasswordTracker>() {
1216                            public PasswordTracker toEntityModel() {
1217                                    return _nullPasswordTracker;
1218                            }
1219                    };
1220    }