Liferay 6.1.2-ce-ga3

com.liferay.portal.service.persistence
Class PasswordPolicyUtil

java.lang.Object
  extended by com.liferay.portal.service.persistence.PasswordPolicyUtil

public class PasswordPolicyUtil
extends Object

The persistence utility for the password policy service. This utility wraps 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.

Caching information and settings can be found in portal.properties

See Also:
PasswordPolicyPersistence, PasswordPolicyPersistenceImpl

Constructor Summary
PasswordPolicyUtil()
           
 
Method Summary
static void cacheResult(List<PasswordPolicy> passwordPolicies)
          Caches the password policies in the entity cache if it is enabled.
static void cacheResult(PasswordPolicy passwordPolicy)
          Caches the password policy in the entity cache if it is enabled.
static void clearCache()
           
static void clearCache(PasswordPolicy passwordPolicy)
           
static int countAll()
          Returns the number of password policies.
static int countByC_DP(long companyId, boolean defaultPolicy)
          Returns the number of password policies where companyId = ? and defaultPolicy = ?.
static int countByC_N(long companyId, String name)
          Returns the number of password policies where companyId = ? and name = ?.
 long countWithDynamicQuery(DynamicQuery dynamicQuery)
           
static PasswordPolicy create(long passwordPolicyId)
          Creates a new password policy with the primary key.
static PasswordPolicy fetchByC_DP(long companyId, boolean defaultPolicy)
          Returns the password policy where companyId = ? and defaultPolicy = ? or returns null if it could not be found.
static PasswordPolicy fetchByC_DP(long companyId, boolean defaultPolicy, boolean retrieveFromCache)
          Returns the password policy where companyId = ? and defaultPolicy = ? or returns null if it could not be found, optionally using the finder cache.
static PasswordPolicy fetchByC_N(long companyId, String name)
          Returns the password policy where companyId = ? and name = ? or returns null if it could not be found.
static PasswordPolicy fetchByC_N(long companyId, String name, boolean retrieveFromCache)
          Returns the password policy where companyId = ? and name = ? or returns null if it could not be found, optionally using the finder cache.
static PasswordPolicy fetchByPrimaryKey(long passwordPolicyId)
          Returns the password policy with the primary key or returns null if it could not be found.
static List<PasswordPolicy> findAll()
          Returns all the password policies.
static List<PasswordPolicy> findAll(int start, int end)
          Returns a range of all the password policies.
static List<PasswordPolicy> findAll(int start, int end, OrderByComparator orderByComparator)
          Returns an ordered range of all the password policies.
static PasswordPolicy findByC_DP(long companyId, boolean defaultPolicy)
          Returns the password policy where companyId = ? and defaultPolicy = ? or throws a NoSuchPasswordPolicyException if it could not be found.
static PasswordPolicy findByC_N(long companyId, String name)
          Returns the password policy where companyId = ? and name = ? or throws a NoSuchPasswordPolicyException if it could not be found.
static PasswordPolicy findByPrimaryKey(long passwordPolicyId)
          Returns the password policy with the primary key or throws a NoSuchPasswordPolicyException if it could not be found.
static List<PasswordPolicy> findWithDynamicQuery(DynamicQuery dynamicQuery)
           
static List<PasswordPolicy> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end)
           
static List<PasswordPolicy> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator orderByComparator)
           
static PasswordPolicyPersistence getPersistence()
           
static PasswordPolicy remove(long passwordPolicyId)
          Removes the password policy with the primary key from the database.
static void removeAll()
          Removes all the password policies from the database.
static PasswordPolicy removeByC_DP(long companyId, boolean defaultPolicy)
          Removes the password policy where companyId = ? and defaultPolicy = ? from the database.
static PasswordPolicy removeByC_N(long companyId, String name)
          Removes the password policy where companyId = ? and name = ? from the database.
 void setPersistence(PasswordPolicyPersistence persistence)
          Deprecated.  
static PasswordPolicy update(PasswordPolicy passwordPolicy, boolean merge)
           
static PasswordPolicy update(PasswordPolicy passwordPolicy, boolean merge, ServiceContext serviceContext)
           
static PasswordPolicy updateImpl(PasswordPolicy passwordPolicy, boolean merge)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PasswordPolicyUtil

public PasswordPolicyUtil()
Method Detail

clearCache

public static void clearCache()
See Also:
BasePersistence.clearCache()

clearCache

public static void clearCache(PasswordPolicy passwordPolicy)
See Also:
BasePersistence.clearCache(com.liferay.portal.model.BaseModel)

countWithDynamicQuery

public long countWithDynamicQuery(DynamicQuery dynamicQuery)
                           throws SystemException
Throws:
SystemException
See Also:
BasePersistence.countWithDynamicQuery(DynamicQuery)

findWithDynamicQuery

public static List<PasswordPolicy> findWithDynamicQuery(DynamicQuery dynamicQuery)
                                                 throws SystemException
Throws:
SystemException
See Also:
BasePersistence.findWithDynamicQuery(DynamicQuery)

findWithDynamicQuery

public static List<PasswordPolicy> findWithDynamicQuery(DynamicQuery dynamicQuery,
                                                        int start,
                                                        int end)
                                                 throws SystemException
Throws:
SystemException
See Also:
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int)

findWithDynamicQuery

public static List<PasswordPolicy> findWithDynamicQuery(DynamicQuery dynamicQuery,
                                                        int start,
                                                        int end,
                                                        OrderByComparator orderByComparator)
                                                 throws SystemException
Throws:
SystemException
See Also:
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)

update

public static PasswordPolicy update(PasswordPolicy passwordPolicy,
                                    boolean merge)
                             throws SystemException
Throws:
SystemException
See Also:
BasePersistence.update(com.liferay.portal.model.BaseModel, boolean)

update

public static PasswordPolicy update(PasswordPolicy passwordPolicy,
                                    boolean merge,
                                    ServiceContext serviceContext)
                             throws SystemException
Throws:
SystemException
See Also:
BasePersistence.update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)

cacheResult

public static void cacheResult(PasswordPolicy passwordPolicy)
Caches the password policy in the entity cache if it is enabled.

Parameters:
passwordPolicy - the password policy

cacheResult

public static void cacheResult(List<PasswordPolicy> passwordPolicies)
Caches the password policies in the entity cache if it is enabled.

Parameters:
passwordPolicies - the password policies

create

public static PasswordPolicy create(long passwordPolicyId)
Creates a new password policy with the primary key. Does not add the password policy to the database.

Parameters:
passwordPolicyId - the primary key for the new password policy
Returns:
the new password policy

remove

public static PasswordPolicy remove(long passwordPolicyId)
                             throws NoSuchPasswordPolicyException,
                                    SystemException
Removes the password policy with the primary key from the database. Also notifies the appropriate model listeners.

Parameters:
passwordPolicyId - the primary key of the password policy
Returns:
the password policy that was removed
Throws:
NoSuchPasswordPolicyException - if a password policy with the primary key could not be found
SystemException - if a system exception occurred

updateImpl

public static PasswordPolicy updateImpl(PasswordPolicy passwordPolicy,
                                        boolean merge)
                                 throws SystemException
Throws:
SystemException

findByPrimaryKey

public static PasswordPolicy findByPrimaryKey(long passwordPolicyId)
                                       throws NoSuchPasswordPolicyException,
                                              SystemException
Returns the password policy with the primary key or throws a NoSuchPasswordPolicyException if it could not be found.

Parameters:
passwordPolicyId - the primary key of the password policy
Returns:
the password policy
Throws:
NoSuchPasswordPolicyException - if a password policy with the primary key could not be found
SystemException - if a system exception occurred

fetchByPrimaryKey

public static PasswordPolicy fetchByPrimaryKey(long passwordPolicyId)
                                        throws SystemException
Returns the password policy with the primary key or returns null if it could not be found.

Parameters:
passwordPolicyId - the primary key of the password policy
Returns:
the password policy, or null if a password policy with the primary key could not be found
Throws:
SystemException - if a system exception occurred

findByC_DP

public static PasswordPolicy findByC_DP(long companyId,
                                        boolean defaultPolicy)
                                 throws NoSuchPasswordPolicyException,
                                        SystemException
Returns the password policy where companyId = ? and defaultPolicy = ? or throws a NoSuchPasswordPolicyException if it could not be found.

Parameters:
companyId - the company ID
defaultPolicy - the default policy
Returns:
the matching password policy
Throws:
NoSuchPasswordPolicyException - if a matching password policy could not be found
SystemException - if a system exception occurred

fetchByC_DP

public static PasswordPolicy fetchByC_DP(long companyId,
                                         boolean defaultPolicy)
                                  throws SystemException
Returns the password policy where companyId = ? and defaultPolicy = ? or returns null if it could not be found. Uses the finder cache.

Parameters:
companyId - the company ID
defaultPolicy - the default policy
Returns:
the matching password policy, or null if a matching password policy could not be found
Throws:
SystemException - if a system exception occurred

fetchByC_DP

public static PasswordPolicy fetchByC_DP(long companyId,
                                         boolean defaultPolicy,
                                         boolean retrieveFromCache)
                                  throws SystemException
Returns the password policy where companyId = ? and defaultPolicy = ? or returns null if it could not be found, optionally using the finder cache.

Parameters:
companyId - the company ID
defaultPolicy - the default policy
retrieveFromCache - whether to use the finder cache
Returns:
the matching password policy, or null if a matching password policy could not be found
Throws:
SystemException - if a system exception occurred

findByC_N

public static PasswordPolicy findByC_N(long companyId,
                                       String name)
                                throws NoSuchPasswordPolicyException,
                                       SystemException
Returns the password policy where companyId = ? and name = ? or throws a NoSuchPasswordPolicyException if it could not be found.

Parameters:
companyId - the company ID
name - the name
Returns:
the matching password policy
Throws:
NoSuchPasswordPolicyException - if a matching password policy could not be found
SystemException - if a system exception occurred

fetchByC_N

public static PasswordPolicy fetchByC_N(long companyId,
                                        String name)
                                 throws SystemException
Returns the password policy where companyId = ? and name = ? or returns null if it could not be found. Uses the finder cache.

Parameters:
companyId - the company ID
name - the name
Returns:
the matching password policy, or null if a matching password policy could not be found
Throws:
SystemException - if a system exception occurred

fetchByC_N

public static PasswordPolicy fetchByC_N(long companyId,
                                        String name,
                                        boolean retrieveFromCache)
                                 throws SystemException
Returns the password policy where companyId = ? and name = ? or returns null if it could not be found, optionally using the finder cache.

Parameters:
companyId - the company ID
name - the name
retrieveFromCache - whether to use the finder cache
Returns:
the matching password policy, or null if a matching password policy could not be found
Throws:
SystemException - if a system exception occurred

findAll

public static List<PasswordPolicy> findAll()
                                    throws SystemException
Returns all the password policies.

Returns:
the password policies
Throws:
SystemException - if a system exception occurred

findAll

public static List<PasswordPolicy> findAll(int start,
                                           int end)
                                    throws SystemException
Returns a range of all the password policies.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
start - the lower bound of the range of password policies
end - the upper bound of the range of password policies (not inclusive)
Returns:
the range of password policies
Throws:
SystemException - if a system exception occurred

findAll

public static List<PasswordPolicy> findAll(int start,
                                           int end,
                                           OrderByComparator orderByComparator)
                                    throws SystemException
Returns an ordered range of all the password policies.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
start - the lower bound of the range of password policies
end - the upper bound of the range of password policies (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
Returns:
the ordered range of password policies
Throws:
SystemException - if a system exception occurred

removeByC_DP

public static PasswordPolicy removeByC_DP(long companyId,
                                          boolean defaultPolicy)
                                   throws NoSuchPasswordPolicyException,
                                          SystemException
Removes the password policy where companyId = ? and defaultPolicy = ? from the database.

Parameters:
companyId - the company ID
defaultPolicy - the default policy
Returns:
the password policy that was removed
Throws:
SystemException - if a system exception occurred
NoSuchPasswordPolicyException

removeByC_N

public static PasswordPolicy removeByC_N(long companyId,
                                         String name)
                                  throws NoSuchPasswordPolicyException,
                                         SystemException
Removes the password policy where companyId = ? and name = ? from the database.

Parameters:
companyId - the company ID
name - the name
Returns:
the password policy that was removed
Throws:
SystemException - if a system exception occurred
NoSuchPasswordPolicyException

removeAll

public static void removeAll()
                      throws SystemException
Removes all the password policies from the database.

Throws:
SystemException - if a system exception occurred

countByC_DP

public static int countByC_DP(long companyId,
                              boolean defaultPolicy)
                       throws SystemException
Returns the number of password policies where companyId = ? and defaultPolicy = ?.

Parameters:
companyId - the company ID
defaultPolicy - the default policy
Returns:
the number of matching password policies
Throws:
SystemException - if a system exception occurred

countByC_N

public static int countByC_N(long companyId,
                             String name)
                      throws SystemException
Returns the number of password policies where companyId = ? and name = ?.

Parameters:
companyId - the company ID
name - the name
Returns:
the number of matching password policies
Throws:
SystemException - if a system exception occurred

countAll

public static int countAll()
                    throws SystemException
Returns the number of password policies.

Returns:
the number of password policies
Throws:
SystemException - if a system exception occurred

getPersistence

public static PasswordPolicyPersistence getPersistence()

setPersistence

public void setPersistence(PasswordPolicyPersistence persistence)
Deprecated. 


Liferay 6.1.2-ce-ga3