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