1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portal.service.persistence;
21  
22  /**
23   * <a href="PasswordPolicyUtil.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   *
27   */
28  public class PasswordPolicyUtil {
29      public static com.liferay.portal.model.PasswordPolicy create(
30          long passwordPolicyId) {
31          return getPersistence().create(passwordPolicyId);
32      }
33  
34      public static com.liferay.portal.model.PasswordPolicy remove(
35          long passwordPolicyId)
36          throws com.liferay.portal.NoSuchPasswordPolicyException,
37              com.liferay.portal.SystemException {
38          return getPersistence().remove(passwordPolicyId);
39      }
40  
41      public static com.liferay.portal.model.PasswordPolicy remove(
42          com.liferay.portal.model.PasswordPolicy passwordPolicy)
43          throws com.liferay.portal.SystemException {
44          return getPersistence().remove(passwordPolicy);
45      }
46  
47      /**
48       * @deprecated Use <code>update(PasswordPolicy passwordPolicy, boolean merge)</code>.
49       */
50      public static com.liferay.portal.model.PasswordPolicy update(
51          com.liferay.portal.model.PasswordPolicy passwordPolicy)
52          throws com.liferay.portal.SystemException {
53          return getPersistence().update(passwordPolicy);
54      }
55  
56      /**
57       * Add, update, or merge, the entity. This method also calls the model
58       * listeners to trigger the proper events associated with adding, deleting,
59       * or updating an entity.
60       *
61       * @param        passwordPolicy the entity to add, update, or merge
62       * @param        merge boolean value for whether to merge the entity. The
63       *                default value is false. Setting merge to true is more
64       *                expensive and should only be true when passwordPolicy is
65       *                transient. See LEP-5473 for a detailed discussion of this
66       *                method.
67       * @return        true if the portlet can be displayed via Ajax
68       */
69      public static com.liferay.portal.model.PasswordPolicy update(
70          com.liferay.portal.model.PasswordPolicy passwordPolicy, boolean merge)
71          throws com.liferay.portal.SystemException {
72          return getPersistence().update(passwordPolicy, merge);
73      }
74  
75      public static com.liferay.portal.model.PasswordPolicy updateImpl(
76          com.liferay.portal.model.PasswordPolicy passwordPolicy, boolean merge)
77          throws com.liferay.portal.SystemException {
78          return getPersistence().updateImpl(passwordPolicy, merge);
79      }
80  
81      public static com.liferay.portal.model.PasswordPolicy findByPrimaryKey(
82          long passwordPolicyId)
83          throws com.liferay.portal.NoSuchPasswordPolicyException,
84              com.liferay.portal.SystemException {
85          return getPersistence().findByPrimaryKey(passwordPolicyId);
86      }
87  
88      public static com.liferay.portal.model.PasswordPolicy fetchByPrimaryKey(
89          long passwordPolicyId) throws com.liferay.portal.SystemException {
90          return getPersistence().fetchByPrimaryKey(passwordPolicyId);
91      }
92  
93      public static com.liferay.portal.model.PasswordPolicy findByC_DP(
94          long companyId, boolean defaultPolicy)
95          throws com.liferay.portal.NoSuchPasswordPolicyException,
96              com.liferay.portal.SystemException {
97          return getPersistence().findByC_DP(companyId, defaultPolicy);
98      }
99  
100     public static com.liferay.portal.model.PasswordPolicy fetchByC_DP(
101         long companyId, boolean defaultPolicy)
102         throws com.liferay.portal.SystemException {
103         return getPersistence().fetchByC_DP(companyId, defaultPolicy);
104     }
105 
106     public static com.liferay.portal.model.PasswordPolicy findByC_N(
107         long companyId, java.lang.String name)
108         throws com.liferay.portal.NoSuchPasswordPolicyException,
109             com.liferay.portal.SystemException {
110         return getPersistence().findByC_N(companyId, name);
111     }
112 
113     public static com.liferay.portal.model.PasswordPolicy fetchByC_N(
114         long companyId, java.lang.String name)
115         throws com.liferay.portal.SystemException {
116         return getPersistence().fetchByC_N(companyId, name);
117     }
118 
119     public static java.util.List<Object> findWithDynamicQuery(
120         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
121         throws com.liferay.portal.SystemException {
122         return getPersistence().findWithDynamicQuery(dynamicQuery);
123     }
124 
125     public static java.util.List<Object> findWithDynamicQuery(
126         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
127         int end) throws com.liferay.portal.SystemException {
128         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
129     }
130 
131     public static java.util.List<com.liferay.portal.model.PasswordPolicy> findAll()
132         throws com.liferay.portal.SystemException {
133         return getPersistence().findAll();
134     }
135 
136     public static java.util.List<com.liferay.portal.model.PasswordPolicy> findAll(
137         int start, int end) throws com.liferay.portal.SystemException {
138         return getPersistence().findAll(start, end);
139     }
140 
141     public static java.util.List<com.liferay.portal.model.PasswordPolicy> findAll(
142         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
143         throws com.liferay.portal.SystemException {
144         return getPersistence().findAll(start, end, obc);
145     }
146 
147     public static void removeByC_DP(long companyId, boolean defaultPolicy)
148         throws com.liferay.portal.NoSuchPasswordPolicyException,
149             com.liferay.portal.SystemException {
150         getPersistence().removeByC_DP(companyId, defaultPolicy);
151     }
152 
153     public static void removeByC_N(long companyId, java.lang.String name)
154         throws com.liferay.portal.NoSuchPasswordPolicyException,
155             com.liferay.portal.SystemException {
156         getPersistence().removeByC_N(companyId, name);
157     }
158 
159     public static void removeAll() throws com.liferay.portal.SystemException {
160         getPersistence().removeAll();
161     }
162 
163     public static int countByC_DP(long companyId, boolean defaultPolicy)
164         throws com.liferay.portal.SystemException {
165         return getPersistence().countByC_DP(companyId, defaultPolicy);
166     }
167 
168     public static int countByC_N(long companyId, java.lang.String name)
169         throws com.liferay.portal.SystemException {
170         return getPersistence().countByC_N(companyId, name);
171     }
172 
173     public static int countAll() throws com.liferay.portal.SystemException {
174         return getPersistence().countAll();
175     }
176 
177     public static PasswordPolicyPersistence getPersistence() {
178         return _persistence;
179     }
180 
181     public void setPersistence(PasswordPolicyPersistence persistence) {
182         _persistence = persistence;
183     }
184 
185     private static PasswordPolicyPersistence _persistence;
186 }