001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import com.liferay.portal.NoSuchModelException;
018    import com.liferay.portal.NoSuchPasswordPolicyRelException;
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.PasswordPolicyRel;
040    import com.liferay.portal.model.impl.PasswordPolicyRelImpl;
041    import com.liferay.portal.model.impl.PasswordPolicyRelModelImpl;
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 rel 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 PasswordPolicyRelPersistence
059     * @see PasswordPolicyRelUtil
060     * @generated
061     */
062    public class PasswordPolicyRelPersistenceImpl extends BasePersistenceImpl<PasswordPolicyRel>
063            implements PasswordPolicyRelPersistence {
064            /*
065             * NOTE FOR DEVELOPERS:
066             *
067             * Never modify or reference this class directly. Always use {@link PasswordPolicyRelUtil} to access the password policy rel persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
068             */
069            public static final String FINDER_CLASS_NAME_ENTITY = PasswordPolicyRelImpl.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_PASSWORDPOLICYID =
075                    new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
076                            PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED,
077                            PasswordPolicyRelImpl.class,
078                            FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findByPasswordPolicyId",
079                            new String[] {
080                                    Long.class.getName(),
081                                    
082                            "java.lang.Integer", "java.lang.Integer",
083                                    "com.liferay.portal.kernel.util.OrderByComparator"
084                            });
085            public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_PASSWORDPOLICYID =
086                    new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
087                            PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED,
088                            PasswordPolicyRelImpl.class,
089                            FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION,
090                            "findByPasswordPolicyId", new String[] { Long.class.getName() },
091                            PasswordPolicyRelModelImpl.PASSWORDPOLICYID_COLUMN_BITMASK);
092            public static final FinderPath FINDER_PATH_COUNT_BY_PASSWORDPOLICYID = new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
093                            PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED, Long.class,
094                            FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION,
095                            "countByPasswordPolicyId", new String[] { Long.class.getName() });
096            public static final FinderPath FINDER_PATH_FETCH_BY_C_C = new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
097                            PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED,
098                            PasswordPolicyRelImpl.class, FINDER_CLASS_NAME_ENTITY,
099                            "fetchByC_C",
100                            new String[] { Long.class.getName(), Long.class.getName() },
101                            PasswordPolicyRelModelImpl.CLASSNAMEID_COLUMN_BITMASK |
102                            PasswordPolicyRelModelImpl.CLASSPK_COLUMN_BITMASK);
103            public static final FinderPath FINDER_PATH_COUNT_BY_C_C = new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
104                            PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED, Long.class,
105                            FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByC_C",
106                            new String[] { Long.class.getName(), Long.class.getName() });
107            public static final FinderPath FINDER_PATH_FETCH_BY_P_C_C = new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
108                            PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED,
109                            PasswordPolicyRelImpl.class, FINDER_CLASS_NAME_ENTITY,
110                            "fetchByP_C_C",
111                            new String[] {
112                                    Long.class.getName(), Long.class.getName(), Long.class.getName()
113                            },
114                            PasswordPolicyRelModelImpl.PASSWORDPOLICYID_COLUMN_BITMASK |
115                            PasswordPolicyRelModelImpl.CLASSNAMEID_COLUMN_BITMASK |
116                            PasswordPolicyRelModelImpl.CLASSPK_COLUMN_BITMASK);
117            public static final FinderPath FINDER_PATH_COUNT_BY_P_C_C = new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
118                            PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED, Long.class,
119                            FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByP_C_C",
120                            new String[] {
121                                    Long.class.getName(), Long.class.getName(), Long.class.getName()
122                            });
123            public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_ALL = new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
124                            PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED,
125                            PasswordPolicyRelImpl.class,
126                            FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findAll", new String[0]);
127            public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL = new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
128                            PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED,
129                            PasswordPolicyRelImpl.class,
130                            FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findAll", new String[0]);
131            public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
132                            PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED, Long.class,
133                            FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countAll", new String[0]);
134    
135            /**
136             * Caches the password policy rel in the entity cache if it is enabled.
137             *
138             * @param passwordPolicyRel the password policy rel
139             */
140            public void cacheResult(PasswordPolicyRel passwordPolicyRel) {
141                    EntityCacheUtil.putResult(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
142                            PasswordPolicyRelImpl.class, passwordPolicyRel.getPrimaryKey(),
143                            passwordPolicyRel);
144    
145                    FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_C,
146                            new Object[] {
147                                    Long.valueOf(passwordPolicyRel.getClassNameId()),
148                                    Long.valueOf(passwordPolicyRel.getClassPK())
149                            }, passwordPolicyRel);
150    
151                    FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_P_C_C,
152                            new Object[] {
153                                    Long.valueOf(passwordPolicyRel.getPasswordPolicyId()),
154                                    Long.valueOf(passwordPolicyRel.getClassNameId()),
155                                    Long.valueOf(passwordPolicyRel.getClassPK())
156                            }, passwordPolicyRel);
157    
158                    passwordPolicyRel.resetOriginalValues();
159            }
160    
161            /**
162             * Caches the password policy rels in the entity cache if it is enabled.
163             *
164             * @param passwordPolicyRels the password policy rels
165             */
166            public void cacheResult(List<PasswordPolicyRel> passwordPolicyRels) {
167                    for (PasswordPolicyRel passwordPolicyRel : passwordPolicyRels) {
168                            if (EntityCacheUtil.getResult(
169                                                    PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
170                                                    PasswordPolicyRelImpl.class,
171                                                    passwordPolicyRel.getPrimaryKey()) == null) {
172                                    cacheResult(passwordPolicyRel);
173                            }
174                            else {
175                                    passwordPolicyRel.resetOriginalValues();
176                            }
177                    }
178            }
179    
180            /**
181             * Clears the cache for all password policy rels.
182             *
183             * <p>
184             * The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method.
185             * </p>
186             */
187            @Override
188            public void clearCache() {
189                    if (_HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE) {
190                            CacheRegistryUtil.clear(PasswordPolicyRelImpl.class.getName());
191                    }
192    
193                    EntityCacheUtil.clearCache(PasswordPolicyRelImpl.class.getName());
194    
195                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
196                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
197                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
198            }
199    
200            /**
201             * Clears the cache for the password policy rel.
202             *
203             * <p>
204             * The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method.
205             * </p>
206             */
207            @Override
208            public void clearCache(PasswordPolicyRel passwordPolicyRel) {
209                    EntityCacheUtil.removeResult(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
210                            PasswordPolicyRelImpl.class, passwordPolicyRel.getPrimaryKey());
211    
212                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
213                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
214    
215                    clearUniqueFindersCache(passwordPolicyRel);
216            }
217    
218            @Override
219            public void clearCache(List<PasswordPolicyRel> passwordPolicyRels) {
220                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
221                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
222    
223                    for (PasswordPolicyRel passwordPolicyRel : passwordPolicyRels) {
224                            EntityCacheUtil.removeResult(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
225                                    PasswordPolicyRelImpl.class, passwordPolicyRel.getPrimaryKey());
226    
227                            clearUniqueFindersCache(passwordPolicyRel);
228                    }
229            }
230    
231            protected void clearUniqueFindersCache(PasswordPolicyRel passwordPolicyRel) {
232                    FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_C_C,
233                            new Object[] {
234                                    Long.valueOf(passwordPolicyRel.getClassNameId()),
235                                    Long.valueOf(passwordPolicyRel.getClassPK())
236                            });
237    
238                    FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_P_C_C,
239                            new Object[] {
240                                    Long.valueOf(passwordPolicyRel.getPasswordPolicyId()),
241                                    Long.valueOf(passwordPolicyRel.getClassNameId()),
242                                    Long.valueOf(passwordPolicyRel.getClassPK())
243                            });
244            }
245    
246            /**
247             * Creates a new password policy rel with the primary key. Does not add the password policy rel to the database.
248             *
249             * @param passwordPolicyRelId the primary key for the new password policy rel
250             * @return the new password policy rel
251             */
252            public PasswordPolicyRel create(long passwordPolicyRelId) {
253                    PasswordPolicyRel passwordPolicyRel = new PasswordPolicyRelImpl();
254    
255                    passwordPolicyRel.setNew(true);
256                    passwordPolicyRel.setPrimaryKey(passwordPolicyRelId);
257    
258                    return passwordPolicyRel;
259            }
260    
261            /**
262             * Removes the password policy rel with the primary key from the database. Also notifies the appropriate model listeners.
263             *
264             * @param passwordPolicyRelId the primary key of the password policy rel
265             * @return the password policy rel that was removed
266             * @throws com.liferay.portal.NoSuchPasswordPolicyRelException if a password policy rel with the primary key could not be found
267             * @throws SystemException if a system exception occurred
268             */
269            public PasswordPolicyRel remove(long passwordPolicyRelId)
270                    throws NoSuchPasswordPolicyRelException, SystemException {
271                    return remove(Long.valueOf(passwordPolicyRelId));
272            }
273    
274            /**
275             * Removes the password policy rel with the primary key from the database. Also notifies the appropriate model listeners.
276             *
277             * @param primaryKey the primary key of the password policy rel
278             * @return the password policy rel that was removed
279             * @throws com.liferay.portal.NoSuchPasswordPolicyRelException if a password policy rel with the primary key could not be found
280             * @throws SystemException if a system exception occurred
281             */
282            @Override
283            public PasswordPolicyRel remove(Serializable primaryKey)
284                    throws NoSuchPasswordPolicyRelException, SystemException {
285                    Session session = null;
286    
287                    try {
288                            session = openSession();
289    
290                            PasswordPolicyRel passwordPolicyRel = (PasswordPolicyRel)session.get(PasswordPolicyRelImpl.class,
291                                            primaryKey);
292    
293                            if (passwordPolicyRel == null) {
294                                    if (_log.isWarnEnabled()) {
295                                            _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
296                                    }
297    
298                                    throw new NoSuchPasswordPolicyRelException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
299                                            primaryKey);
300                            }
301    
302                            return remove(passwordPolicyRel);
303                    }
304                    catch (NoSuchPasswordPolicyRelException nsee) {
305                            throw nsee;
306                    }
307                    catch (Exception e) {
308                            throw processException(e);
309                    }
310                    finally {
311                            closeSession(session);
312                    }
313            }
314    
315            @Override
316            protected PasswordPolicyRel removeImpl(PasswordPolicyRel passwordPolicyRel)
317                    throws SystemException {
318                    passwordPolicyRel = toUnwrappedModel(passwordPolicyRel);
319    
320                    Session session = null;
321    
322                    try {
323                            session = openSession();
324    
325                            BatchSessionUtil.delete(session, passwordPolicyRel);
326                    }
327                    catch (Exception e) {
328                            throw processException(e);
329                    }
330                    finally {
331                            closeSession(session);
332                    }
333    
334                    clearCache(passwordPolicyRel);
335    
336                    return passwordPolicyRel;
337            }
338    
339            @Override
340            public PasswordPolicyRel updateImpl(
341                    com.liferay.portal.model.PasswordPolicyRel passwordPolicyRel,
342                    boolean merge) throws SystemException {
343                    passwordPolicyRel = toUnwrappedModel(passwordPolicyRel);
344    
345                    boolean isNew = passwordPolicyRel.isNew();
346    
347                    PasswordPolicyRelModelImpl passwordPolicyRelModelImpl = (PasswordPolicyRelModelImpl)passwordPolicyRel;
348    
349                    Session session = null;
350    
351                    try {
352                            session = openSession();
353    
354                            BatchSessionUtil.update(session, passwordPolicyRel, merge);
355    
356                            passwordPolicyRel.setNew(false);
357                    }
358                    catch (Exception e) {
359                            throw processException(e);
360                    }
361                    finally {
362                            closeSession(session);
363                    }
364    
365                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
366    
367                    if (isNew || !PasswordPolicyRelModelImpl.COLUMN_BITMASK_ENABLED) {
368                            FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
369                    }
370                    else {
371                            if ((passwordPolicyRelModelImpl.getColumnBitmask() &
372                                            FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_PASSWORDPOLICYID.getColumnBitmask()) != 0) {
373                                    Object[] args = new Object[] {
374                                                    Long.valueOf(passwordPolicyRelModelImpl.getOriginalPasswordPolicyId())
375                                            };
376    
377                                    FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_PASSWORDPOLICYID,
378                                            args);
379                                    FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_PASSWORDPOLICYID,
380                                            args);
381    
382                                    args = new Object[] {
383                                                    Long.valueOf(passwordPolicyRelModelImpl.getPasswordPolicyId())
384                                            };
385    
386                                    FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_PASSWORDPOLICYID,
387                                            args);
388                                    FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_PASSWORDPOLICYID,
389                                            args);
390                            }
391                    }
392    
393                    EntityCacheUtil.putResult(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
394                            PasswordPolicyRelImpl.class, passwordPolicyRel.getPrimaryKey(),
395                            passwordPolicyRel);
396    
397                    if (isNew) {
398                            FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_C,
399                                    new Object[] {
400                                            Long.valueOf(passwordPolicyRel.getClassNameId()),
401                                            Long.valueOf(passwordPolicyRel.getClassPK())
402                                    }, passwordPolicyRel);
403    
404                            FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_P_C_C,
405                                    new Object[] {
406                                            Long.valueOf(passwordPolicyRel.getPasswordPolicyId()),
407                                            Long.valueOf(passwordPolicyRel.getClassNameId()),
408                                            Long.valueOf(passwordPolicyRel.getClassPK())
409                                    }, passwordPolicyRel);
410                    }
411                    else {
412                            if ((passwordPolicyRelModelImpl.getColumnBitmask() &
413                                            FINDER_PATH_FETCH_BY_C_C.getColumnBitmask()) != 0) {
414                                    Object[] args = new Object[] {
415                                                    Long.valueOf(passwordPolicyRelModelImpl.getOriginalClassNameId()),
416                                                    Long.valueOf(passwordPolicyRelModelImpl.getOriginalClassPK())
417                                            };
418    
419                                    FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_C_C, args);
420                                    FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_C_C, args);
421    
422                                    FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_C,
423                                            new Object[] {
424                                                    Long.valueOf(passwordPolicyRel.getClassNameId()),
425                                                    Long.valueOf(passwordPolicyRel.getClassPK())
426                                            }, passwordPolicyRel);
427                            }
428    
429                            if ((passwordPolicyRelModelImpl.getColumnBitmask() &
430                                            FINDER_PATH_FETCH_BY_P_C_C.getColumnBitmask()) != 0) {
431                                    Object[] args = new Object[] {
432                                                    Long.valueOf(passwordPolicyRelModelImpl.getOriginalPasswordPolicyId()),
433                                                    Long.valueOf(passwordPolicyRelModelImpl.getOriginalClassNameId()),
434                                                    Long.valueOf(passwordPolicyRelModelImpl.getOriginalClassPK())
435                                            };
436    
437                                    FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_P_C_C, args);
438                                    FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_P_C_C, args);
439    
440                                    FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_P_C_C,
441                                            new Object[] {
442                                                    Long.valueOf(passwordPolicyRel.getPasswordPolicyId()),
443                                                    Long.valueOf(passwordPolicyRel.getClassNameId()),
444                                                    Long.valueOf(passwordPolicyRel.getClassPK())
445                                            }, passwordPolicyRel);
446                            }
447                    }
448    
449                    return passwordPolicyRel;
450            }
451    
452            protected PasswordPolicyRel toUnwrappedModel(
453                    PasswordPolicyRel passwordPolicyRel) {
454                    if (passwordPolicyRel instanceof PasswordPolicyRelImpl) {
455                            return passwordPolicyRel;
456                    }
457    
458                    PasswordPolicyRelImpl passwordPolicyRelImpl = new PasswordPolicyRelImpl();
459    
460                    passwordPolicyRelImpl.setNew(passwordPolicyRel.isNew());
461                    passwordPolicyRelImpl.setPrimaryKey(passwordPolicyRel.getPrimaryKey());
462    
463                    passwordPolicyRelImpl.setPasswordPolicyRelId(passwordPolicyRel.getPasswordPolicyRelId());
464                    passwordPolicyRelImpl.setPasswordPolicyId(passwordPolicyRel.getPasswordPolicyId());
465                    passwordPolicyRelImpl.setClassNameId(passwordPolicyRel.getClassNameId());
466                    passwordPolicyRelImpl.setClassPK(passwordPolicyRel.getClassPK());
467    
468                    return passwordPolicyRelImpl;
469            }
470    
471            /**
472             * Returns the password policy rel with the primary key or throws a {@link com.liferay.portal.NoSuchModelException} if it could not be found.
473             *
474             * @param primaryKey the primary key of the password policy rel
475             * @return the password policy rel
476             * @throws com.liferay.portal.NoSuchModelException if a password policy rel with the primary key could not be found
477             * @throws SystemException if a system exception occurred
478             */
479            @Override
480            public PasswordPolicyRel findByPrimaryKey(Serializable primaryKey)
481                    throws NoSuchModelException, SystemException {
482                    return findByPrimaryKey(((Long)primaryKey).longValue());
483            }
484    
485            /**
486             * Returns the password policy rel with the primary key or throws a {@link com.liferay.portal.NoSuchPasswordPolicyRelException} if it could not be found.
487             *
488             * @param passwordPolicyRelId the primary key of the password policy rel
489             * @return the password policy rel
490             * @throws com.liferay.portal.NoSuchPasswordPolicyRelException if a password policy rel with the primary key could not be found
491             * @throws SystemException if a system exception occurred
492             */
493            public PasswordPolicyRel findByPrimaryKey(long passwordPolicyRelId)
494                    throws NoSuchPasswordPolicyRelException, SystemException {
495                    PasswordPolicyRel passwordPolicyRel = fetchByPrimaryKey(passwordPolicyRelId);
496    
497                    if (passwordPolicyRel == null) {
498                            if (_log.isWarnEnabled()) {
499                                    _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
500                                            passwordPolicyRelId);
501                            }
502    
503                            throw new NoSuchPasswordPolicyRelException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
504                                    passwordPolicyRelId);
505                    }
506    
507                    return passwordPolicyRel;
508            }
509    
510            /**
511             * Returns the password policy rel with the primary key or returns <code>null</code> if it could not be found.
512             *
513             * @param primaryKey the primary key of the password policy rel
514             * @return the password policy rel, or <code>null</code> if a password policy rel with the primary key could not be found
515             * @throws SystemException if a system exception occurred
516             */
517            @Override
518            public PasswordPolicyRel fetchByPrimaryKey(Serializable primaryKey)
519                    throws SystemException {
520                    return fetchByPrimaryKey(((Long)primaryKey).longValue());
521            }
522    
523            /**
524             * Returns the password policy rel with the primary key or returns <code>null</code> if it could not be found.
525             *
526             * @param passwordPolicyRelId the primary key of the password policy rel
527             * @return the password policy rel, or <code>null</code> if a password policy rel with the primary key could not be found
528             * @throws SystemException if a system exception occurred
529             */
530            public PasswordPolicyRel fetchByPrimaryKey(long passwordPolicyRelId)
531                    throws SystemException {
532                    PasswordPolicyRel passwordPolicyRel = (PasswordPolicyRel)EntityCacheUtil.getResult(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
533                                    PasswordPolicyRelImpl.class, passwordPolicyRelId);
534    
535                    if (passwordPolicyRel == _nullPasswordPolicyRel) {
536                            return null;
537                    }
538    
539                    if (passwordPolicyRel == null) {
540                            Session session = null;
541    
542                            boolean hasException = false;
543    
544                            try {
545                                    session = openSession();
546    
547                                    passwordPolicyRel = (PasswordPolicyRel)session.get(PasswordPolicyRelImpl.class,
548                                                    Long.valueOf(passwordPolicyRelId));
549                            }
550                            catch (Exception e) {
551                                    hasException = true;
552    
553                                    throw processException(e);
554                            }
555                            finally {
556                                    if (passwordPolicyRel != null) {
557                                            cacheResult(passwordPolicyRel);
558                                    }
559                                    else if (!hasException) {
560                                            EntityCacheUtil.putResult(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
561                                                    PasswordPolicyRelImpl.class, passwordPolicyRelId,
562                                                    _nullPasswordPolicyRel);
563                                    }
564    
565                                    closeSession(session);
566                            }
567                    }
568    
569                    return passwordPolicyRel;
570            }
571    
572            /**
573             * Returns all the password policy rels where passwordPolicyId = &#63;.
574             *
575             * @param passwordPolicyId the password policy ID
576             * @return the matching password policy rels
577             * @throws SystemException if a system exception occurred
578             */
579            public List<PasswordPolicyRel> findByPasswordPolicyId(long passwordPolicyId)
580                    throws SystemException {
581                    return findByPasswordPolicyId(passwordPolicyId, QueryUtil.ALL_POS,
582                            QueryUtil.ALL_POS, null);
583            }
584    
585            /**
586             * Returns a range of all the password policy rels where passwordPolicyId = &#63;.
587             *
588             * <p>
589             * 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.
590             * </p>
591             *
592             * @param passwordPolicyId the password policy ID
593             * @param start the lower bound of the range of password policy rels
594             * @param end the upper bound of the range of password policy rels (not inclusive)
595             * @return the range of matching password policy rels
596             * @throws SystemException if a system exception occurred
597             */
598            public List<PasswordPolicyRel> findByPasswordPolicyId(
599                    long passwordPolicyId, int start, int end) throws SystemException {
600                    return findByPasswordPolicyId(passwordPolicyId, start, end, null);
601            }
602    
603            /**
604             * Returns an ordered range of all the password policy rels where passwordPolicyId = &#63;.
605             *
606             * <p>
607             * 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.
608             * </p>
609             *
610             * @param passwordPolicyId the password policy ID
611             * @param start the lower bound of the range of password policy rels
612             * @param end the upper bound of the range of password policy rels (not inclusive)
613             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
614             * @return the ordered range of matching password policy rels
615             * @throws SystemException if a system exception occurred
616             */
617            public List<PasswordPolicyRel> findByPasswordPolicyId(
618                    long passwordPolicyId, int start, int end,
619                    OrderByComparator orderByComparator) throws SystemException {
620                    FinderPath finderPath = null;
621                    Object[] finderArgs = null;
622    
623                    if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
624                                    (orderByComparator == null)) {
625                            finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_PASSWORDPOLICYID;
626                            finderArgs = new Object[] { passwordPolicyId };
627                    }
628                    else {
629                            finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_PASSWORDPOLICYID;
630                            finderArgs = new Object[] {
631                                            passwordPolicyId,
632                                            
633                                            start, end, orderByComparator
634                                    };
635                    }
636    
637                    List<PasswordPolicyRel> list = (List<PasswordPolicyRel>)FinderCacheUtil.getResult(finderPath,
638                                    finderArgs, this);
639    
640                    if ((list != null) && !list.isEmpty()) {
641                            for (PasswordPolicyRel passwordPolicyRel : list) {
642                                    if ((passwordPolicyId != passwordPolicyRel.getPasswordPolicyId())) {
643                                            list = null;
644    
645                                            break;
646                                    }
647                            }
648                    }
649    
650                    if (list == null) {
651                            StringBundler query = null;
652    
653                            if (orderByComparator != null) {
654                                    query = new StringBundler(3 +
655                                                    (orderByComparator.getOrderByFields().length * 3));
656                            }
657                            else {
658                                    query = new StringBundler(2);
659                            }
660    
661                            query.append(_SQL_SELECT_PASSWORDPOLICYREL_WHERE);
662    
663                            query.append(_FINDER_COLUMN_PASSWORDPOLICYID_PASSWORDPOLICYID_2);
664    
665                            if (orderByComparator != null) {
666                                    appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
667                                            orderByComparator);
668                            }
669    
670                            String sql = query.toString();
671    
672                            Session session = null;
673    
674                            try {
675                                    session = openSession();
676    
677                                    Query q = session.createQuery(sql);
678    
679                                    QueryPos qPos = QueryPos.getInstance(q);
680    
681                                    qPos.add(passwordPolicyId);
682    
683                                    list = (List<PasswordPolicyRel>)QueryUtil.list(q, getDialect(),
684                                                    start, end);
685                            }
686                            catch (Exception e) {
687                                    throw processException(e);
688                            }
689                            finally {
690                                    if (list == null) {
691                                            FinderCacheUtil.removeResult(finderPath, finderArgs);
692                                    }
693                                    else {
694                                            cacheResult(list);
695    
696                                            FinderCacheUtil.putResult(finderPath, finderArgs, list);
697                                    }
698    
699                                    closeSession(session);
700                            }
701                    }
702    
703                    return list;
704            }
705    
706            /**
707             * Returns the first password policy rel in the ordered set where passwordPolicyId = &#63;.
708             *
709             * <p>
710             * 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.
711             * </p>
712             *
713             * @param passwordPolicyId the password policy ID
714             * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
715             * @return the first matching password policy rel
716             * @throws com.liferay.portal.NoSuchPasswordPolicyRelException if a matching password policy rel could not be found
717             * @throws SystemException if a system exception occurred
718             */
719            public PasswordPolicyRel findByPasswordPolicyId_First(
720                    long passwordPolicyId, OrderByComparator orderByComparator)
721                    throws NoSuchPasswordPolicyRelException, SystemException {
722                    List<PasswordPolicyRel> list = findByPasswordPolicyId(passwordPolicyId,
723                                    0, 1, orderByComparator);
724    
725                    if (list.isEmpty()) {
726                            StringBundler msg = new StringBundler(4);
727    
728                            msg.append(_NO_SUCH_ENTITY_WITH_KEY);
729    
730                            msg.append("passwordPolicyId=");
731                            msg.append(passwordPolicyId);
732    
733                            msg.append(StringPool.CLOSE_CURLY_BRACE);
734    
735                            throw new NoSuchPasswordPolicyRelException(msg.toString());
736                    }
737                    else {
738                            return list.get(0);
739                    }
740            }
741    
742            /**
743             * Returns the last password policy rel in the ordered set where passwordPolicyId = &#63;.
744             *
745             * <p>
746             * 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.
747             * </p>
748             *
749             * @param passwordPolicyId the password policy ID
750             * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
751             * @return the last matching password policy rel
752             * @throws com.liferay.portal.NoSuchPasswordPolicyRelException if a matching password policy rel could not be found
753             * @throws SystemException if a system exception occurred
754             */
755            public PasswordPolicyRel findByPasswordPolicyId_Last(
756                    long passwordPolicyId, OrderByComparator orderByComparator)
757                    throws NoSuchPasswordPolicyRelException, SystemException {
758                    int count = countByPasswordPolicyId(passwordPolicyId);
759    
760                    List<PasswordPolicyRel> list = findByPasswordPolicyId(passwordPolicyId,
761                                    count - 1, count, orderByComparator);
762    
763                    if (list.isEmpty()) {
764                            StringBundler msg = new StringBundler(4);
765    
766                            msg.append(_NO_SUCH_ENTITY_WITH_KEY);
767    
768                            msg.append("passwordPolicyId=");
769                            msg.append(passwordPolicyId);
770    
771                            msg.append(StringPool.CLOSE_CURLY_BRACE);
772    
773                            throw new NoSuchPasswordPolicyRelException(msg.toString());
774                    }
775                    else {
776                            return list.get(0);
777                    }
778            }
779    
780            /**
781             * Returns the password policy rels before and after the current password policy rel in the ordered set where passwordPolicyId = &#63;.
782             *
783             * <p>
784             * 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.
785             * </p>
786             *
787             * @param passwordPolicyRelId the primary key of the current password policy rel
788             * @param passwordPolicyId the password policy ID
789             * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
790             * @return the previous, current, and next password policy rel
791             * @throws com.liferay.portal.NoSuchPasswordPolicyRelException if a password policy rel with the primary key could not be found
792             * @throws SystemException if a system exception occurred
793             */
794            public PasswordPolicyRel[] findByPasswordPolicyId_PrevAndNext(
795                    long passwordPolicyRelId, long passwordPolicyId,
796                    OrderByComparator orderByComparator)
797                    throws NoSuchPasswordPolicyRelException, SystemException {
798                    PasswordPolicyRel passwordPolicyRel = findByPrimaryKey(passwordPolicyRelId);
799    
800                    Session session = null;
801    
802                    try {
803                            session = openSession();
804    
805                            PasswordPolicyRel[] array = new PasswordPolicyRelImpl[3];
806    
807                            array[0] = getByPasswordPolicyId_PrevAndNext(session,
808                                            passwordPolicyRel, passwordPolicyId, orderByComparator, true);
809    
810                            array[1] = passwordPolicyRel;
811    
812                            array[2] = getByPasswordPolicyId_PrevAndNext(session,
813                                            passwordPolicyRel, passwordPolicyId, orderByComparator,
814                                            false);
815    
816                            return array;
817                    }
818                    catch (Exception e) {
819                            throw processException(e);
820                    }
821                    finally {
822                            closeSession(session);
823                    }
824            }
825    
826            protected PasswordPolicyRel getByPasswordPolicyId_PrevAndNext(
827                    Session session, PasswordPolicyRel passwordPolicyRel,
828                    long passwordPolicyId, OrderByComparator orderByComparator,
829                    boolean previous) {
830                    StringBundler query = null;
831    
832                    if (orderByComparator != null) {
833                            query = new StringBundler(6 +
834                                            (orderByComparator.getOrderByFields().length * 6));
835                    }
836                    else {
837                            query = new StringBundler(3);
838                    }
839    
840                    query.append(_SQL_SELECT_PASSWORDPOLICYREL_WHERE);
841    
842                    query.append(_FINDER_COLUMN_PASSWORDPOLICYID_PASSWORDPOLICYID_2);
843    
844                    if (orderByComparator != null) {
845                            String[] orderByConditionFields = orderByComparator.getOrderByConditionFields();
846    
847                            if (orderByConditionFields.length > 0) {
848                                    query.append(WHERE_AND);
849                            }
850    
851                            for (int i = 0; i < orderByConditionFields.length; i++) {
852                                    query.append(_ORDER_BY_ENTITY_ALIAS);
853                                    query.append(orderByConditionFields[i]);
854    
855                                    if ((i + 1) < orderByConditionFields.length) {
856                                            if (orderByComparator.isAscending() ^ previous) {
857                                                    query.append(WHERE_GREATER_THAN_HAS_NEXT);
858                                            }
859                                            else {
860                                                    query.append(WHERE_LESSER_THAN_HAS_NEXT);
861                                            }
862                                    }
863                                    else {
864                                            if (orderByComparator.isAscending() ^ previous) {
865                                                    query.append(WHERE_GREATER_THAN);
866                                            }
867                                            else {
868                                                    query.append(WHERE_LESSER_THAN);
869                                            }
870                                    }
871                            }
872    
873                            query.append(ORDER_BY_CLAUSE);
874    
875                            String[] orderByFields = orderByComparator.getOrderByFields();
876    
877                            for (int i = 0; i < orderByFields.length; i++) {
878                                    query.append(_ORDER_BY_ENTITY_ALIAS);
879                                    query.append(orderByFields[i]);
880    
881                                    if ((i + 1) < orderByFields.length) {
882                                            if (orderByComparator.isAscending() ^ previous) {
883                                                    query.append(ORDER_BY_ASC_HAS_NEXT);
884                                            }
885                                            else {
886                                                    query.append(ORDER_BY_DESC_HAS_NEXT);
887                                            }
888                                    }
889                                    else {
890                                            if (orderByComparator.isAscending() ^ previous) {
891                                                    query.append(ORDER_BY_ASC);
892                                            }
893                                            else {
894                                                    query.append(ORDER_BY_DESC);
895                                            }
896                                    }
897                            }
898                    }
899    
900                    String sql = query.toString();
901    
902                    Query q = session.createQuery(sql);
903    
904                    q.setFirstResult(0);
905                    q.setMaxResults(2);
906    
907                    QueryPos qPos = QueryPos.getInstance(q);
908    
909                    qPos.add(passwordPolicyId);
910    
911                    if (orderByComparator != null) {
912                            Object[] values = orderByComparator.getOrderByConditionValues(passwordPolicyRel);
913    
914                            for (Object value : values) {
915                                    qPos.add(value);
916                            }
917                    }
918    
919                    List<PasswordPolicyRel> list = q.list();
920    
921                    if (list.size() == 2) {
922                            return list.get(1);
923                    }
924                    else {
925                            return null;
926                    }
927            }
928    
929            /**
930             * Returns the password policy rel where classNameId = &#63; and classPK = &#63; or throws a {@link com.liferay.portal.NoSuchPasswordPolicyRelException} if it could not be found.
931             *
932             * @param classNameId the class name ID
933             * @param classPK the class p k
934             * @return the matching password policy rel
935             * @throws com.liferay.portal.NoSuchPasswordPolicyRelException if a matching password policy rel could not be found
936             * @throws SystemException if a system exception occurred
937             */
938            public PasswordPolicyRel findByC_C(long classNameId, long classPK)
939                    throws NoSuchPasswordPolicyRelException, SystemException {
940                    PasswordPolicyRel passwordPolicyRel = fetchByC_C(classNameId, classPK);
941    
942                    if (passwordPolicyRel == null) {
943                            StringBundler msg = new StringBundler(6);
944    
945                            msg.append(_NO_SUCH_ENTITY_WITH_KEY);
946    
947                            msg.append("classNameId=");
948                            msg.append(classNameId);
949    
950                            msg.append(", classPK=");
951                            msg.append(classPK);
952    
953                            msg.append(StringPool.CLOSE_CURLY_BRACE);
954    
955                            if (_log.isWarnEnabled()) {
956                                    _log.warn(msg.toString());
957                            }
958    
959                            throw new NoSuchPasswordPolicyRelException(msg.toString());
960                    }
961    
962                    return passwordPolicyRel;
963            }
964    
965            /**
966             * Returns the password policy rel where classNameId = &#63; and classPK = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
967             *
968             * @param classNameId the class name ID
969             * @param classPK the class p k
970             * @return the matching password policy rel, or <code>null</code> if a matching password policy rel could not be found
971             * @throws SystemException if a system exception occurred
972             */
973            public PasswordPolicyRel fetchByC_C(long classNameId, long classPK)
974                    throws SystemException {
975                    return fetchByC_C(classNameId, classPK, true);
976            }
977    
978            /**
979             * Returns the password policy rel where classNameId = &#63; and classPK = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
980             *
981             * @param classNameId the class name ID
982             * @param classPK the class p k
983             * @param retrieveFromCache whether to use the finder cache
984             * @return the matching password policy rel, or <code>null</code> if a matching password policy rel could not be found
985             * @throws SystemException if a system exception occurred
986             */
987            public PasswordPolicyRel fetchByC_C(long classNameId, long classPK,
988                    boolean retrieveFromCache) throws SystemException {
989                    Object[] finderArgs = new Object[] { classNameId, classPK };
990    
991                    Object result = null;
992    
993                    if (retrieveFromCache) {
994                            result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_C_C,
995                                            finderArgs, this);
996                    }
997    
998                    if (result instanceof PasswordPolicyRel) {
999                            PasswordPolicyRel passwordPolicyRel = (PasswordPolicyRel)result;
1000    
1001                            if ((classNameId != passwordPolicyRel.getClassNameId()) ||
1002                                            (classPK != passwordPolicyRel.getClassPK())) {
1003                                    result = null;
1004                            }
1005                    }
1006    
1007                    if (result == null) {
1008                            StringBundler query = new StringBundler(3);
1009    
1010                            query.append(_SQL_SELECT_PASSWORDPOLICYREL_WHERE);
1011    
1012                            query.append(_FINDER_COLUMN_C_C_CLASSNAMEID_2);
1013    
1014                            query.append(_FINDER_COLUMN_C_C_CLASSPK_2);
1015    
1016                            String sql = query.toString();
1017    
1018                            Session session = null;
1019    
1020                            try {
1021                                    session = openSession();
1022    
1023                                    Query q = session.createQuery(sql);
1024    
1025                                    QueryPos qPos = QueryPos.getInstance(q);
1026    
1027                                    qPos.add(classNameId);
1028    
1029                                    qPos.add(classPK);
1030    
1031                                    List<PasswordPolicyRel> list = q.list();
1032    
1033                                    result = list;
1034    
1035                                    PasswordPolicyRel passwordPolicyRel = null;
1036    
1037                                    if (list.isEmpty()) {
1038                                            FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_C,
1039                                                    finderArgs, list);
1040                                    }
1041                                    else {
1042                                            passwordPolicyRel = list.get(0);
1043    
1044                                            cacheResult(passwordPolicyRel);
1045    
1046                                            if ((passwordPolicyRel.getClassNameId() != classNameId) ||
1047                                                            (passwordPolicyRel.getClassPK() != classPK)) {
1048                                                    FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_C,
1049                                                            finderArgs, passwordPolicyRel);
1050                                            }
1051                                    }
1052    
1053                                    return passwordPolicyRel;
1054                            }
1055                            catch (Exception e) {
1056                                    throw processException(e);
1057                            }
1058                            finally {
1059                                    if (result == null) {
1060                                            FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_C_C,
1061                                                    finderArgs);
1062                                    }
1063    
1064                                    closeSession(session);
1065                            }
1066                    }
1067                    else {
1068                            if (result instanceof List<?>) {
1069                                    return null;
1070                            }
1071                            else {
1072                                    return (PasswordPolicyRel)result;
1073                            }
1074                    }
1075            }
1076    
1077            /**
1078             * Returns the password policy rel where passwordPolicyId = &#63; and classNameId = &#63; and classPK = &#63; or throws a {@link com.liferay.portal.NoSuchPasswordPolicyRelException} if it could not be found.
1079             *
1080             * @param passwordPolicyId the password policy ID
1081             * @param classNameId the class name ID
1082             * @param classPK the class p k
1083             * @return the matching password policy rel
1084             * @throws com.liferay.portal.NoSuchPasswordPolicyRelException if a matching password policy rel could not be found
1085             * @throws SystemException if a system exception occurred
1086             */
1087            public PasswordPolicyRel findByP_C_C(long passwordPolicyId,
1088                    long classNameId, long classPK)
1089                    throws NoSuchPasswordPolicyRelException, SystemException {
1090                    PasswordPolicyRel passwordPolicyRel = fetchByP_C_C(passwordPolicyId,
1091                                    classNameId, classPK);
1092    
1093                    if (passwordPolicyRel == null) {
1094                            StringBundler msg = new StringBundler(8);
1095    
1096                            msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1097    
1098                            msg.append("passwordPolicyId=");
1099                            msg.append(passwordPolicyId);
1100    
1101                            msg.append(", classNameId=");
1102                            msg.append(classNameId);
1103    
1104                            msg.append(", classPK=");
1105                            msg.append(classPK);
1106    
1107                            msg.append(StringPool.CLOSE_CURLY_BRACE);
1108    
1109                            if (_log.isWarnEnabled()) {
1110                                    _log.warn(msg.toString());
1111                            }
1112    
1113                            throw new NoSuchPasswordPolicyRelException(msg.toString());
1114                    }
1115    
1116                    return passwordPolicyRel;
1117            }
1118    
1119            /**
1120             * Returns the password policy rel where passwordPolicyId = &#63; and classNameId = &#63; and classPK = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
1121             *
1122             * @param passwordPolicyId the password policy ID
1123             * @param classNameId the class name ID
1124             * @param classPK the class p k
1125             * @return the matching password policy rel, or <code>null</code> if a matching password policy rel could not be found
1126             * @throws SystemException if a system exception occurred
1127             */
1128            public PasswordPolicyRel fetchByP_C_C(long passwordPolicyId,
1129                    long classNameId, long classPK) throws SystemException {
1130                    return fetchByP_C_C(passwordPolicyId, classNameId, classPK, true);
1131            }
1132    
1133            /**
1134             * Returns the password policy rel where passwordPolicyId = &#63; and classNameId = &#63; and classPK = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
1135             *
1136             * @param passwordPolicyId the password policy ID
1137             * @param classNameId the class name ID
1138             * @param classPK the class p k
1139             * @param retrieveFromCache whether to use the finder cache
1140             * @return the matching password policy rel, or <code>null</code> if a matching password policy rel could not be found
1141             * @throws SystemException if a system exception occurred
1142             */
1143            public PasswordPolicyRel fetchByP_C_C(long passwordPolicyId,
1144                    long classNameId, long classPK, boolean retrieveFromCache)
1145                    throws SystemException {
1146                    Object[] finderArgs = new Object[] {
1147                                    passwordPolicyId, classNameId, classPK
1148                            };
1149    
1150                    Object result = null;
1151    
1152                    if (retrieveFromCache) {
1153                            result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_P_C_C,
1154                                            finderArgs, this);
1155                    }
1156    
1157                    if (result instanceof PasswordPolicyRel) {
1158                            PasswordPolicyRel passwordPolicyRel = (PasswordPolicyRel)result;
1159    
1160                            if ((passwordPolicyId != passwordPolicyRel.getPasswordPolicyId()) ||
1161                                            (classNameId != passwordPolicyRel.getClassNameId()) ||
1162                                            (classPK != passwordPolicyRel.getClassPK())) {
1163                                    result = null;
1164                            }
1165                    }
1166    
1167                    if (result == null) {
1168                            StringBundler query = new StringBundler(4);
1169    
1170                            query.append(_SQL_SELECT_PASSWORDPOLICYREL_WHERE);
1171    
1172                            query.append(_FINDER_COLUMN_P_C_C_PASSWORDPOLICYID_2);
1173    
1174                            query.append(_FINDER_COLUMN_P_C_C_CLASSNAMEID_2);
1175    
1176                            query.append(_FINDER_COLUMN_P_C_C_CLASSPK_2);
1177    
1178                            String sql = query.toString();
1179    
1180                            Session session = null;
1181    
1182                            try {
1183                                    session = openSession();
1184    
1185                                    Query q = session.createQuery(sql);
1186    
1187                                    QueryPos qPos = QueryPos.getInstance(q);
1188    
1189                                    qPos.add(passwordPolicyId);
1190    
1191                                    qPos.add(classNameId);
1192    
1193                                    qPos.add(classPK);
1194    
1195                                    List<PasswordPolicyRel> list = q.list();
1196    
1197                                    result = list;
1198    
1199                                    PasswordPolicyRel passwordPolicyRel = null;
1200    
1201                                    if (list.isEmpty()) {
1202                                            FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_P_C_C,
1203                                                    finderArgs, list);
1204                                    }
1205                                    else {
1206                                            passwordPolicyRel = list.get(0);
1207    
1208                                            cacheResult(passwordPolicyRel);
1209    
1210                                            if ((passwordPolicyRel.getPasswordPolicyId() != passwordPolicyId) ||
1211                                                            (passwordPolicyRel.getClassNameId() != classNameId) ||
1212                                                            (passwordPolicyRel.getClassPK() != classPK)) {
1213                                                    FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_P_C_C,
1214                                                            finderArgs, passwordPolicyRel);
1215                                            }
1216                                    }
1217    
1218                                    return passwordPolicyRel;
1219                            }
1220                            catch (Exception e) {
1221                                    throw processException(e);
1222                            }
1223                            finally {
1224                                    if (result == null) {
1225                                            FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_P_C_C,
1226                                                    finderArgs);
1227                                    }
1228    
1229                                    closeSession(session);
1230                            }
1231                    }
1232                    else {
1233                            if (result instanceof List<?>) {
1234                                    return null;
1235                            }
1236                            else {
1237                                    return (PasswordPolicyRel)result;
1238                            }
1239                    }
1240            }
1241    
1242            /**
1243             * Returns all the password policy rels.
1244             *
1245             * @return the password policy rels
1246             * @throws SystemException if a system exception occurred
1247             */
1248            public List<PasswordPolicyRel> findAll() throws SystemException {
1249                    return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
1250            }
1251    
1252            /**
1253             * Returns a range of all the password policy rels.
1254             *
1255             * <p>
1256             * 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.
1257             * </p>
1258             *
1259             * @param start the lower bound of the range of password policy rels
1260             * @param end the upper bound of the range of password policy rels (not inclusive)
1261             * @return the range of password policy rels
1262             * @throws SystemException if a system exception occurred
1263             */
1264            public List<PasswordPolicyRel> findAll(int start, int end)
1265                    throws SystemException {
1266                    return findAll(start, end, null);
1267            }
1268    
1269            /**
1270             * Returns an ordered range of all the password policy rels.
1271             *
1272             * <p>
1273             * 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.
1274             * </p>
1275             *
1276             * @param start the lower bound of the range of password policy rels
1277             * @param end the upper bound of the range of password policy rels (not inclusive)
1278             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
1279             * @return the ordered range of password policy rels
1280             * @throws SystemException if a system exception occurred
1281             */
1282            public List<PasswordPolicyRel> findAll(int start, int end,
1283                    OrderByComparator orderByComparator) throws SystemException {
1284                    FinderPath finderPath = null;
1285                    Object[] finderArgs = new Object[] { start, end, orderByComparator };
1286    
1287                    if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
1288                                    (orderByComparator == null)) {
1289                            finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL;
1290                            finderArgs = FINDER_ARGS_EMPTY;
1291                    }
1292                    else {
1293                            finderPath = FINDER_PATH_WITH_PAGINATION_FIND_ALL;
1294                            finderArgs = new Object[] { start, end, orderByComparator };
1295                    }
1296    
1297                    List<PasswordPolicyRel> list = (List<PasswordPolicyRel>)FinderCacheUtil.getResult(finderPath,
1298                                    finderArgs, this);
1299    
1300                    if (list == null) {
1301                            StringBundler query = null;
1302                            String sql = null;
1303    
1304                            if (orderByComparator != null) {
1305                                    query = new StringBundler(2 +
1306                                                    (orderByComparator.getOrderByFields().length * 3));
1307    
1308                                    query.append(_SQL_SELECT_PASSWORDPOLICYREL);
1309    
1310                                    appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
1311                                            orderByComparator);
1312    
1313                                    sql = query.toString();
1314                            }
1315                            else {
1316                                    sql = _SQL_SELECT_PASSWORDPOLICYREL;
1317                            }
1318    
1319                            Session session = null;
1320    
1321                            try {
1322                                    session = openSession();
1323    
1324                                    Query q = session.createQuery(sql);
1325    
1326                                    if (orderByComparator == null) {
1327                                            list = (List<PasswordPolicyRel>)QueryUtil.list(q,
1328                                                            getDialect(), start, end, false);
1329    
1330                                            Collections.sort(list);
1331                                    }
1332                                    else {
1333                                            list = (List<PasswordPolicyRel>)QueryUtil.list(q,
1334                                                            getDialect(), start, end);
1335                                    }
1336                            }
1337                            catch (Exception e) {
1338                                    throw processException(e);
1339                            }
1340                            finally {
1341                                    if (list == null) {
1342                                            FinderCacheUtil.removeResult(finderPath, finderArgs);
1343                                    }
1344                                    else {
1345                                            cacheResult(list);
1346    
1347                                            FinderCacheUtil.putResult(finderPath, finderArgs, list);
1348                                    }
1349    
1350                                    closeSession(session);
1351                            }
1352                    }
1353    
1354                    return list;
1355            }
1356    
1357            /**
1358             * Removes all the password policy rels where passwordPolicyId = &#63; from the database.
1359             *
1360             * @param passwordPolicyId the password policy ID
1361             * @throws SystemException if a system exception occurred
1362             */
1363            public void removeByPasswordPolicyId(long passwordPolicyId)
1364                    throws SystemException {
1365                    for (PasswordPolicyRel passwordPolicyRel : findByPasswordPolicyId(
1366                                    passwordPolicyId)) {
1367                            remove(passwordPolicyRel);
1368                    }
1369            }
1370    
1371            /**
1372             * Removes the password policy rel where classNameId = &#63; and classPK = &#63; from the database.
1373             *
1374             * @param classNameId the class name ID
1375             * @param classPK the class p k
1376             * @throws SystemException if a system exception occurred
1377             */
1378            public void removeByC_C(long classNameId, long classPK)
1379                    throws NoSuchPasswordPolicyRelException, SystemException {
1380                    PasswordPolicyRel passwordPolicyRel = findByC_C(classNameId, classPK);
1381    
1382                    remove(passwordPolicyRel);
1383            }
1384    
1385            /**
1386             * Removes the password policy rel where passwordPolicyId = &#63; and classNameId = &#63; and classPK = &#63; from the database.
1387             *
1388             * @param passwordPolicyId the password policy ID
1389             * @param classNameId the class name ID
1390             * @param classPK the class p k
1391             * @throws SystemException if a system exception occurred
1392             */
1393            public void removeByP_C_C(long passwordPolicyId, long classNameId,
1394                    long classPK) throws NoSuchPasswordPolicyRelException, SystemException {
1395                    PasswordPolicyRel passwordPolicyRel = findByP_C_C(passwordPolicyId,
1396                                    classNameId, classPK);
1397    
1398                    remove(passwordPolicyRel);
1399            }
1400    
1401            /**
1402             * Removes all the password policy rels from the database.
1403             *
1404             * @throws SystemException if a system exception occurred
1405             */
1406            public void removeAll() throws SystemException {
1407                    for (PasswordPolicyRel passwordPolicyRel : findAll()) {
1408                            remove(passwordPolicyRel);
1409                    }
1410            }
1411    
1412            /**
1413             * Returns the number of password policy rels where passwordPolicyId = &#63;.
1414             *
1415             * @param passwordPolicyId the password policy ID
1416             * @return the number of matching password policy rels
1417             * @throws SystemException if a system exception occurred
1418             */
1419            public int countByPasswordPolicyId(long passwordPolicyId)
1420                    throws SystemException {
1421                    Object[] finderArgs = new Object[] { passwordPolicyId };
1422    
1423                    Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_PASSWORDPOLICYID,
1424                                    finderArgs, this);
1425    
1426                    if (count == null) {
1427                            StringBundler query = new StringBundler(2);
1428    
1429                            query.append(_SQL_COUNT_PASSWORDPOLICYREL_WHERE);
1430    
1431                            query.append(_FINDER_COLUMN_PASSWORDPOLICYID_PASSWORDPOLICYID_2);
1432    
1433                            String sql = query.toString();
1434    
1435                            Session session = null;
1436    
1437                            try {
1438                                    session = openSession();
1439    
1440                                    Query q = session.createQuery(sql);
1441    
1442                                    QueryPos qPos = QueryPos.getInstance(q);
1443    
1444                                    qPos.add(passwordPolicyId);
1445    
1446                                    count = (Long)q.uniqueResult();
1447                            }
1448                            catch (Exception e) {
1449                                    throw processException(e);
1450                            }
1451                            finally {
1452                                    if (count == null) {
1453                                            count = Long.valueOf(0);
1454                                    }
1455    
1456                                    FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_PASSWORDPOLICYID,
1457                                            finderArgs, count);
1458    
1459                                    closeSession(session);
1460                            }
1461                    }
1462    
1463                    return count.intValue();
1464            }
1465    
1466            /**
1467             * Returns the number of password policy rels where classNameId = &#63; and classPK = &#63;.
1468             *
1469             * @param classNameId the class name ID
1470             * @param classPK the class p k
1471             * @return the number of matching password policy rels
1472             * @throws SystemException if a system exception occurred
1473             */
1474            public int countByC_C(long classNameId, long classPK)
1475                    throws SystemException {
1476                    Object[] finderArgs = new Object[] { classNameId, classPK };
1477    
1478                    Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_C_C,
1479                                    finderArgs, this);
1480    
1481                    if (count == null) {
1482                            StringBundler query = new StringBundler(3);
1483    
1484                            query.append(_SQL_COUNT_PASSWORDPOLICYREL_WHERE);
1485    
1486                            query.append(_FINDER_COLUMN_C_C_CLASSNAMEID_2);
1487    
1488                            query.append(_FINDER_COLUMN_C_C_CLASSPK_2);
1489    
1490                            String sql = query.toString();
1491    
1492                            Session session = null;
1493    
1494                            try {
1495                                    session = openSession();
1496    
1497                                    Query q = session.createQuery(sql);
1498    
1499                                    QueryPos qPos = QueryPos.getInstance(q);
1500    
1501                                    qPos.add(classNameId);
1502    
1503                                    qPos.add(classPK);
1504    
1505                                    count = (Long)q.uniqueResult();
1506                            }
1507                            catch (Exception e) {
1508                                    throw processException(e);
1509                            }
1510                            finally {
1511                                    if (count == null) {
1512                                            count = Long.valueOf(0);
1513                                    }
1514    
1515                                    FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_C_C, finderArgs,
1516                                            count);
1517    
1518                                    closeSession(session);
1519                            }
1520                    }
1521    
1522                    return count.intValue();
1523            }
1524    
1525            /**
1526             * Returns the number of password policy rels where passwordPolicyId = &#63; and classNameId = &#63; and classPK = &#63;.
1527             *
1528             * @param passwordPolicyId the password policy ID
1529             * @param classNameId the class name ID
1530             * @param classPK the class p k
1531             * @return the number of matching password policy rels
1532             * @throws SystemException if a system exception occurred
1533             */
1534            public int countByP_C_C(long passwordPolicyId, long classNameId,
1535                    long classPK) throws SystemException {
1536                    Object[] finderArgs = new Object[] {
1537                                    passwordPolicyId, classNameId, classPK
1538                            };
1539    
1540                    Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_P_C_C,
1541                                    finderArgs, this);
1542    
1543                    if (count == null) {
1544                            StringBundler query = new StringBundler(4);
1545    
1546                            query.append(_SQL_COUNT_PASSWORDPOLICYREL_WHERE);
1547    
1548                            query.append(_FINDER_COLUMN_P_C_C_PASSWORDPOLICYID_2);
1549    
1550                            query.append(_FINDER_COLUMN_P_C_C_CLASSNAMEID_2);
1551    
1552                            query.append(_FINDER_COLUMN_P_C_C_CLASSPK_2);
1553    
1554                            String sql = query.toString();
1555    
1556                            Session session = null;
1557    
1558                            try {
1559                                    session = openSession();
1560    
1561                                    Query q = session.createQuery(sql);
1562    
1563                                    QueryPos qPos = QueryPos.getInstance(q);
1564    
1565                                    qPos.add(passwordPolicyId);
1566    
1567                                    qPos.add(classNameId);
1568    
1569                                    qPos.add(classPK);
1570    
1571                                    count = (Long)q.uniqueResult();
1572                            }
1573                            catch (Exception e) {
1574                                    throw processException(e);
1575                            }
1576                            finally {
1577                                    if (count == null) {
1578                                            count = Long.valueOf(0);
1579                                    }
1580    
1581                                    FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_P_C_C,
1582                                            finderArgs, count);
1583    
1584                                    closeSession(session);
1585                            }
1586                    }
1587    
1588                    return count.intValue();
1589            }
1590    
1591            /**
1592             * Returns the number of password policy rels.
1593             *
1594             * @return the number of password policy rels
1595             * @throws SystemException if a system exception occurred
1596             */
1597            public int countAll() throws SystemException {
1598                    Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
1599                                    FINDER_ARGS_EMPTY, this);
1600    
1601                    if (count == null) {
1602                            Session session = null;
1603    
1604                            try {
1605                                    session = openSession();
1606    
1607                                    Query q = session.createQuery(_SQL_COUNT_PASSWORDPOLICYREL);
1608    
1609                                    count = (Long)q.uniqueResult();
1610                            }
1611                            catch (Exception e) {
1612                                    throw processException(e);
1613                            }
1614                            finally {
1615                                    if (count == null) {
1616                                            count = Long.valueOf(0);
1617                                    }
1618    
1619                                    FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL,
1620                                            FINDER_ARGS_EMPTY, count);
1621    
1622                                    closeSession(session);
1623                            }
1624                    }
1625    
1626                    return count.intValue();
1627            }
1628    
1629            /**
1630             * Initializes the password policy rel persistence.
1631             */
1632            public void afterPropertiesSet() {
1633                    String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
1634                                            com.liferay.portal.util.PropsUtil.get(
1635                                                    "value.object.listener.com.liferay.portal.model.PasswordPolicyRel")));
1636    
1637                    if (listenerClassNames.length > 0) {
1638                            try {
1639                                    List<ModelListener<PasswordPolicyRel>> listenersList = new ArrayList<ModelListener<PasswordPolicyRel>>();
1640    
1641                                    for (String listenerClassName : listenerClassNames) {
1642                                            listenersList.add((ModelListener<PasswordPolicyRel>)InstanceFactory.newInstance(
1643                                                            listenerClassName));
1644                                    }
1645    
1646                                    listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
1647                            }
1648                            catch (Exception e) {
1649                                    _log.error(e);
1650                            }
1651                    }
1652            }
1653    
1654            public void destroy() {
1655                    EntityCacheUtil.removeCache(PasswordPolicyRelImpl.class.getName());
1656                    FinderCacheUtil.removeCache(FINDER_CLASS_NAME_ENTITY);
1657                    FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
1658            }
1659    
1660            @BeanReference(type = AccountPersistence.class)
1661            protected AccountPersistence accountPersistence;
1662            @BeanReference(type = AddressPersistence.class)
1663            protected AddressPersistence addressPersistence;
1664            @BeanReference(type = BrowserTrackerPersistence.class)
1665            protected BrowserTrackerPersistence browserTrackerPersistence;
1666            @BeanReference(type = ClassNamePersistence.class)
1667            protected ClassNamePersistence classNamePersistence;
1668            @BeanReference(type = ClusterGroupPersistence.class)
1669            protected ClusterGroupPersistence clusterGroupPersistence;
1670            @BeanReference(type = CompanyPersistence.class)
1671            protected CompanyPersistence companyPersistence;
1672            @BeanReference(type = ContactPersistence.class)
1673            protected ContactPersistence contactPersistence;
1674            @BeanReference(type = CountryPersistence.class)
1675            protected CountryPersistence countryPersistence;
1676            @BeanReference(type = EmailAddressPersistence.class)
1677            protected EmailAddressPersistence emailAddressPersistence;
1678            @BeanReference(type = GroupPersistence.class)
1679            protected GroupPersistence groupPersistence;
1680            @BeanReference(type = ImagePersistence.class)
1681            protected ImagePersistence imagePersistence;
1682            @BeanReference(type = LayoutPersistence.class)
1683            protected LayoutPersistence layoutPersistence;
1684            @BeanReference(type = LayoutBranchPersistence.class)
1685            protected LayoutBranchPersistence layoutBranchPersistence;
1686            @BeanReference(type = LayoutPrototypePersistence.class)
1687            protected LayoutPrototypePersistence layoutPrototypePersistence;
1688            @BeanReference(type = LayoutRevisionPersistence.class)
1689            protected LayoutRevisionPersistence layoutRevisionPersistence;
1690            @BeanReference(type = LayoutSetPersistence.class)
1691            protected LayoutSetPersistence layoutSetPersistence;
1692            @BeanReference(type = LayoutSetBranchPersistence.class)
1693            protected LayoutSetBranchPersistence layoutSetBranchPersistence;
1694            @BeanReference(type = LayoutSetPrototypePersistence.class)
1695            protected LayoutSetPrototypePersistence layoutSetPrototypePersistence;
1696            @BeanReference(type = ListTypePersistence.class)
1697            protected ListTypePersistence listTypePersistence;
1698            @BeanReference(type = LockPersistence.class)
1699            protected LockPersistence lockPersistence;
1700            @BeanReference(type = MembershipRequestPersistence.class)
1701            protected MembershipRequestPersistence membershipRequestPersistence;
1702            @BeanReference(type = OrganizationPersistence.class)
1703            protected OrganizationPersistence organizationPersistence;
1704            @BeanReference(type = OrgGroupPermissionPersistence.class)
1705            protected OrgGroupPermissionPersistence orgGroupPermissionPersistence;
1706            @BeanReference(type = OrgGroupRolePersistence.class)
1707            protected OrgGroupRolePersistence orgGroupRolePersistence;
1708            @BeanReference(type = OrgLaborPersistence.class)
1709            protected OrgLaborPersistence orgLaborPersistence;
1710            @BeanReference(type = PasswordPolicyPersistence.class)
1711            protected PasswordPolicyPersistence passwordPolicyPersistence;
1712            @BeanReference(type = PasswordPolicyRelPersistence.class)
1713            protected PasswordPolicyRelPersistence passwordPolicyRelPersistence;
1714            @BeanReference(type = PasswordTrackerPersistence.class)
1715            protected PasswordTrackerPersistence passwordTrackerPersistence;
1716            @BeanReference(type = PermissionPersistence.class)
1717            protected PermissionPersistence permissionPersistence;
1718            @BeanReference(type = PhonePersistence.class)
1719            protected PhonePersistence phonePersistence;
1720            @BeanReference(type = PluginSettingPersistence.class)
1721            protected PluginSettingPersistence pluginSettingPersistence;
1722            @BeanReference(type = PortalPreferencesPersistence.class)
1723            protected PortalPreferencesPersistence portalPreferencesPersistence;
1724            @BeanReference(type = PortletPersistence.class)
1725            protected PortletPersistence portletPersistence;
1726            @BeanReference(type = PortletItemPersistence.class)
1727            protected PortletItemPersistence portletItemPersistence;
1728            @BeanReference(type = PortletPreferencesPersistence.class)
1729            protected PortletPreferencesPersistence portletPreferencesPersistence;
1730            @BeanReference(type = RegionPersistence.class)
1731            protected RegionPersistence regionPersistence;
1732            @BeanReference(type = ReleasePersistence.class)
1733            protected ReleasePersistence releasePersistence;
1734            @BeanReference(type = RepositoryPersistence.class)
1735            protected RepositoryPersistence repositoryPersistence;
1736            @BeanReference(type = RepositoryEntryPersistence.class)
1737            protected RepositoryEntryPersistence repositoryEntryPersistence;
1738            @BeanReference(type = ResourcePersistence.class)
1739            protected ResourcePersistence resourcePersistence;
1740            @BeanReference(type = ResourceActionPersistence.class)
1741            protected ResourceActionPersistence resourceActionPersistence;
1742            @BeanReference(type = ResourceBlockPersistence.class)
1743            protected ResourceBlockPersistence resourceBlockPersistence;
1744            @BeanReference(type = ResourceBlockPermissionPersistence.class)
1745            protected ResourceBlockPermissionPersistence resourceBlockPermissionPersistence;
1746            @BeanReference(type = ResourceCodePersistence.class)
1747            protected ResourceCodePersistence resourceCodePersistence;
1748            @BeanReference(type = ResourcePermissionPersistence.class)
1749            protected ResourcePermissionPersistence resourcePermissionPersistence;
1750            @BeanReference(type = ResourceTypePermissionPersistence.class)
1751            protected ResourceTypePermissionPersistence resourceTypePermissionPersistence;
1752            @BeanReference(type = RolePersistence.class)
1753            protected RolePersistence rolePersistence;
1754            @BeanReference(type = ServiceComponentPersistence.class)
1755            protected ServiceComponentPersistence serviceComponentPersistence;
1756            @BeanReference(type = ShardPersistence.class)
1757            protected ShardPersistence shardPersistence;
1758            @BeanReference(type = SubscriptionPersistence.class)
1759            protected SubscriptionPersistence subscriptionPersistence;
1760            @BeanReference(type = TeamPersistence.class)
1761            protected TeamPersistence teamPersistence;
1762            @BeanReference(type = TicketPersistence.class)
1763            protected TicketPersistence ticketPersistence;
1764            @BeanReference(type = UserPersistence.class)
1765            protected UserPersistence userPersistence;
1766            @BeanReference(type = UserGroupPersistence.class)
1767            protected UserGroupPersistence userGroupPersistence;
1768            @BeanReference(type = UserGroupGroupRolePersistence.class)
1769            protected UserGroupGroupRolePersistence userGroupGroupRolePersistence;
1770            @BeanReference(type = UserGroupRolePersistence.class)
1771            protected UserGroupRolePersistence userGroupRolePersistence;
1772            @BeanReference(type = UserIdMapperPersistence.class)
1773            protected UserIdMapperPersistence userIdMapperPersistence;
1774            @BeanReference(type = UserNotificationEventPersistence.class)
1775            protected UserNotificationEventPersistence userNotificationEventPersistence;
1776            @BeanReference(type = UserTrackerPersistence.class)
1777            protected UserTrackerPersistence userTrackerPersistence;
1778            @BeanReference(type = UserTrackerPathPersistence.class)
1779            protected UserTrackerPathPersistence userTrackerPathPersistence;
1780            @BeanReference(type = VirtualHostPersistence.class)
1781            protected VirtualHostPersistence virtualHostPersistence;
1782            @BeanReference(type = WebDAVPropsPersistence.class)
1783            protected WebDAVPropsPersistence webDAVPropsPersistence;
1784            @BeanReference(type = WebsitePersistence.class)
1785            protected WebsitePersistence websitePersistence;
1786            @BeanReference(type = WorkflowDefinitionLinkPersistence.class)
1787            protected WorkflowDefinitionLinkPersistence workflowDefinitionLinkPersistence;
1788            @BeanReference(type = WorkflowInstanceLinkPersistence.class)
1789            protected WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence;
1790            private static final String _SQL_SELECT_PASSWORDPOLICYREL = "SELECT passwordPolicyRel FROM PasswordPolicyRel passwordPolicyRel";
1791            private static final String _SQL_SELECT_PASSWORDPOLICYREL_WHERE = "SELECT passwordPolicyRel FROM PasswordPolicyRel passwordPolicyRel WHERE ";
1792            private static final String _SQL_COUNT_PASSWORDPOLICYREL = "SELECT COUNT(passwordPolicyRel) FROM PasswordPolicyRel passwordPolicyRel";
1793            private static final String _SQL_COUNT_PASSWORDPOLICYREL_WHERE = "SELECT COUNT(passwordPolicyRel) FROM PasswordPolicyRel passwordPolicyRel WHERE ";
1794            private static final String _FINDER_COLUMN_PASSWORDPOLICYID_PASSWORDPOLICYID_2 =
1795                    "passwordPolicyRel.passwordPolicyId = ?";
1796            private static final String _FINDER_COLUMN_C_C_CLASSNAMEID_2 = "passwordPolicyRel.classNameId = ? AND ";
1797            private static final String _FINDER_COLUMN_C_C_CLASSPK_2 = "passwordPolicyRel.classPK = ?";
1798            private static final String _FINDER_COLUMN_P_C_C_PASSWORDPOLICYID_2 = "passwordPolicyRel.passwordPolicyId = ? AND ";
1799            private static final String _FINDER_COLUMN_P_C_C_CLASSNAMEID_2 = "passwordPolicyRel.classNameId = ? AND ";
1800            private static final String _FINDER_COLUMN_P_C_C_CLASSPK_2 = "passwordPolicyRel.classPK = ?";
1801            private static final String _ORDER_BY_ENTITY_ALIAS = "passwordPolicyRel.";
1802            private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No PasswordPolicyRel exists with the primary key ";
1803            private static final String _NO_SUCH_ENTITY_WITH_KEY = "No PasswordPolicyRel exists with the key {";
1804            private static final boolean _HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE = com.liferay.portal.util.PropsValues.HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE;
1805            private static Log _log = LogFactoryUtil.getLog(PasswordPolicyRelPersistenceImpl.class);
1806            private static PasswordPolicyRel _nullPasswordPolicyRel = new PasswordPolicyRelImpl() {
1807                            @Override
1808                            public Object clone() {
1809                                    return this;
1810                            }
1811    
1812                            @Override
1813                            public CacheModel<PasswordPolicyRel> toCacheModel() {
1814                                    return _nullPasswordPolicyRelCacheModel;
1815                            }
1816                    };
1817    
1818            private static CacheModel<PasswordPolicyRel> _nullPasswordPolicyRelCacheModel =
1819                    new CacheModel<PasswordPolicyRel>() {
1820                            public PasswordPolicyRel toEntityModel() {
1821                                    return _nullPasswordPolicyRel;
1822                            }
1823                    };
1824    }