Class KradEclipseLinkCustomizer
java.lang.Object
org.kuali.rice.krad.data.jpa.eclipselink.KradEclipseLinkCustomizer
- All Implemented Interfaces:
org.eclipse.persistence.config.SessionCustomizer
public class KradEclipseLinkCustomizer
extends Object
implements org.eclipse.persistence.config.SessionCustomizer
EclipseLink Session Customizer which understands
PortableSequenceGenerator
annotations and automatically registers custom EclipseLink Sequences.
Since SessionCustomizers are stateless instances, and because concrete
Sequence objects must be registered individually with the EclipseLink
session, we lazy generate the Sequence objects using annotation inspection and then register them on each new
session using this customizer.
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbuildQueryCustomizers(Class<?> entityClass, Field field, String key) Build and populate map of QueryCustomizer annotations.voidcustomize(org.eclipse.persistence.sessions.Session session) protected voidhandleDescriptorModifications(org.eclipse.persistence.sessions.Session session) Determines if the class descriptors have been modified for the given session name.protected voidhandleDisableVersioning(org.eclipse.persistence.sessions.Session session) Checks class descriptors for} annotations at the class level and removes the version database mapping for optimistic locking.invalid @link
{@link @DisableVersioningprotected voidhandleRemoveMapping(org.eclipse.persistence.sessions.Session session) Checks class descriptors for} andinvalid @link
{@link @RemoveMappingRemoveMappingsannotations at the class level and removes any specified mappings from the ClassDescriptor.protected voidloadFieldSequences(Class<?> entityClass, List<PortableSequenceGenerator> sequenceGenerators) Loads any field-based sequences from the given type.protected voidloadQueryCustomizers(org.eclipse.persistence.sessions.Session session) Load Query Customizer based on annotations on fields and call customizer to modify descriptor.protected List<org.eclipse.persistence.sequencing.Sequence> loadSequences(org.eclipse.persistence.sessions.Session session) Gets anySequencefrom the session.protected List<RemoveMapping> scanForRemoveMappings(org.eclipse.persistence.descriptors.ClassDescriptor classDescriptor) Gets anyRemoveMappings out of the givenClassDescriptor.
-
Constructor Details
-
KradEclipseLinkCustomizer
public KradEclipseLinkCustomizer()
-
-
Method Details
-
customize
- Specified by:
customizein interfaceorg.eclipse.persistence.config.SessionCustomizer- Throws:
Exception
-
loadQueryCustomizers
protected void loadQueryCustomizers(org.eclipse.persistence.sessions.Session session) Load Query Customizer based on annotations on fields and call customizer to modify descriptor.- Parameters:
session- the EclipseLink session.
-
buildQueryCustomizers
Build and populate map of QueryCustomizer annotations.- Parameters:
entityClass- the type of the entity.field- the field to process.key- the id to store the customizer under.
-
handleDescriptorModifications
protected void handleDescriptorModifications(org.eclipse.persistence.sessions.Session session) Determines if the class descriptors have been modified for the given session name.- Parameters:
session- the current session.
-
handleDisableVersioning
protected void handleDisableVersioning(org.eclipse.persistence.sessions.Session session) Checks class descriptors for} annotations at the class level and removes the version database mapping for optimistic locking.invalid @link
{@link @DisableVersioning- Parameters:
session- the current session.
-
handleRemoveMapping
protected void handleRemoveMapping(org.eclipse.persistence.sessions.Session session) Checks class descriptors for} andinvalid @link
{@link @RemoveMappingRemoveMappingsannotations at the class level and removes any specified mappings from the ClassDescriptor.- Parameters:
session- the current session.
-
scanForRemoveMappings
protected List<RemoveMapping> scanForRemoveMappings(org.eclipse.persistence.descriptors.ClassDescriptor classDescriptor) Gets anyRemoveMappings out of the givenClassDescriptor.- Parameters:
classDescriptor- theClassDescriptorto scan.- Returns:
- a list of
RemoveMappings from the givenClassDescriptor.
-
loadSequences
protected List<org.eclipse.persistence.sequencing.Sequence> loadSequences(org.eclipse.persistence.sessions.Session session) Gets anySequencefrom the session.- Parameters:
session- the current session.- Returns:
- a list of
Sequences.
-
loadFieldSequences
protected void loadFieldSequences(Class<?> entityClass, List<PortableSequenceGenerator> sequenceGenerators) Loads any field-based sequences from the given type.- Parameters:
entityClass- the type of the entity.sequenceGenerators- the current list of sequence generators.
-