Class EnhancementContextWrapper
- java.lang.Object
-
- org.hibernate.bytecode.enhance.spi.EnhancementContextWrapper
-
- All Implemented Interfaces:
EnhancementContext
public class EnhancementContextWrapper extends Object implements EnhancementContext
-
-
Constructor Summary
Constructors Constructor Description EnhancementContextWrapper(EnhancementContext wrappedContext, ClassLoader loadingClassloader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 an 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 toEnhancementContext.isPersistentField(org.hibernate.bytecode.enhance.spi.UnloadedField)
), determine the corresponding ordering maintained within the Hibernate metamodel.
-
-
-
Constructor Detail
-
EnhancementContextWrapper
public EnhancementContextWrapper(EnhancementContext wrappedContext, ClassLoader loadingClassloader)
-
-
Method Detail
-
getLoadingClassLoader
public ClassLoader getLoadingClassLoader()
Description copied from interface:EnhancementContext
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 byPersistenceUnitInfo.getNewTempClassLoader()
- Specified by:
getLoadingClassLoader
in interfaceEnhancementContext
- Returns:
- The class loader that the enhancer can use.
-
isEntityClass
public boolean isEntityClass(UnloadedClass classDescriptor)
Description copied from interface:EnhancementContext
Does the given class descriptor represent an entity class?- Specified by:
isEntityClass
in interfaceEnhancementContext
- Parameters:
classDescriptor
- The descriptor of the class to check.- Returns:
true
if the class is an entity;false
otherwise.
-
isCompositeClass
public boolean isCompositeClass(UnloadedClass classDescriptor)
Description copied from interface:EnhancementContext
Does the given class name represent an embeddable/component class?- Specified by:
isCompositeClass
in interfaceEnhancementContext
- Parameters:
classDescriptor
- The descriptor of the class to check.- Returns:
true
if the class is an embeddable/component;false
otherwise.
-
isMappedSuperclassClass
public boolean isMappedSuperclassClass(UnloadedClass classDescriptor)
Description copied from interface:EnhancementContext
Does the given class name represent a MappedSuperclass class?- Specified by:
isMappedSuperclassClass
in interfaceEnhancementContext
- Parameters:
classDescriptor
- The descriptor of the class to check.- Returns:
true
if the class is a mapped super class;false
otherwise.
-
doBiDirectionalAssociationManagement
public boolean doBiDirectionalAssociationManagement(UnloadedField field)
Description copied from interface:EnhancementContext
Should we manage association of bi-directional persistent attributes for this field?- Specified by:
doBiDirectionalAssociationManagement
in interfaceEnhancementContext
- Parameters:
field
- The field to check.- Returns:
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.
-
doDirtyCheckingInline
public boolean doDirtyCheckingInline(UnloadedClass classDescriptor)
Description copied from interface:EnhancementContext
Should we in-line dirty checking for persistent attributes for this class?- Specified by:
doDirtyCheckingInline
in interfaceEnhancementContext
- Parameters:
classDescriptor
- The descriptor of the class to check.- Returns:
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.
-
doExtendedEnhancement
public boolean doExtendedEnhancement(UnloadedClass classDescriptor)
Description copied from interface:EnhancementContext
Should we enhance field access to entities from this class?- Specified by:
doExtendedEnhancement
in interfaceEnhancementContext
- Parameters:
classDescriptor
- The descriptor of the class to check.- Returns:
true
indicates that any direct access to fields of entities should be routed to the enhanced getter / setter method.
-
hasLazyLoadableAttributes
public boolean hasLazyLoadableAttributes(UnloadedClass classDescriptor)
Description copied from interface:EnhancementContext
Does the given class define any lazy loadable attributes?- Specified by:
hasLazyLoadableAttributes
in interfaceEnhancementContext
- Parameters:
classDescriptor
- The class to check- Returns:
- true/false
-
isPersistentField
public boolean isPersistentField(UnloadedField ctField)
Description copied from interface:EnhancementContext
Does the field represent persistent state? Persistent fields will be "enhanced".may be better to perform basic checks in the caller (non-static, etc) and call out with just the Class name and field name...
- Specified by:
isPersistentField
in interfaceEnhancementContext
- Parameters:
ctField
- The field reference.- Returns:
true
if the field is ;false
otherwise.
-
order
public UnloadedField[] order(UnloadedField[] persistentFields)
Description copied from interface:EnhancementContext
For fields which are persistent (according toEnhancementContext.isPersistentField(org.hibernate.bytecode.enhance.spi.UnloadedField)
), determine the corresponding ordering maintained within the Hibernate metamodel.- Specified by:
order
in interfaceEnhancementContext
- Parameters:
persistentFields
- The persistent field references.- Returns:
- The ordered references.
-
isLazyLoadable
public boolean isLazyLoadable(UnloadedField field)
Description copied from interface:EnhancementContext
Determine if a field is lazy loadable.- Specified by:
isLazyLoadable
in interfaceEnhancementContext
- Parameters:
field
- The field to check- Returns:
true
if the field is lazy loadable;false
otherwise.
-
isMappedCollection
public boolean isMappedCollection(UnloadedField field)
- Specified by:
isMappedCollection
in interfaceEnhancementContext
- Parameters:
field
- the field to check- Returns:
true
if the field is mapped
-
-