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 void cacheResult(
30          com.liferay.portal.model.PasswordPolicy passwordPolicy) {
31          getPersistence().cacheResult(passwordPolicy);
32      }
33  
34      public static void cacheResult(
35          java.util.List<com.liferay.portal.model.PasswordPolicy> passwordPolicies) {
36          getPersistence().cacheResult(passwordPolicies);
37      }
38  
39      public static void clearCache() {
40          getPersistence().clearCache();
41      }
42  
43      public static com.liferay.portal.model.PasswordPolicy create(
44          long passwordPolicyId) {
45          return getPersistence().create(passwordPolicyId);
46      }
47  
48      public static com.liferay.portal.model.PasswordPolicy remove(
49          long passwordPolicyId)
50          throws com.liferay.portal.NoSuchPasswordPolicyException,
51              com.liferay.portal.SystemException {
52          return getPersistence().remove(passwordPolicyId);
53      }
54  
55      public static com.liferay.portal.model.PasswordPolicy remove(
56          com.liferay.portal.model.PasswordPolicy passwordPolicy)
57          throws com.liferay.portal.SystemException {
58          return getPersistence().remove(passwordPolicy);
59      }
60  
61      /**
62       * @deprecated Use <code>update(PasswordPolicy passwordPolicy, boolean merge)</code>.
63       */
64      public static com.liferay.portal.model.PasswordPolicy update(
65          com.liferay.portal.model.PasswordPolicy passwordPolicy)
66          throws com.liferay.portal.SystemException {
67          return getPersistence().update(passwordPolicy);
68      }
69  
70      /**
71       * Add, update, or merge, the entity. This method also calls the model
72       * listeners to trigger the proper events associated with adding, deleting,
73       * or updating an entity.
74       *
75       * @param        passwordPolicy the entity to add, update, or merge
76       * @param        merge boolean value for whether to merge the entity. The
77       *                default value is false. Setting merge to true is more
78       *                expensive and should only be true when passwordPolicy is
79       *                transient. See LEP-5473 for a detailed discussion of this
80       *                method.
81       * @return        true if the portlet can be displayed via Ajax
82       */
83      public static com.liferay.portal.model.PasswordPolicy update(
84          com.liferay.portal.model.PasswordPolicy passwordPolicy, boolean merge)
85          throws com.liferay.portal.SystemException {
86          return getPersistence().update(passwordPolicy, merge);
87      }
88  
89      public static com.liferay.portal.model.PasswordPolicy updateImpl(
90          com.liferay.portal.model.PasswordPolicy passwordPolicy, boolean merge)
91          throws com.liferay.portal.SystemException {
92          return getPersistence().updateImpl(passwordPolicy, merge);
93      }
94  
95      public static com.liferay.portal.model.PasswordPolicy findByPrimaryKey(
96          long passwordPolicyId)
97          throws com.liferay.portal.NoSuchPasswordPolicyException,
98              com.liferay.portal.SystemException {
99          return getPersistence().findByPrimaryKey(passwordPolicyId);
100     }
101 
102     public static com.liferay.portal.model.PasswordPolicy fetchByPrimaryKey(
103         long passwordPolicyId) throws com.liferay.portal.SystemException {
104         return getPersistence().fetchByPrimaryKey(passwordPolicyId);
105     }
106 
107     public static com.liferay.portal.model.PasswordPolicy findByC_DP(
108         long companyId, boolean defaultPolicy)
109         throws com.liferay.portal.NoSuchPasswordPolicyException,
110             com.liferay.portal.SystemException {
111         return getPersistence().findByC_DP(companyId, defaultPolicy);
112     }
113 
114     public static com.liferay.portal.model.PasswordPolicy fetchByC_DP(
115         long companyId, boolean defaultPolicy)
116         throws com.liferay.portal.SystemException {
117         return getPersistence().fetchByC_DP(companyId, defaultPolicy);
118     }
119 
120     public static com.liferay.portal.model.PasswordPolicy fetchByC_DP(
121         long companyId, boolean defaultPolicy, boolean retrieveFromCache)
122         throws com.liferay.portal.SystemException {
123         return getPersistence()
124                    .fetchByC_DP(companyId, defaultPolicy, retrieveFromCache);
125     }
126 
127     public static com.liferay.portal.model.PasswordPolicy findByC_N(
128         long companyId, java.lang.String name)
129         throws com.liferay.portal.NoSuchPasswordPolicyException,
130             com.liferay.portal.SystemException {
131         return getPersistence().findByC_N(companyId, name);
132     }
133 
134     public static com.liferay.portal.model.PasswordPolicy fetchByC_N(
135         long companyId, java.lang.String name)
136         throws com.liferay.portal.SystemException {
137         return getPersistence().fetchByC_N(companyId, name);
138     }
139 
140     public static com.liferay.portal.model.PasswordPolicy fetchByC_N(
141         long companyId, java.lang.String name, boolean retrieveFromCache)
142         throws com.liferay.portal.SystemException {
143         return getPersistence().fetchByC_N(companyId, name, retrieveFromCache);
144     }
145 
146     public static java.util.List<Object> findWithDynamicQuery(
147         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
148         throws com.liferay.portal.SystemException {
149         return getPersistence().findWithDynamicQuery(dynamicQuery);
150     }
151 
152     public static java.util.List<Object> findWithDynamicQuery(
153         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
154         int end) throws com.liferay.portal.SystemException {
155         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
156     }
157 
158     public static java.util.List<com.liferay.portal.model.PasswordPolicy> findAll()
159         throws com.liferay.portal.SystemException {
160         return getPersistence().findAll();
161     }
162 
163     public static java.util.List<com.liferay.portal.model.PasswordPolicy> findAll(
164         int start, int end) throws com.liferay.portal.SystemException {
165         return getPersistence().findAll(start, end);
166     }
167 
168     public static java.util.List<com.liferay.portal.model.PasswordPolicy> findAll(
169         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
170         throws com.liferay.portal.SystemException {
171         return getPersistence().findAll(start, end, obc);
172     }
173 
174     public static void removeByC_DP(long companyId, boolean defaultPolicy)
175         throws com.liferay.portal.NoSuchPasswordPolicyException,
176             com.liferay.portal.SystemException {
177         getPersistence().removeByC_DP(companyId, defaultPolicy);
178     }
179 
180     public static void removeByC_N(long companyId, java.lang.String name)
181         throws com.liferay.portal.NoSuchPasswordPolicyException,
182             com.liferay.portal.SystemException {
183         getPersistence().removeByC_N(companyId, name);
184     }
185 
186     public static void removeAll() throws com.liferay.portal.SystemException {
187         getPersistence().removeAll();
188     }
189 
190     public static int countByC_DP(long companyId, boolean defaultPolicy)
191         throws com.liferay.portal.SystemException {
192         return getPersistence().countByC_DP(companyId, defaultPolicy);
193     }
194 
195     public static int countByC_N(long companyId, java.lang.String name)
196         throws com.liferay.portal.SystemException {
197         return getPersistence().countByC_N(companyId, name);
198     }
199 
200     public static int countAll() throws com.liferay.portal.SystemException {
201         return getPersistence().countAll();
202     }
203 
204     public static PasswordPolicyPersistence getPersistence() {
205         return _persistence;
206     }
207 
208     public void setPersistence(PasswordPolicyPersistence persistence) {
209         _persistence = persistence;
210     }
211 
212     private static PasswordPolicyPersistence _persistence;
213 }