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