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