@Mojo(name="enhance", defaultPhase=COMPILE) @Execute(goal="enhance", phase=COMPILE) public class MavenEnhancePlugin extends org.apache.maven.plugin.AbstractMojo implements EnhancementContext
Constructor and Description |
---|
MavenEnhancePlugin() |
Modifier and Type | Method and Description |
---|---|
boolean |
doDirtyCheckingInline(javassist.CtClass classDescriptor)
Should we in-line dirty checking for persistent attributes for this class?
|
void |
execute() |
ClassLoader |
getLoadingClassLoader()
Obtain access to the ClassLoader that can be used to load Class references.
|
boolean |
hasLazyLoadableAttributes(javassist.CtClass classDescriptor)
Does the given class define any lazy loadable attributes?
|
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)
Determine if a field is lazy loadable.
|
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
EnhancementContext.isPersistentField(javassist.CtField) ), determine the corresponding ordering
maintained within the Hibernate metamodel. |
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
execute
in interface org.apache.maven.plugin.Mojo
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
public ClassLoader getLoadingClassLoader()
EnhancementContext
PersistenceUnitInfo.getNewTempClassLoader()
getLoadingClassLoader
in interface EnhancementContext
public boolean isEntityClass(javassist.CtClass classDescriptor)
EnhancementContext
isEntityClass
in interface EnhancementContext
classDescriptor
- The descriptor of the class to check.true
if the class is an entity; false
otherwise.public boolean isCompositeClass(javassist.CtClass classDescriptor)
EnhancementContext
isCompositeClass
in interface EnhancementContext
classDescriptor
- The descriptor of the class to check.true
if the class is an embeddable/component; false
otherwise.public boolean doDirtyCheckingInline(javassist.CtClass classDescriptor)
EnhancementContext
doDirtyCheckingInline
in interface EnhancementContext
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.public boolean hasLazyLoadableAttributes(javassist.CtClass classDescriptor)
EnhancementContext
hasLazyLoadableAttributes
in interface EnhancementContext
classDescriptor
- The class to checkpublic boolean isLazyLoadable(javassist.CtField field)
EnhancementContext
isLazyLoadable
in interface EnhancementContext
field
- The field to checktrue
if the field is lazy loadable; false
otherwise.public boolean isPersistentField(javassist.CtField ctField)
EnhancementContext
isPersistentField
in interface EnhancementContext
ctField
- The field reference.true
if the field is ; false
otherwise.public boolean isMappedCollection(javassist.CtField field)
isMappedCollection
in interface EnhancementContext
field
- the field to checktrue
if the field is mappedpublic javassist.CtField[] order(javassist.CtField[] persistentFields)
EnhancementContext
EnhancementContext.isPersistentField(javassist.CtField)
), determine the corresponding ordering
maintained within the Hibernate metamodel.order
in interface EnhancementContext
persistentFields
- The persistent field references.Copyright © 2001-2015 Red Hat, Inc. All Rights Reserved.