Class EnhancementContextWrapper
java.lang.Object
org.hibernate.bytecode.enhance.spi.EnhancementContextWrapper
- All Implemented Interfaces:
EnhancementContext,EnhancementOptions
-
Constructor Summary
ConstructorsConstructorDescriptionEnhancementContextWrapper(EnhancementContext wrappedContext, ClassLoader loadingClassloader) -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether to enable support for automatic management of bidirectional associations for this field.booleandoDirtyCheckingInline(UnloadedClass classDescriptor) Should we in-line dirty checking for persistent attributes for this class?booleandoExtendedEnhancement(UnloadedClass classDescriptor) Should we enhance field access to entities from this class?Obtain access to the ClassLoader that can be used to load Class references.booleanhasLazyLoadableAttributes(UnloadedClass classDescriptor) Does the given class define any lazy loadable attributes?booleanisCompositeClass(UnloadedClass classDescriptor) Does the given class name represent an embeddable/component class?booleanisDiscoveredType(UnloadedClass classDescriptor) booleanisEntityClass(UnloadedClass classDescriptor) Does the given class descriptor represent an entity class?booleanisLazyLoadable(UnloadedField field) Determine if a field is lazy loadable.booleanisMappedCollection(UnloadedField field) booleanisMappedSuperclassClass(UnloadedClass classDescriptor) Does the given class name represent a MappedSuperclass class?booleanisPersistentField(UnloadedField ctField) Does the field represent persistent state? Persistent fields will be "enhanced".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.voidregisterDiscoveredType(UnloadedClass classDescriptor, Type.PersistenceType type) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.bytecode.enhance.spi.EnhancementContext
getBytecodeProvider, getUnsupportedEnhancementStrategyMethods inherited from interface org.hibernate.bytecode.enhance.spi.EnhancementOptions
doBiDirectionalAssociationManagement, doDirtyCheckingInline, doExtendedEnhancement
-
Constructor Details
-
EnhancementContextWrapper
-
-
Method Details
-
getLoadingClassLoader
Description copied from interface:EnhancementContextObtain 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:
getLoadingClassLoaderin interfaceEnhancementContext- Returns:
- The class loader that the enhancer can use.
-
isEntityClass
Description copied from interface:EnhancementContextDoes the given class descriptor represent an entity class?- Specified by:
isEntityClassin interfaceEnhancementContext- Parameters:
classDescriptor- The descriptor of the class to check.- Returns:
trueif the class is an entity;falseotherwise.
-
isCompositeClass
Description copied from interface:EnhancementContextDoes the given class name represent an embeddable/component class?- Specified by:
isCompositeClassin interfaceEnhancementContext- Parameters:
classDescriptor- The descriptor of the class to check.- Returns:
trueif the class is an embeddable/component;falseotherwise.
-
isMappedSuperclassClass
Description copied from interface:EnhancementContextDoes the given class name represent a MappedSuperclass class?- Specified by:
isMappedSuperclassClassin interfaceEnhancementContext- Parameters:
classDescriptor- The descriptor of the class to check.- Returns:
trueif the class is a mapped super class;falseotherwise.
-
doBiDirectionalAssociationManagement
Description copied from interface:EnhancementOptionsWhether to enable support for automatic management of bidirectional associations for this field.- Specified by:
doBiDirectionalAssociationManagementin interfaceEnhancementOptions- Parameters:
field- The field to check.- Returns:
trueindicates that the field is enhanced so that for bidirectional persistent fields the association is managed, i.e. the associations are automatically set;falseindicates that the management is handled by the user.
-
doDirtyCheckingInline
Description copied from interface:EnhancementOptionsShould we in-line dirty checking for persistent attributes for this class?- Specified by:
doDirtyCheckingInlinein interfaceEnhancementOptions- Parameters:
classDescriptor- The descriptor of the class to check.- Returns:
trueindicates that dirty checking should be in-lined within the entity;falseindicates it should not. In-lined is more easily serializable and probably more performant.
-
doExtendedEnhancement
Description copied from interface:EnhancementOptionsShould we enhance field access to entities from this class?- Specified by:
doExtendedEnhancementin interfaceEnhancementOptions- Parameters:
classDescriptor- The descriptor of the class to check.- Returns:
trueindicates that any direct access to fields of entities should be routed to the enhanced getter / setter method.
-
hasLazyLoadableAttributes
Description copied from interface:EnhancementContextDoes the given class define any lazy loadable attributes?- Specified by:
hasLazyLoadableAttributesin interfaceEnhancementContext- Parameters:
classDescriptor- The class to check- Returns:
- true/false
-
isPersistentField
Description copied from interface:EnhancementContextDoes 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:
isPersistentFieldin interfaceEnhancementContext- Parameters:
ctField- The field reference.- Returns:
trueif the field is ;falseotherwise.
-
order
Description copied from interface:EnhancementContextFor fields which are persistent (according toEnhancementContext.isPersistentField(org.hibernate.bytecode.enhance.spi.UnloadedField)), determine the corresponding ordering maintained within the Hibernate metamodel.- Specified by:
orderin interfaceEnhancementContext- Parameters:
persistentFields- The persistent field references.- Returns:
- The ordered references.
-
isLazyLoadable
Description copied from interface:EnhancementContextDetermine if a field is lazy loadable.- Specified by:
isLazyLoadablein interfaceEnhancementContext- Parameters:
field- The field to check- Returns:
trueif the field is lazy loadable;falseotherwise.
-
isMappedCollection
- Specified by:
isMappedCollectionin interfaceEnhancementContext- Parameters:
field- the field to check- Returns:
trueif the field is mapped
-
isDiscoveredType
- Specified by:
isDiscoveredTypein interfaceEnhancementContext
-
registerDiscoveredType
- Specified by:
registerDiscoveredTypein interfaceEnhancementContext
-