public interface EnhancementContext
The context for performing an enhancement. Enhancement can happen in any number of ways:<ul> <li>Build time, via Ant</li> <li>Build time, via Maven</li> <li>Build time, via Gradle</li> <li>Runtime, via agent</li> <li>Runtime, via JPA constructs</li> </ul> <p/> This interface isolates the code that actually does the enhancement from the underlying context in which the enhancement is being performed.
Modifier and Type | Method and Description |
---|---|
boolean |
doBiDirectionalAssociationManagement(UnloadedField field)
Should we manage association of bi-directional persistent attributes for this field?
|
boolean |
doDirtyCheckingInline(UnloadedClass classDescriptor)
Should we in-line dirty checking for persistent attributes for this class?
|
boolean |
doExtendedEnhancement(UnloadedClass classDescriptor)
Should we enhance field access to entities from this class?
|
ClassLoader |
getLoadingClassLoader()
Obtain access to the ClassLoader that can be used to load Class references.
|
boolean |
hasLazyLoadableAttributes(UnloadedClass classDescriptor)
Does the given class define any lazy loadable attributes?
|
boolean |
isCompositeClass(UnloadedClass classDescriptor)
Does the given class name represent an embeddable/component class?
|
boolean |
isEntityClass(UnloadedClass classDescriptor)
Does the given class descriptor represent a entity class?
|
boolean |
isLazyLoadable(UnloadedField field)
Determine if a field is lazy loadable.
|
boolean |
isMappedCollection(UnloadedField field) |
boolean |
isMappedSuperclassClass(UnloadedClass classDescriptor)
Does the given class name represent a MappedSuperclass class?
|
boolean |
isPersistentField(UnloadedField ctField)
Does the field represent persistent state? Persistent fields will be "enhanced".
|
UnloadedField[] |
order(UnloadedField[] persistentFields)
For fields which are persistent (according to
isPersistentField(org.hibernate.bytecode.enhance.spi.UnloadedField) ), determine the corresponding ordering
maintained within the Hibernate metamodel. |
ClassLoader getLoadingClassLoader()
Obtain access to the ClassLoader that can be used to load Class references. In JPA SPI terms, this
should be a "temporary class loader" as defined by
PersistenceUnitInfo.getNewTempClassLoader()
boolean isEntityClass(UnloadedClass classDescriptor)
Does the given class descriptor represent a entity class?
classDescriptor
- The descriptor of the class to check.true
if the class is an entity; false
otherwise.boolean isCompositeClass(UnloadedClass classDescriptor)
Does the given class name represent an embeddable/component class?
classDescriptor
- The descriptor of the class to check.true
if the class is an embeddable/component; false
otherwise.boolean isMappedSuperclassClass(UnloadedClass classDescriptor)
Does the given class name represent a MappedSuperclass class?
classDescriptor
- The descriptor of the class to check.true
if the class is a mapped super class; false
otherwise.boolean doBiDirectionalAssociationManagement(UnloadedField field)
Should we manage association of bi-directional persistent attributes for this field?
field
- The field to check.true
indicates that the field is enhanced so that for bi-directional persistent fields
the association is managed, i.e. the associations are automatically set; false
indicates that
the management is handled by the user.boolean doDirtyCheckingInline(UnloadedClass classDescriptor)
Should we in-line dirty checking for persistent attributes for this class?
classDescriptor
- The descriptor of the class to check.true
indicates that dirty checking should be in-lined within the entity; false
indicates it should not. In-lined is more easily serializable and probably more performant.boolean doExtendedEnhancement(UnloadedClass classDescriptor)
Should we enhance field access to entities from this class?
classDescriptor
- The descriptor of the class to check.true
indicates that any direct access to fields of entities should be routed to the enhanced
getter / setter method.boolean hasLazyLoadableAttributes(UnloadedClass classDescriptor)
Does the given class define any lazy loadable attributes?
classDescriptor
- The class to checkboolean isPersistentField(UnloadedField ctField)
Does the field represent persistent state? Persistent fields will be "enhanced". <p/> may be better to perform basic checks in the caller (non-static, etc) and call out with just the Class name and field name…
ctField
- The field reference.true
if the field is ; false
otherwise.UnloadedField[] order(UnloadedField[] persistentFields)
For fields which are persistent (according to isPersistentField(org.hibernate.bytecode.enhance.spi.UnloadedField)
), determine the corresponding ordering
maintained within the Hibernate metamodel.
persistentFields
- The persistent field references.boolean isLazyLoadable(UnloadedField field)
Determine if a field is lazy loadable.
field
- The field to checktrue
if the field is lazy loadable; false
otherwise.boolean isMappedCollection(UnloadedField field)
field
- the field to checktrue
if the field is mappedCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.