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