org.hibernate.bytecode.enhance.spi
Interface EnhancementContext

All Known Implementing Classes:
EnhancementTask, MavenEnhancePlugin

public interface EnhancementContext

todo : not sure its a great idea to expose Javassist classes this way. maybe wrap them in our own contracts?


Method Summary
 boolean doDirtyCheckingInline(javassist.CtClass classDescriptor)
          Should we in-line dirty checking for persistent attributes for this class?
 ClassLoader getLoadingClassLoader()
          Obtain access to the ClassLoader that can be used to load Class references.
 boolean hasLazyLoadableAttributes(javassist.CtClass classDescriptor)
           
 boolean isCompositeClass(javassist.CtClass classDescriptor)
          Does the given class name represent an embeddable/component class?
 boolean isEntityClass(javassist.CtClass classDescriptor)
          Does the given class descriptor represent a entity class?
 boolean isLazyLoadable(javassist.CtField field)
           
 boolean isMappedCollection(javassist.CtField field)
           
 boolean isPersistentField(javassist.CtField ctField)
          Does the field represent persistent state? Persistent fields will be "enhanced".
 javassist.CtField[] order(javassist.CtField[] persistentFields)
          For fields which are persistent (according to isPersistentField(javassist.CtField)), determine the corresponding ordering maintained within the Hibernate metamodel.
 

Method Detail

getLoadingClassLoader

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()


isEntityClass

boolean isEntityClass(javassist.CtClass classDescriptor)
Does the given class descriptor represent a entity class?

Parameters:
classDescriptor - The descriptor of the class to check.
Returns:
true if the class is an entity; false otherwise.

isCompositeClass

boolean isCompositeClass(javassist.CtClass classDescriptor)
Does the given class name represent an embeddable/component class?

Parameters:
classDescriptor - The descriptor of the class to check.
Returns:
true if the class is an embeddable/component; false otherwise.

doDirtyCheckingInline

boolean doDirtyCheckingInline(javassist.CtClass classDescriptor)
Should we in-line dirty checking for persistent attributes for this class?

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.

hasLazyLoadableAttributes

boolean hasLazyLoadableAttributes(javassist.CtClass classDescriptor)

isPersistentField

boolean isPersistentField(javassist.CtField 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 - The field reference.
Returns:
true if the field is ; false otherwise.

order

javassist.CtField[] order(javassist.CtField[] persistentFields)
For fields which are persistent (according to isPersistentField(javassist.CtField)), determine the corresponding ordering maintained within the Hibernate metamodel.

Parameters:
persistentFields - The persistent field references.
Returns:
The ordered references.

isLazyLoadable

boolean isLazyLoadable(javassist.CtField field)

isMappedCollection

boolean isMappedCollection(javassist.CtField field)
Parameters:
field - the field to check
Returns:
true if the field is mapped


Copyright © 2001-2015 Red Hat, Inc. All Rights Reserved.