001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import com.liferay.portal.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)
098             */
099            public static PasswordPolicy update(PasswordPolicy passwordPolicy)
100                    throws SystemException {
101                    return getPersistence().update(passwordPolicy);
102            }
103    
104            /**
105             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
106             */
107            public static PasswordPolicy update(PasswordPolicy passwordPolicy,
108                    ServiceContext serviceContext) throws SystemException {
109                    return getPersistence().update(passwordPolicy, serviceContext);
110            }
111    
112            /**
113            * Returns the password policy where companyId = &#63; and defaultPolicy = &#63; or throws a {@link com.liferay.portal.NoSuchPasswordPolicyException} if it could not be found.
114            *
115            * @param companyId the company ID
116            * @param defaultPolicy the default policy
117            * @return the matching password policy
118            * @throws com.liferay.portal.NoSuchPasswordPolicyException if a matching password policy could not be found
119            * @throws SystemException if a system exception occurred
120            */
121            public static com.liferay.portal.model.PasswordPolicy findByC_DP(
122                    long companyId, boolean defaultPolicy)
123                    throws com.liferay.portal.NoSuchPasswordPolicyException,
124                            com.liferay.portal.kernel.exception.SystemException {
125                    return getPersistence().findByC_DP(companyId, defaultPolicy);
126            }
127    
128            /**
129            * 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.
130            *
131            * @param companyId the company ID
132            * @param defaultPolicy the default policy
133            * @return the matching password policy, or <code>null</code> if a matching password policy could not be found
134            * @throws SystemException if a system exception occurred
135            */
136            public static com.liferay.portal.model.PasswordPolicy fetchByC_DP(
137                    long companyId, boolean defaultPolicy)
138                    throws com.liferay.portal.kernel.exception.SystemException {
139                    return getPersistence().fetchByC_DP(companyId, defaultPolicy);
140            }
141    
142            /**
143            * 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.
144            *
145            * @param companyId the company ID
146            * @param defaultPolicy the default policy
147            * @param retrieveFromCache whether to use the finder cache
148            * @return the matching password policy, or <code>null</code> if a matching password policy could not be found
149            * @throws SystemException if a system exception occurred
150            */
151            public static com.liferay.portal.model.PasswordPolicy fetchByC_DP(
152                    long companyId, boolean defaultPolicy, boolean retrieveFromCache)
153                    throws com.liferay.portal.kernel.exception.SystemException {
154                    return getPersistence()
155                                       .fetchByC_DP(companyId, defaultPolicy, retrieveFromCache);
156            }
157    
158            /**
159            * Removes the password policy where companyId = &#63; and defaultPolicy = &#63; from the database.
160            *
161            * @param companyId the company ID
162            * @param defaultPolicy the default policy
163            * @return the password policy that was removed
164            * @throws SystemException if a system exception occurred
165            */
166            public static com.liferay.portal.model.PasswordPolicy removeByC_DP(
167                    long companyId, boolean defaultPolicy)
168                    throws com.liferay.portal.NoSuchPasswordPolicyException,
169                            com.liferay.portal.kernel.exception.SystemException {
170                    return getPersistence().removeByC_DP(companyId, defaultPolicy);
171            }
172    
173            /**
174            * Returns the number of password policies where companyId = &#63; and defaultPolicy = &#63;.
175            *
176            * @param companyId the company ID
177            * @param defaultPolicy the default policy
178            * @return the number of matching password policies
179            * @throws SystemException if a system exception occurred
180            */
181            public static int countByC_DP(long companyId, boolean defaultPolicy)
182                    throws com.liferay.portal.kernel.exception.SystemException {
183                    return getPersistence().countByC_DP(companyId, defaultPolicy);
184            }
185    
186            /**
187            * Returns the password policy where companyId = &#63; and name = &#63; or throws a {@link com.liferay.portal.NoSuchPasswordPolicyException} if it could not be found.
188            *
189            * @param companyId the company ID
190            * @param name the name
191            * @return the matching password policy
192            * @throws com.liferay.portal.NoSuchPasswordPolicyException if a matching password policy could not be found
193            * @throws SystemException if a system exception occurred
194            */
195            public static com.liferay.portal.model.PasswordPolicy findByC_N(
196                    long companyId, java.lang.String name)
197                    throws com.liferay.portal.NoSuchPasswordPolicyException,
198                            com.liferay.portal.kernel.exception.SystemException {
199                    return getPersistence().findByC_N(companyId, name);
200            }
201    
202            /**
203            * 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.
204            *
205            * @param companyId the company ID
206            * @param name the name
207            * @return the matching password policy, or <code>null</code> if a matching password policy could not be found
208            * @throws SystemException if a system exception occurred
209            */
210            public static com.liferay.portal.model.PasswordPolicy fetchByC_N(
211                    long companyId, java.lang.String name)
212                    throws com.liferay.portal.kernel.exception.SystemException {
213                    return getPersistence().fetchByC_N(companyId, name);
214            }
215    
216            /**
217            * 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.
218            *
219            * @param companyId the company ID
220            * @param name the name
221            * @param retrieveFromCache whether to use the finder cache
222            * @return the matching password policy, or <code>null</code> if a matching password policy could not be found
223            * @throws SystemException if a system exception occurred
224            */
225            public static com.liferay.portal.model.PasswordPolicy fetchByC_N(
226                    long companyId, java.lang.String name, boolean retrieveFromCache)
227                    throws com.liferay.portal.kernel.exception.SystemException {
228                    return getPersistence().fetchByC_N(companyId, name, retrieveFromCache);
229            }
230    
231            /**
232            * Removes the password policy where companyId = &#63; and name = &#63; from the database.
233            *
234            * @param companyId the company ID
235            * @param name the name
236            * @return the password policy that was removed
237            * @throws SystemException if a system exception occurred
238            */
239            public static com.liferay.portal.model.PasswordPolicy removeByC_N(
240                    long companyId, java.lang.String name)
241                    throws com.liferay.portal.NoSuchPasswordPolicyException,
242                            com.liferay.portal.kernel.exception.SystemException {
243                    return getPersistence().removeByC_N(companyId, name);
244            }
245    
246            /**
247            * Returns the number of password policies where companyId = &#63; and name = &#63;.
248            *
249            * @param companyId the company ID
250            * @param name the name
251            * @return the number of matching password policies
252            * @throws SystemException if a system exception occurred
253            */
254            public static int countByC_N(long companyId, java.lang.String name)
255                    throws com.liferay.portal.kernel.exception.SystemException {
256                    return getPersistence().countByC_N(companyId, name);
257            }
258    
259            /**
260            * Caches the password policy in the entity cache if it is enabled.
261            *
262            * @param passwordPolicy the password policy
263            */
264            public static void cacheResult(
265                    com.liferay.portal.model.PasswordPolicy passwordPolicy) {
266                    getPersistence().cacheResult(passwordPolicy);
267            }
268    
269            /**
270            * Caches the password policies in the entity cache if it is enabled.
271            *
272            * @param passwordPolicies the password policies
273            */
274            public static void cacheResult(
275                    java.util.List<com.liferay.portal.model.PasswordPolicy> passwordPolicies) {
276                    getPersistence().cacheResult(passwordPolicies);
277            }
278    
279            /**
280            * Creates a new password policy with the primary key. Does not add the password policy to the database.
281            *
282            * @param passwordPolicyId the primary key for the new password policy
283            * @return the new password policy
284            */
285            public static com.liferay.portal.model.PasswordPolicy create(
286                    long passwordPolicyId) {
287                    return getPersistence().create(passwordPolicyId);
288            }
289    
290            /**
291            * Removes the password policy with the primary key from the database. Also notifies the appropriate model listeners.
292            *
293            * @param passwordPolicyId the primary key of the password policy
294            * @return the password policy that was removed
295            * @throws com.liferay.portal.NoSuchPasswordPolicyException if a password policy with the primary key could not be found
296            * @throws SystemException if a system exception occurred
297            */
298            public static com.liferay.portal.model.PasswordPolicy remove(
299                    long passwordPolicyId)
300                    throws com.liferay.portal.NoSuchPasswordPolicyException,
301                            com.liferay.portal.kernel.exception.SystemException {
302                    return getPersistence().remove(passwordPolicyId);
303            }
304    
305            public static com.liferay.portal.model.PasswordPolicy updateImpl(
306                    com.liferay.portal.model.PasswordPolicy passwordPolicy)
307                    throws com.liferay.portal.kernel.exception.SystemException {
308                    return getPersistence().updateImpl(passwordPolicy);
309            }
310    
311            /**
312            * Returns the password policy with the primary key or throws a {@link com.liferay.portal.NoSuchPasswordPolicyException} if it could not be found.
313            *
314            * @param passwordPolicyId the primary key of the password policy
315            * @return the password policy
316            * @throws com.liferay.portal.NoSuchPasswordPolicyException if a password policy with the primary key could not be found
317            * @throws SystemException if a system exception occurred
318            */
319            public static com.liferay.portal.model.PasswordPolicy findByPrimaryKey(
320                    long passwordPolicyId)
321                    throws com.liferay.portal.NoSuchPasswordPolicyException,
322                            com.liferay.portal.kernel.exception.SystemException {
323                    return getPersistence().findByPrimaryKey(passwordPolicyId);
324            }
325    
326            /**
327            * Returns the password policy with the primary key or returns <code>null</code> if it could not be found.
328            *
329            * @param passwordPolicyId the primary key of the password policy
330            * @return the password policy, or <code>null</code> if a password policy with the primary key could not be found
331            * @throws SystemException if a system exception occurred
332            */
333            public static com.liferay.portal.model.PasswordPolicy fetchByPrimaryKey(
334                    long passwordPolicyId)
335                    throws com.liferay.portal.kernel.exception.SystemException {
336                    return getPersistence().fetchByPrimaryKey(passwordPolicyId);
337            }
338    
339            /**
340            * Returns all the password policies.
341            *
342            * @return the password policies
343            * @throws SystemException if a system exception occurred
344            */
345            public static java.util.List<com.liferay.portal.model.PasswordPolicy> findAll()
346                    throws com.liferay.portal.kernel.exception.SystemException {
347                    return getPersistence().findAll();
348            }
349    
350            /**
351            * Returns a range of all the password policies.
352            *
353            * <p>
354            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.PasswordPolicyModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
355            * </p>
356            *
357            * @param start the lower bound of the range of password policies
358            * @param end the upper bound of the range of password policies (not inclusive)
359            * @return the range of password policies
360            * @throws SystemException if a system exception occurred
361            */
362            public static java.util.List<com.liferay.portal.model.PasswordPolicy> findAll(
363                    int start, int end)
364                    throws com.liferay.portal.kernel.exception.SystemException {
365                    return getPersistence().findAll(start, end);
366            }
367    
368            /**
369            * Returns an ordered range of all the password policies.
370            *
371            * <p>
372            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.PasswordPolicyModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
373            * </p>
374            *
375            * @param start the lower bound of the range of password policies
376            * @param end the upper bound of the range of password policies (not inclusive)
377            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
378            * @return the ordered range of password policies
379            * @throws SystemException if a system exception occurred
380            */
381            public static java.util.List<com.liferay.portal.model.PasswordPolicy> findAll(
382                    int start, int end,
383                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
384                    throws com.liferay.portal.kernel.exception.SystemException {
385                    return getPersistence().findAll(start, end, orderByComparator);
386            }
387    
388            /**
389            * Removes all the password policies from the database.
390            *
391            * @throws SystemException if a system exception occurred
392            */
393            public static void removeAll()
394                    throws com.liferay.portal.kernel.exception.SystemException {
395                    getPersistence().removeAll();
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    }