001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
019    import com.liferay.portal.kernel.exception.SystemException;
020    import com.liferay.portal.kernel.util.OrderByComparator;
021    import com.liferay.portal.kernel.util.ReferenceRegistry;
022    import com.liferay.portal.model.PasswordPolicy;
023    import com.liferay.portal.service.ServiceContext;
024    
025    import java.util.List;
026    
027    /**
028     * The persistence utility for the password policy service. This utility wraps {@link PasswordPolicyPersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
029     *
030     * <p>
031     * Caching information and settings can be found in <code>portal.properties</code>
032     * </p>
033     *
034     * @author Brian Wing Shun Chan
035     * @see PasswordPolicyPersistence
036     * @see PasswordPolicyPersistenceImpl
037     * @generated
038     */
039    public class PasswordPolicyUtil {
040            /*
041             * NOTE FOR DEVELOPERS:
042             *
043             * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
044             */
045    
046            /**
047             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
048             */
049            public static void clearCache() {
050                    getPersistence().clearCache();
051            }
052    
053            /**
054             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
055             */
056            public static void clearCache(PasswordPolicy passwordPolicy) {
057                    getPersistence().clearCache(passwordPolicy);
058            }
059    
060            /**
061             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
062             */
063            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
064                    throws SystemException {
065                    return getPersistence().countWithDynamicQuery(dynamicQuery);
066            }
067    
068            /**
069             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
070             */
071            public static List<PasswordPolicy> findWithDynamicQuery(
072                    DynamicQuery dynamicQuery) throws SystemException {
073                    return getPersistence().findWithDynamicQuery(dynamicQuery);
074            }
075    
076            /**
077             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
078             */
079            public static List<PasswordPolicy> findWithDynamicQuery(
080                    DynamicQuery dynamicQuery, int start, int end)
081                    throws SystemException {
082                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
083            }
084    
085            /**
086             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
087             */
088            public static List<PasswordPolicy> findWithDynamicQuery(
089                    DynamicQuery dynamicQuery, int start, int end,
090                    OrderByComparator orderByComparator) throws SystemException {
091                    return getPersistence()
092                                       .findWithDynamicQuery(dynamicQuery, start, end,
093                            orderByComparator);
094            }
095    
096            /**
097             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
098             */
099            public static PasswordPolicy update(PasswordPolicy passwordPolicy,
100                    boolean merge) throws SystemException {
101                    return getPersistence().update(passwordPolicy, merge);
102            }
103    
104            /**
105             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
106             */
107            public static PasswordPolicy update(PasswordPolicy passwordPolicy,
108                    boolean merge, ServiceContext serviceContext) throws SystemException {
109                    return getPersistence().update(passwordPolicy, merge, serviceContext);
110            }
111    
112            /**
113            * Caches the password policy in the entity cache if it is enabled.
114            *
115            * @param passwordPolicy the password policy
116            */
117            public static void cacheResult(
118                    com.liferay.portal.model.PasswordPolicy passwordPolicy) {
119                    getPersistence().cacheResult(passwordPolicy);
120            }
121    
122            /**
123            * Caches the password policies in the entity cache if it is enabled.
124            *
125            * @param passwordPolicies the password policies
126            */
127            public static void cacheResult(
128                    java.util.List<com.liferay.portal.model.PasswordPolicy> passwordPolicies) {
129                    getPersistence().cacheResult(passwordPolicies);
130            }
131    
132            /**
133            * Creates a new password policy with the primary key. Does not add the password policy to the database.
134            *
135            * @param passwordPolicyId the primary key for the new password policy
136            * @return the new password policy
137            */
138            public static com.liferay.portal.model.PasswordPolicy create(
139                    long passwordPolicyId) {
140                    return getPersistence().create(passwordPolicyId);
141            }
142    
143            /**
144            * Removes the password policy with the primary key from the database. Also notifies the appropriate model listeners.
145            *
146            * @param passwordPolicyId the primary key of the password policy
147            * @return the password policy that was removed
148            * @throws com.liferay.portal.NoSuchPasswordPolicyException if a password policy with the primary key could not be found
149            * @throws SystemException if a system exception occurred
150            */
151            public static com.liferay.portal.model.PasswordPolicy remove(
152                    long passwordPolicyId)
153                    throws com.liferay.portal.NoSuchPasswordPolicyException,
154                            com.liferay.portal.kernel.exception.SystemException {
155                    return getPersistence().remove(passwordPolicyId);
156            }
157    
158            public static com.liferay.portal.model.PasswordPolicy updateImpl(
159                    com.liferay.portal.model.PasswordPolicy passwordPolicy, boolean merge)
160                    throws com.liferay.portal.kernel.exception.SystemException {
161                    return getPersistence().updateImpl(passwordPolicy, merge);
162            }
163    
164            /**
165            * Returns the password policy with the primary key or throws a {@link com.liferay.portal.NoSuchPasswordPolicyException} if it could not be found.
166            *
167            * @param passwordPolicyId the primary key of the password policy
168            * @return the password policy
169            * @throws com.liferay.portal.NoSuchPasswordPolicyException if a password policy with the primary key could not be found
170            * @throws SystemException if a system exception occurred
171            */
172            public static com.liferay.portal.model.PasswordPolicy findByPrimaryKey(
173                    long passwordPolicyId)
174                    throws com.liferay.portal.NoSuchPasswordPolicyException,
175                            com.liferay.portal.kernel.exception.SystemException {
176                    return getPersistence().findByPrimaryKey(passwordPolicyId);
177            }
178    
179            /**
180            * Returns the password policy with the primary key or returns <code>null</code> if it could not be found.
181            *
182            * @param passwordPolicyId the primary key of the password policy
183            * @return the password policy, or <code>null</code> if a password policy with the primary key could not be found
184            * @throws SystemException if a system exception occurred
185            */
186            public static com.liferay.portal.model.PasswordPolicy fetchByPrimaryKey(
187                    long passwordPolicyId)
188                    throws com.liferay.portal.kernel.exception.SystemException {
189                    return getPersistence().fetchByPrimaryKey(passwordPolicyId);
190            }
191    
192            /**
193            * Returns the password policy where companyId = &#63; and defaultPolicy = &#63; or throws a {@link com.liferay.portal.NoSuchPasswordPolicyException} if it could not be found.
194            *
195            * @param companyId the company ID
196            * @param defaultPolicy the default policy
197            * @return the matching password policy
198            * @throws com.liferay.portal.NoSuchPasswordPolicyException if a matching password policy could not be found
199            * @throws SystemException if a system exception occurred
200            */
201            public static com.liferay.portal.model.PasswordPolicy findByC_DP(
202                    long companyId, boolean defaultPolicy)
203                    throws com.liferay.portal.NoSuchPasswordPolicyException,
204                            com.liferay.portal.kernel.exception.SystemException {
205                    return getPersistence().findByC_DP(companyId, defaultPolicy);
206            }
207    
208            /**
209            * Returns the password policy where companyId = &#63; and defaultPolicy = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
210            *
211            * @param companyId the company ID
212            * @param defaultPolicy the default policy
213            * @return the matching password policy, or <code>null</code> if a matching password policy could not be found
214            * @throws SystemException if a system exception occurred
215            */
216            public static com.liferay.portal.model.PasswordPolicy fetchByC_DP(
217                    long companyId, boolean defaultPolicy)
218                    throws com.liferay.portal.kernel.exception.SystemException {
219                    return getPersistence().fetchByC_DP(companyId, defaultPolicy);
220            }
221    
222            /**
223            * Returns the password policy where companyId = &#63; and defaultPolicy = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
224            *
225            * @param companyId the company ID
226            * @param defaultPolicy the default policy
227            * @param retrieveFromCache whether to use the finder cache
228            * @return the matching password policy, or <code>null</code> if a matching password policy could not be found
229            * @throws SystemException if a system exception occurred
230            */
231            public static com.liferay.portal.model.PasswordPolicy fetchByC_DP(
232                    long companyId, boolean defaultPolicy, boolean retrieveFromCache)
233                    throws com.liferay.portal.kernel.exception.SystemException {
234                    return getPersistence()
235                                       .fetchByC_DP(companyId, defaultPolicy, retrieveFromCache);
236            }
237    
238            /**
239            * Returns the password policy where companyId = &#63; and name = &#63; or throws a {@link com.liferay.portal.NoSuchPasswordPolicyException} if it could not be found.
240            *
241            * @param companyId the company ID
242            * @param name the name
243            * @return the matching password policy
244            * @throws com.liferay.portal.NoSuchPasswordPolicyException if a matching password policy could not be found
245            * @throws SystemException if a system exception occurred
246            */
247            public static com.liferay.portal.model.PasswordPolicy findByC_N(
248                    long companyId, java.lang.String name)
249                    throws com.liferay.portal.NoSuchPasswordPolicyException,
250                            com.liferay.portal.kernel.exception.SystemException {
251                    return getPersistence().findByC_N(companyId, name);
252            }
253    
254            /**
255            * Returns the password policy where companyId = &#63; and name = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
256            *
257            * @param companyId the company ID
258            * @param name the name
259            * @return the matching password policy, or <code>null</code> if a matching password policy could not be found
260            * @throws SystemException if a system exception occurred
261            */
262            public static com.liferay.portal.model.PasswordPolicy fetchByC_N(
263                    long companyId, java.lang.String name)
264                    throws com.liferay.portal.kernel.exception.SystemException {
265                    return getPersistence().fetchByC_N(companyId, name);
266            }
267    
268            /**
269            * Returns the password policy where companyId = &#63; and name = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
270            *
271            * @param companyId the company ID
272            * @param name the name
273            * @param retrieveFromCache whether to use the finder cache
274            * @return the matching password policy, or <code>null</code> if a matching password policy could not be found
275            * @throws SystemException if a system exception occurred
276            */
277            public static com.liferay.portal.model.PasswordPolicy fetchByC_N(
278                    long companyId, java.lang.String name, boolean retrieveFromCache)
279                    throws com.liferay.portal.kernel.exception.SystemException {
280                    return getPersistence().fetchByC_N(companyId, name, retrieveFromCache);
281            }
282    
283            /**
284            * Returns all the password policies.
285            *
286            * @return the password policies
287            * @throws SystemException if a system exception occurred
288            */
289            public static java.util.List<com.liferay.portal.model.PasswordPolicy> findAll()
290                    throws com.liferay.portal.kernel.exception.SystemException {
291                    return getPersistence().findAll();
292            }
293    
294            /**
295            * Returns a range of all the password policies.
296            *
297            * <p>
298            * 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.
299            * </p>
300            *
301            * @param start the lower bound of the range of password policies
302            * @param end the upper bound of the range of password policies (not inclusive)
303            * @return the range of password policies
304            * @throws SystemException if a system exception occurred
305            */
306            public static java.util.List<com.liferay.portal.model.PasswordPolicy> findAll(
307                    int start, int end)
308                    throws com.liferay.portal.kernel.exception.SystemException {
309                    return getPersistence().findAll(start, end);
310            }
311    
312            /**
313            * Returns an ordered range of all the password policies.
314            *
315            * <p>
316            * 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.
317            * </p>
318            *
319            * @param start the lower bound of the range of password policies
320            * @param end the upper bound of the range of password policies (not inclusive)
321            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
322            * @return the ordered range of password policies
323            * @throws SystemException if a system exception occurred
324            */
325            public static java.util.List<com.liferay.portal.model.PasswordPolicy> findAll(
326                    int start, int end,
327                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
328                    throws com.liferay.portal.kernel.exception.SystemException {
329                    return getPersistence().findAll(start, end, orderByComparator);
330            }
331    
332            /**
333            * Removes the password policy where companyId = &#63; and defaultPolicy = &#63; from the database.
334            *
335            * @param companyId the company ID
336            * @param defaultPolicy the default policy
337            * @return the password policy that was removed
338            * @throws SystemException if a system exception occurred
339            */
340            public static com.liferay.portal.model.PasswordPolicy removeByC_DP(
341                    long companyId, boolean defaultPolicy)
342                    throws com.liferay.portal.NoSuchPasswordPolicyException,
343                            com.liferay.portal.kernel.exception.SystemException {
344                    return getPersistence().removeByC_DP(companyId, defaultPolicy);
345            }
346    
347            /**
348            * Removes the password policy where companyId = &#63; and name = &#63; from the database.
349            *
350            * @param companyId the company ID
351            * @param name the name
352            * @return the password policy that was removed
353            * @throws SystemException if a system exception occurred
354            */
355            public static com.liferay.portal.model.PasswordPolicy removeByC_N(
356                    long companyId, java.lang.String name)
357                    throws com.liferay.portal.NoSuchPasswordPolicyException,
358                            com.liferay.portal.kernel.exception.SystemException {
359                    return getPersistence().removeByC_N(companyId, name);
360            }
361    
362            /**
363            * Removes all the password policies from the database.
364            *
365            * @throws SystemException if a system exception occurred
366            */
367            public static void removeAll()
368                    throws com.liferay.portal.kernel.exception.SystemException {
369                    getPersistence().removeAll();
370            }
371    
372            /**
373            * Returns the number of password policies where companyId = &#63; and defaultPolicy = &#63;.
374            *
375            * @param companyId the company ID
376            * @param defaultPolicy the default policy
377            * @return the number of matching password policies
378            * @throws SystemException if a system exception occurred
379            */
380            public static int countByC_DP(long companyId, boolean defaultPolicy)
381                    throws com.liferay.portal.kernel.exception.SystemException {
382                    return getPersistence().countByC_DP(companyId, defaultPolicy);
383            }
384    
385            /**
386            * Returns the number of password policies where companyId = &#63; and name = &#63;.
387            *
388            * @param companyId the company ID
389            * @param name the name
390            * @return the number of matching password policies
391            * @throws SystemException if a system exception occurred
392            */
393            public static int countByC_N(long companyId, java.lang.String name)
394                    throws com.liferay.portal.kernel.exception.SystemException {
395                    return getPersistence().countByC_N(companyId, name);
396            }
397    
398            /**
399            * Returns the number of password policies.
400            *
401            * @return the number of password policies
402            * @throws SystemException if a system exception occurred
403            */
404            public static int countAll()
405                    throws com.liferay.portal.kernel.exception.SystemException {
406                    return getPersistence().countAll();
407            }
408    
409            public static PasswordPolicyPersistence getPersistence() {
410                    if (_persistence == null) {
411                            _persistence = (PasswordPolicyPersistence)PortalBeanLocatorUtil.locate(PasswordPolicyPersistence.class.getName());
412    
413                            ReferenceRegistry.registerReference(PasswordPolicyUtil.class,
414                                    "_persistence");
415                    }
416    
417                    return _persistence;
418            }
419    
420            /**
421             * @deprecated
422             */
423            public void setPersistence(PasswordPolicyPersistence persistence) {
424            }
425    
426            private static PasswordPolicyPersistence _persistence;
427    }