org.hibernate.bytecode.enhance.plugins
Class MavenEnhancePlugin

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.hibernate.bytecode.enhance.plugins.MavenEnhancePlugin
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, EnhancementContext

@Mojo(name="enhance",
      defaultPhase=COMPILE)
@Execute(goal="enhance",
         phase=COMPILE)
public class MavenEnhancePlugin
extends org.apache.maven.plugin.AbstractMojo
implements EnhancementContext

This plugin will enhance Entity objects.


Field Summary
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
MavenEnhancePlugin()
           
 
Method Summary
 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)
           
 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 EnhancementContext.isPersistentField(javassist.CtField)), determine the corresponding ordering maintained within the Hibernate metamodel.
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MavenEnhancePlugin

public MavenEnhancePlugin()
Method Detail

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException,
                    org.apache.maven.plugin.MojoFailureException
Specified by:
execute in interface org.apache.maven.plugin.Mojo
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException

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 by PersistenceUnitInfo.getNewTempClassLoader()

Specified by:
getLoadingClassLoader in interface EnhancementContext

isEntityClass

public boolean isEntityClass(javassist.CtClass classDescriptor)
Description copied from interface: EnhancementContext
Does the given class descriptor represent a entity class?

Specified by:
isEntityClass in interface EnhancementContext
Parameters:
classDescriptor - The descriptor of the class to check.
Returns:
true if the class is an entity; false otherwise.

isCompositeClass

public boolean isCompositeClass(javassist.CtClass classDescriptor)
Description copied from interface: EnhancementContext
Does the given class name represent an embeddable/component class?

Specified by:
isCompositeClass in interface EnhancementContext
Parameters:
classDescriptor - The descriptor of the class to check.
Returns:
true if the class is an embeddable/component; false otherwise.

doDirtyCheckingInline

public boolean doDirtyCheckingInline(javassist.CtClass classDescriptor)
Description copied from interface: EnhancementContext
Should we in-line dirty checking for persistent attributes for this class?

Specified by:
doDirtyCheckingInline in interface EnhancementContext
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

public boolean hasLazyLoadableAttributes(javassist.CtClass classDescriptor)
Specified by:
hasLazyLoadableAttributes in interface EnhancementContext

isLazyLoadable

public boolean isLazyLoadable(javassist.CtField field)
Specified by:
isLazyLoadable in interface EnhancementContext

isPersistentField

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

isMappedCollection

public boolean isMappedCollection(javassist.CtField field)
Specified by:
isMappedCollection in interface EnhancementContext
Parameters:
field - the field to check
Returns:
true if the field is mapped

order

public javassist.CtField[] order(javassist.CtField[] persistentFields)
Description copied from interface: EnhancementContext
For fields which are persistent (according to EnhancementContext.isPersistentField(javassist.CtField)), determine the corresponding ordering maintained within the Hibernate metamodel.

Specified by:
order in interface EnhancementContext
Parameters:
persistentFields - The persistent field references.
Returns:
The ordered references.


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