public abstract class IdentityTypeHandler<T extends org.picketlink.idm.model.IdentityType> extends Object
Base class that provides some common functionality for IdentityType types.
| Constructor and Description |
|---|
IdentityTypeHandler(JPAIdentityStoreConfiguration config) |
| Modifier and Type | Method and Description |
|---|---|
Object |
createEntity(T fromIdentityType,
JPAIdentityStore store)
Creates a Identity Class instance using the information from the given
IdentityType. |
T |
createIdentityType(Object identity,
JPAIdentityStore store)
Creates a
IdentityType instance using the information from the given Identity Class instance. |
protected abstract T |
doCreateIdentityType(Object identity,
JPAIdentityStore store)
Subclasses should override this method to create a specific
IdentityType given the provided Identity Class
instance. |
protected abstract void |
doPopulateIdentityInstance(Object toIdentity,
T fromIdentityType,
JPAIdentityStore store)
Subclasses should override this method to populate the given Identity Class instance with the specific information for a
given
IdentityType. |
protected JPAIdentityStoreConfiguration |
getConfig() |
List<javax.persistence.criteria.Order> |
getOrders(JPACriteriaQueryBuilder criteria)
Return list of
Order instances to be used for sorting during the query execution. |
List<javax.persistence.criteria.Predicate> |
getPredicate(JPACriteriaQueryBuilder criteria,
JPAIdentityStore store)
Returns a
List of Predicate to be used during the query execution. |
protected Map<org.picketlink.idm.query.QueryParameter,org.picketlink.idm.jpa.annotations.PropertyType> |
getSortParametersMapping() |
protected void |
populateEntity(Object toIdentity,
T fromIdentityType,
JPAIdentityStore store)
Populates the given
Object argument representing a Identity Class (from the config) with the information from the
specified IdentityType. |
protected abstract org.picketlink.idm.event.AbstractBaseEvent |
raiseCreatedEvent(T fromIdentityType) |
protected abstract org.picketlink.idm.event.AbstractBaseEvent |
raiseDeletedEvent(T fromIdentityType) |
protected abstract org.picketlink.idm.event.AbstractBaseEvent |
raiseUpdatedEvent(T fromIdentityType) |
protected void |
setModelPropertyValue(Object identity,
org.picketlink.idm.jpa.annotations.PropertyType propertyType,
Object value) |
protected void |
setModelPropertyValue(Object identity,
org.picketlink.idm.jpa.annotations.PropertyType propertyType,
Object value,
boolean notNull) |
public IdentityTypeHandler(JPAIdentityStoreConfiguration config)
public T createIdentityType(Object identity, JPAIdentityStore store)
Creates a IdentityType instance using the information from the given Identity Class instance. This method already
provides the mapping for the common properties for all IdentityType types.
identity - public Object createEntity(T fromIdentityType, JPAIdentityStore store)
Creates a Identity Class instance using the information from the given IdentityType.
fromIdentityType - protected void populateEntity(Object toIdentity, T fromIdentityType, JPAIdentityStore store)
Populates the given Object argument representing a Identity Class (from the config) with the information from the
specified IdentityType.
toIdentity - fromIdentityType - public List<javax.persistence.criteria.Predicate> getPredicate(JPACriteriaQueryBuilder criteria, JPAIdentityStore store)
Returns a List of Predicate to be used during the query execution. This method already provides the
mapping for the common properties for all IdentityType types.
criteria - public List<javax.persistence.criteria.Order> getOrders(JPACriteriaQueryBuilder criteria)
Order instances to be used for sorting during the query execution.criteria - criteria which encapsulate all the parameters and JPA builderprotected abstract T doCreateIdentityType(Object identity, JPAIdentityStore store)
Subclasses should override this method to create a specific IdentityType given the provided Identity Class
instance.
identity - protected abstract void doPopulateIdentityInstance(Object toIdentity, T fromIdentityType, JPAIdentityStore store)
Subclasses should override this method to populate the given Identity Class instance with the specific information for a
given IdentityType.
toIdentity - fromIdentityType - protected abstract org.picketlink.idm.event.AbstractBaseEvent raiseCreatedEvent(T fromIdentityType)
protected abstract org.picketlink.idm.event.AbstractBaseEvent raiseUpdatedEvent(T fromIdentityType)
protected abstract org.picketlink.idm.event.AbstractBaseEvent raiseDeletedEvent(T fromIdentityType)
protected JPAIdentityStoreConfiguration getConfig()
protected void setModelPropertyValue(Object identity, org.picketlink.idm.jpa.annotations.PropertyType propertyType, Object value, boolean notNull)
protected void setModelPropertyValue(Object identity, org.picketlink.idm.jpa.annotations.PropertyType propertyType, Object value)
protected Map<org.picketlink.idm.query.QueryParameter,org.picketlink.idm.jpa.annotations.PropertyType> getSortParametersMapping()
Copyright © 2013. All Rights Reserved.