title: JPA Modelgen generates model classes but does not compile them
body: <p>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.</p>
  
  <p>In our Ant build process we included the annotation processor of hibernate-jpamodelgen.jar to generate the meta model classes for us.</p>
  
  <p>The problem is that the classes that depend on the generated classes do not compile due to a "symbol not found" compile error. </p>
  
  <pre><code>[javac] ...\DocumentSpecifications.java:29: cannot find symbol
  [javac] symbol  : class Document_
  [javac] location: package ...entity
  [javac] import ...entity.Document_;
  </code></pre>
  
  <p>The ant script looks like this:</p>
  
  <pre><code>&lt;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}"&gt;
      &lt;compilerarg line="${compile.option.compilerarg} -s @{metamodel}" /&gt;
   &lt;/javac&gt;
  </code></pre>
  
  <p>A look in Ant's target directories shows that the meta model Java classes (<em>.java) have been successfully created in the folder src/metamodel but no classes (</em>.class) have been compiled to the folder build/classes. </p>
  
  <p>Does Anyone know how to teach Ant or the Java compiler to include the generated class files?</p>