We are using JPA 2, Hibernate and the Criteria API in our project for which we need the Model Generator of Hibernate to create meta model classes.
In our Ant build process we included the annotation processor of hibernate-jpamodelgen.jar to generate the meta model classes for us.
The problem is that the classes that depend on the generated classes do not compile due to a "symbol not found" compile error.
[javac] ...\DocumentSpecifications.java:29: cannot find symbol
[javac] symbol : class Document_
[javac] location: package ...entity
[javac] import ...entity.Document_;
The ant script looks like this:
<javac srcdir="@{from}"
destdir="@{to}"
source="${compile.option.source-version}"
target="${compile.option.target-version}"
debug="${compile.option.debug}"
debuglevel="${compile.option.debuglevel}"
includeAntRuntime="false"
fork="${compile.option.fork}"
classpathref="path.ivy.libs.compile"
encoding="${sourcefiles.encoding}">
<compilerarg line="${compile.option.compilerarg} -s @{metamodel}" />
</javac>
A look in Ant's target directories shows that the meta model Java classes (.java) have been successfully created in the folder src/metamodel but no classes (.class) have been compiled to the folder build/classes.
Does Anyone know how to teach Ant or the Java compiler to include the generated class files?