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.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#remove(com.liferay.portal.model.BaseModel)
098             */
099            public static PasswordPolicy remove(PasswordPolicy passwordPolicy)
100                    throws SystemException {
101                    return getPersistence().remove(passwordPolicy);
102            }
103    
104            /**
105             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
106             */
107            public static PasswordPolicy update(PasswordPolicy passwordPolicy,
108                    boolean merge) throws SystemException {
109                    return getPersistence().update(passwordPolicy, merge);
110            }
111    
112            /**
113             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
114             */
115            public static PasswordPolicy update(PasswordPolicy passwordPolicy,
116                    boolean merge, ServiceContext serviceContext) throws SystemException {
117                    return getPersistence().update(passwordPolicy, merge, serviceContext);
118            }
119    
120            /**
121            * Caches the password policy in the entity cache if it is enabled.
122            *
123            * @param passwordPolicy the password policy to cache
124            */
125            public static void cacheResult(
126                    com.liferay.portal.model.PasswordPolicy passwordPolicy) {
127                    getPersistence().cacheResult(passwordPolicy);
128            }
129    
130            /**
131            * Caches the password policies in the entity cache if it is enabled.
132            *
133            * @param passwordPolicies the password policies to cache
134            */
135            public static void cacheResult(
136                    java.util.List<com.liferay.portal.model.PasswordPolicy> passwordPolicies) {
137                    getPersistence().cacheResult(passwordPolicies);
138            }
139    
140            /**
141            * Creates a new password policy with the primary key. Does not add the password policy to the database.
142            *
143            * @param passwordPolicyId the primary key for the new password policy
144            * @return the new password policy
145            */
146            public static com.liferay.portal.model.PasswordPolicy create(
147                    long passwordPolicyId) {
148                    return getPersistence().create(passwordPolicyId);
149            }
150    
151            /**
152            * Removes the password policy with the primary key from the database. Also notifies the appropriate model listeners.
153            *
154            * @param passwordPolicyId the primary key of the password policy to remove
155            * @return the password policy that was removed
156            * @throws com.liferay.portal.NoSuchPasswordPolicyException if a password policy with the primary key could not be found
157            * @throws SystemException if a system exception occurred
158            */
159            public static com.liferay.portal.model.PasswordPolicy remove(
160                    long passwordPolicyId)
161                    throws com.liferay.portal.NoSuchPasswordPolicyException,
162                            com.liferay.portal.kernel.exception.SystemException {
163                    return getPersistence().remove(passwordPolicyId);
164            }
165    
166            public static com.liferay.portal.model.PasswordPolicy updateImpl(
167                    com.liferay.portal.model.PasswordPolicy passwordPolicy, boolean merge)
168                    throws com.liferay.portal.kernel.exception.SystemException {
169                    return getPersistence().updateImpl(passwordPolicy, merge);
170            }
171    
172            /**
173            * Finds the password policy with the primary key or throws a {@link com.liferay.portal.NoSuchPasswordPolicyException} if it could not be found.
174            *
175            * @param passwordPolicyId the primary key of the password policy to find
176            * @return the password policy
177            * @throws com.liferay.portal.NoSuchPasswordPolicyException if a password policy with the primary key could not be found
178            * @throws SystemException if a system exception occurred
179            */
180            public static com.liferay.portal.model.PasswordPolicy findByPrimaryKey(
181                    long passwordPolicyId)
182                    throws com.liferay.portal.NoSuchPasswordPolicyException,
183                            com.liferay.portal.kernel.exception.SystemException {
184                    return getPersistence().findByPrimaryKey(passwordPolicyId);
185            }
186    
187            /**
188            * Finds the password policy with the primary key or returns <code>null</code> if it could not be found.
189            *
190            * @param passwordPolicyId the primary key of the password policy to find
191            * @return the password policy, or <code>null</code> if a password policy with the primary key could not be found
192            * @throws SystemException if a system exception occurred
193            */
194            public static com.liferay.portal.model.PasswordPolicy fetchByPrimaryKey(
195                    long passwordPolicyId)
196                    throws com.liferay.portal.kernel.exception.SystemException {
197                    return getPersistence().fetchByPrimaryKey(passwordPolicyId);
198            }
199    
200            /**
201            * Finds the password policy where companyId = &#63; and defaultPolicy = &#63; or throws a {@link com.liferay.portal.NoSuchPasswordPolicyException} if it could not be found.
202            *
203            * @param companyId the company ID to search with
204            * @param defaultPolicy the default policy to search with
205            * @return the matching password policy
206            * @throws com.liferay.portal.NoSuchPasswordPolicyException if a matching password policy could not be found
207            * @throws SystemException if a system exception occurred
208            */
209            public static com.liferay.portal.model.PasswordPolicy findByC_DP(
210                    long companyId, boolean defaultPolicy)
211                    throws com.liferay.portal.NoSuchPasswordPolicyException,
212                            com.liferay.portal.kernel.exception.SystemException {
213                    return getPersistence().findByC_DP(companyId, defaultPolicy);
214            }
215    
216            /**
217            * 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.
218            *
219            * @param companyId the company ID to search with
220            * @param defaultPolicy the default policy to search with
221            * @return the matching password policy, or <code>null</code> if a matching password policy could not be found
222            * @throws SystemException if a system exception occurred
223            */
224            public static com.liferay.portal.model.PasswordPolicy fetchByC_DP(
225                    long companyId, boolean defaultPolicy)
226                    throws com.liferay.portal.kernel.exception.SystemException {
227                    return getPersistence().fetchByC_DP(companyId, defaultPolicy);
228            }
229    
230            /**
231            * 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.
232            *
233            * @param companyId the company ID to search with
234            * @param defaultPolicy the default policy to search with
235            * @return the matching password policy, or <code>null</code> if a matching password policy could not be found
236            * @throws SystemException if a system exception occurred
237            */
238            public static com.liferay.portal.model.PasswordPolicy fetchByC_DP(
239                    long companyId, boolean defaultPolicy, boolean retrieveFromCache)
240                    throws com.liferay.portal.kernel.exception.SystemException {
241                    return getPersistence()
242                                       .fetchByC_DP(companyId, defaultPolicy, retrieveFromCache);
243            }
244    
245            /**
246            * Finds the password policy where companyId = &#63; and name = &#63; or throws a {@link com.liferay.portal.NoSuchPasswordPolicyException} if it could not be found.
247            *
248            * @param companyId the company ID to search with
249            * @param name the name to search with
250            * @return the matching password policy
251            * @throws com.liferay.portal.NoSuchPasswordPolicyException if a matching password policy could not be found
252            * @throws SystemException if a system exception occurred
253            */
254            public static com.liferay.portal.model.PasswordPolicy findByC_N(
255                    long companyId, java.lang.String name)
256                    throws com.liferay.portal.NoSuchPasswordPolicyException,
257                            com.liferay.portal.kernel.exception.SystemException {
258                    return getPersistence().findByC_N(companyId, name);
259            }
260    
261            /**
262            * 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.
263            *
264            * @param companyId the company ID to search with
265            * @param name the name to search with
266            * @return the matching password policy, or <code>null</code> if a matching password policy could not be found
267            * @throws SystemException if a system exception occurred
268            */
269            public static com.liferay.portal.model.PasswordPolicy fetchByC_N(
270                    long companyId, java.lang.String name)
271                    throws com.liferay.portal.kernel.exception.SystemException {
272                    return getPersistence().fetchByC_N(companyId, name);
273            }
274    
275            /**
276            * 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.
277            *
278            * @param companyId the company ID to search with
279            * @param name the name to search with
280            * @return the matching password policy, or <code>null</code> if a matching password policy could not be found
281            * @throws SystemException if a system exception occurred
282            */
283            public static com.liferay.portal.model.PasswordPolicy fetchByC_N(
284                    long companyId, java.lang.String name, boolean retrieveFromCache)
285                    throws com.liferay.portal.kernel.exception.SystemException {
286                    return getPersistence().fetchByC_N(companyId, name, retrieveFromCache);
287            }
288    
289            /**
290            * Finds all the password policies.
291            *
292            * @return the password policies
293            * @throws SystemException if a system exception occurred
294            */
295            public static java.util.List<com.liferay.portal.model.PasswordPolicy> findAll()
296                    throws com.liferay.portal.kernel.exception.SystemException {
297                    return getPersistence().findAll();
298            }
299    
300            /**
301            * Finds a range of all the password policies.
302            *
303            * <p>
304            * 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.
305            * </p>
306            *
307            * @param start the lower bound of the range of password policies to return
308            * @param end the upper bound of the range of password policies to return (not inclusive)
309            * @return the range of password policies
310            * @throws SystemException if a system exception occurred
311            */
312            public static java.util.List<com.liferay.portal.model.PasswordPolicy> findAll(
313                    int start, int end)
314                    throws com.liferay.portal.kernel.exception.SystemException {
315                    return getPersistence().findAll(start, end);
316            }
317    
318            /**
319            * Finds an ordered range of all the password policies.
320            *
321            * <p>
322            * 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.
323            * </p>
324            *
325            * @param start the lower bound of the range of password policies to return
326            * @param end the upper bound of the range of password policies to return (not inclusive)
327            * @param orderByComparator the comparator to order the results by
328            * @return the ordered range of password policies
329            * @throws SystemException if a system exception occurred
330            */
331            public static java.util.List<com.liferay.portal.model.PasswordPolicy> findAll(
332                    int start, int end,
333                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
334                    throws com.liferay.portal.kernel.exception.SystemException {
335                    return getPersistence().findAll(start, end, orderByComparator);
336            }
337    
338            /**
339            * Removes the password policy where companyId = &#63; and defaultPolicy = &#63; from the database.
340            *
341            * @param companyId the company ID to search with
342            * @param defaultPolicy the default policy to search with
343            * @throws SystemException if a system exception occurred
344            */
345            public static void removeByC_DP(long companyId, boolean defaultPolicy)
346                    throws com.liferay.portal.NoSuchPasswordPolicyException,
347                            com.liferay.portal.kernel.exception.SystemException {
348                    getPersistence().removeByC_DP(companyId, defaultPolicy);
349            }
350    
351            /**
352            * Removes the password policy where companyId = &#63; and name = &#63; from the database.
353            *
354            * @param companyId the company ID to search with
355            * @param name the name to search with
356            * @throws SystemException if a system exception occurred
357            */
358            public static void removeByC_N(long companyId, java.lang.String name)
359                    throws com.liferay.portal.NoSuchPasswordPolicyException,
360                            com.liferay.portal.kernel.exception.SystemException {
361                    getPersistence().removeByC_N(companyId, name);
362            }
363    
364            /**
365            * Removes all the password policies from the database.
366            *
367            * @throws SystemException if a system exception occurred
368            */
369            public static void removeAll()
370                    throws com.liferay.portal.kernel.exception.SystemException {
371                    getPersistence().removeAll();
372            }
373    
374            /**
375            * Counts all the password policies where companyId = &#63; and defaultPolicy = &#63;.
376            *
377            * @param companyId the company ID to search with
378            * @param defaultPolicy the default policy to search with
379            * @return the number of matching password policies
380            * @throws SystemException if a system exception occurred
381            */
382            public static int countByC_DP(long companyId, boolean defaultPolicy)
383                    throws com.liferay.portal.kernel.exception.SystemException {
384                    return getPersistence().countByC_DP(companyId, defaultPolicy);
385            }
386    
387            /**
388            * Counts all the password policies where companyId = &#63; and name = &#63;.
389            *
390            * @param companyId the company ID to search with
391            * @param name the name to search with
392            * @return the number of matching password policies
393            * @throws SystemException if a system exception occurred
394            */
395            public static int countByC_N(long companyId, java.lang.String name)
396                    throws com.liferay.portal.kernel.exception.SystemException {
397                    return getPersistence().countByC_N(companyId, name);
398            }
399    
400            /**
401            * Counts all the password policies.
402            *
403            * @return the number of password policies
404            * @throws SystemException if a system exception occurred
405            */
406            public static int countAll()
407                    throws com.liferay.portal.kernel.exception.SystemException {
408                    return getPersistence().countAll();
409            }
410    
411            public static PasswordPolicyPersistence getPersistence() {
412                    if (_persistence == null) {
413                            _persistence = (PasswordPolicyPersistence)PortalBeanLocatorUtil.locate(PasswordPolicyPersistence.class.getName());
414    
415                            ReferenceRegistry.registerReference(PasswordPolicyUtil.class,
416                                    "_persistence");
417                    }
418    
419                    return _persistence;
420            }
421    
422            public void setPersistence(PasswordPolicyPersistence persistence) {
423                    _persistence = persistence;
424    
425                    ReferenceRegistry.registerReference(PasswordPolicyUtil.class,
426                            "_persistence");
427            }
428    
429            private static PasswordPolicyPersistence _persistence;
430    }