Top Description Methods
org.hibernate.bytecode.enhance.spi

public Interface EnhancementContext

Known Direct Implementers
org.hibernate.bytecode.enhance.spi.EnhancementContextWrapper, org.hibernate.bytecode.enhance.spi.DefaultEnhancementContext

The context for performing an enhancement. Enhancement can happen in any number of ways:

This interface isolates the code that actually does the enhancement from the underlying context in which the enhancement is being performed.

Author
Steve Ebersole

Method Summary

Modifier and TypeMethod and Description
public boolean

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.
doBiDirectionalAssociationManagement
(UnloadedField
The field to check.
field
)

Should we manage association of bi-directional persistent attributes for this field?

public boolean

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.
doDirtyCheckingInline
(UnloadedClass
The descriptor of the class to check.
classDescriptor
)

Should we in-line dirty checking for persistent attributes for this class?

public boolean

Returns:

true indicates that any direct access to fields of entities should be routed to the enhanced getter / setter method.
doExtendedEnhancement
(UnloadedClass
The descriptor of the class to check.
classDescriptor
)

Should we enhance field access to entities from this class?

public ClassLoader

Returns:

The class loader that the enhancer can use.
getLoadingClassLoader
()

Obtain access to the ClassLoader that can be used to load Class references.

public boolean

Returns:

true/false
hasLazyLoadableAttributes
(UnloadedClass
The class to check
classDescriptor
)

Does the given class define any lazy loadable attributes?

public boolean

Returns:

true if the class is an embeddable/component; false otherwise.
isCompositeClass
(UnloadedClass
The descriptor of the class to check.
classDescriptor
)

Does the given class name represent an embeddable/component class?

public boolean

Returns:

true if the class is an entity; false otherwise.
isEntityClass
(UnloadedClass
The descriptor of the class to check.
classDescriptor
)

Does the given class descriptor represent an entity class?

public boolean

Returns:

true if the field is lazy loadable; false otherwise.
isLazyLoadable
(UnloadedField
The field to check
field
)

Determine if a field is lazy loadable.

public boolean

Returns:

true if the field is mapped
isMappedCollection
(UnloadedField
the field to check
field
)

public boolean

Returns:

true if the class is a mapped super class; false otherwise.
isMappedSuperclassClass
(UnloadedClass
The descriptor of the class to check.
classDescriptor
)

Does the given class name represent a MappedSuperclass class?

public boolean

Returns:

true if the field is ; false otherwise.
isPersistentField
(UnloadedField
The field reference.
ctField
)

Does the field represent persistent state?

public UnloadedField[]

Returns:

The ordered references.
order
(UnloadedField[]
The persistent field references.
persistentFields
)

For fields which are persistent (according to isPersistentField), determine the corresponding ordering maintained within the Hibernate metamodel.

Method Detail

doBiDirectionalAssociationManagementback to summary
public boolean doBiDirectionalAssociationManagement(UnloadedField field)

Should we manage association of bi-directional persistent attributes for this field?

Parameters
field:UnloadedField

The field to check.

Returns:boolean

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.

doDirtyCheckingInlineback to summary
public boolean doDirtyCheckingInline(UnloadedClass classDescriptor)

Should we in-line dirty checking for persistent attributes for this class?

Parameters
classDescriptor:UnloadedClass

The descriptor of the class to check.

Returns:boolean

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.

doExtendedEnhancementback to summary
public boolean doExtendedEnhancement(UnloadedClass classDescriptor)

Should we enhance field access to entities from this class?

Parameters
classDescriptor:UnloadedClass

The descriptor of the class to check.

Returns:boolean

true indicates that any direct access to fields of entities should be routed to the enhanced getter / setter method.

getLoadingClassLoaderback to summary
public 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 javax.persistence.spi.PersistenceUnitInfo#getNewTempClassLoader()

Returns:ClassLoader

The class loader that the enhancer can use.

hasLazyLoadableAttributesback to summary
public boolean hasLazyLoadableAttributes(UnloadedClass classDescriptor)

Does the given class define any lazy loadable attributes?

Parameters
classDescriptor:UnloadedClass

The class to check

Returns:boolean

true/false

isCompositeClassback to summary
public boolean isCompositeClass(UnloadedClass classDescriptor)

Does the given class name represent an embeddable/component class?

Parameters
classDescriptor:UnloadedClass

The descriptor of the class to check.

Returns:boolean

true if the class is an embeddable/component; false otherwise.

isEntityClassback to summary
public boolean isEntityClass(UnloadedClass classDescriptor)

Does the given class descriptor represent an entity class?

Parameters
classDescriptor:UnloadedClass

The descriptor of the class to check.

Returns:boolean

true if the class is an entity; false otherwise.

isLazyLoadableback to summary
public boolean isLazyLoadable(UnloadedField field)

Determine if a field is lazy loadable.

Parameters
field:UnloadedField

The field to check

Returns:boolean

true if the field is lazy loadable; false otherwise.

isMappedCollectionback to summary
public boolean isMappedCollection(UnloadedField field)
Parameters
field:UnloadedField

the field to check

Returns:boolean

true if the field is mapped

isMappedSuperclassClassback to summary
public boolean isMappedSuperclassClass(UnloadedClass classDescriptor)

Does the given class name represent a MappedSuperclass class?

Parameters
classDescriptor:UnloadedClass

The descriptor of the class to check.

Returns:boolean

true if the class is a mapped super class; false otherwise.

isPersistentFieldback to summary
public boolean isPersistentField(UnloadedField ctField)

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...

Parameters
ctField:UnloadedField

The field reference.

Returns:boolean

true if the field is ; false otherwise.

orderback to summary
public UnloadedField[] order(UnloadedField[] persistentFields)

For fields which are persistent (according to isPersistentField), determine the corresponding ordering maintained within the Hibernate metamodel.

Parameters
persistentFields:UnloadedField[]

The persistent field references.

Returns:UnloadedField[]

The ordered references.