The following shows how to define a OpenJPA enhancer task and how to invoke the task in ANT.
First you'll need to compile the Entites. (Note: as a prereq to running the enhance task, I copied my persistence.xml file to my /build directory. You might not need to do this, but the persistence.xml has to be in the classpath.)
Next you'll need to configure the enhancer task and a classpath where the task can be found.
The final step is to call the enhance task. A snippet is provided below:
{code}
{code}
The persistence.xml doesn't have to be complete. The required elements are the persistence-unit (any legal name will do), and the provider (you have to identify openjpa). You can identify the classes to be enhanced either in this file or in the enhancer task ant project.
{code}
org.apache.openjpa.persistence.PersistenceProviderImpl
com.egg.sample.model.Employee
{code}