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