public class KradEclipseLinkCustomizer extends Object implements org.eclipse.persistence.config.SessionCustomizer
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.
Constructor and Description |
---|
KradEclipseLinkCustomizer() |
Modifier and Type | Method and Description |
---|---|
protected void |
buildQueryCustomizers(Class<?> entityClass,
Field field,
String key)
Build and populate map of QueryCustomizer annotations.
|
void |
customize(org.eclipse.persistence.sessions.Session session) |
protected void |
handleDescriptorModifications(org.eclipse.persistence.sessions.Session session)
Determines if the class descriptors have been modified for the given session name.
|
protected void |
handleDisableVersioning(org.eclipse.persistence.sessions.Session session)
Checks class descriptors for
@DisableVersioning annotations at the class level and removes the version
database mapping for optimistic locking. |
protected void |
handleRemoveMapping(org.eclipse.persistence.sessions.Session session)
Checks class descriptors for
@RemoveMapping and RemoveMappings annotations at the class level
and removes any specified mappings from the ClassDescriptor. |
protected void |
loadFieldSequences(Class<?> entityClass,
List<PortableSequenceGenerator> sequenceGenerators)
Loads any field-based sequences from the given type.
|
protected void |
loadQueryCustomizers(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 any
Sequence from the session. |
protected List<RemoveMapping> |
scanForRemoveMappings(org.eclipse.persistence.descriptors.ClassDescriptor classDescriptor)
Gets any
RemoveMapping s out of the given ClassDescriptor . |
public KradEclipseLinkCustomizer()
public void customize(org.eclipse.persistence.sessions.Session session) throws Exception
customize
in interface org.eclipse.persistence.config.SessionCustomizer
Exception
protected void loadQueryCustomizers(org.eclipse.persistence.sessions.Session session)
session
- the EclipseLink session.protected void buildQueryCustomizers(Class<?> entityClass, Field field, String key)
entityClass
- the type of the entity.field
- the field to process.key
- the id to store the customizer under.protected void handleDescriptorModifications(org.eclipse.persistence.sessions.Session session)
session
- the current session.protected void handleDisableVersioning(org.eclipse.persistence.sessions.Session session)
@DisableVersioning
annotations at the class level and removes the version
database mapping for optimistic locking.session
- the current session.protected void handleRemoveMapping(org.eclipse.persistence.sessions.Session session)
@RemoveMapping
and RemoveMappings
annotations at the class level
and removes any specified mappings from the ClassDescriptor.session
- the current session.protected List<RemoveMapping> scanForRemoveMappings(org.eclipse.persistence.descriptors.ClassDescriptor classDescriptor)
RemoveMapping
s out of the given ClassDescriptor
.classDescriptor
- the ClassDescriptor
to scan.RemoveMapping
s from the given ClassDescriptor
.protected List<org.eclipse.persistence.sequencing.Sequence> loadSequences(org.eclipse.persistence.sessions.Session session)
Sequence
from the session.session
- the current session.Sequence
s.protected void loadFieldSequences(Class<?> entityClass, List<PortableSequenceGenerator> sequenceGenerators)
entityClass
- the type of the entity.sequenceGenerators
- the current list of sequence generators.Copyright © 2005–2015 The Kuali Foundation. All rights reserved.