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