title: JPA correct location and packaging of metamodels
body: <p>I'm trying to make my project generates JPA metamodels for my entities.
  I'm using gradle on my project, so I added this line to my build.gradle dependencies object</p>
  
  <pre><code>annotationProcessor('org.hibernate:hibernate-jpamodelgen')
  </code></pre>
  
  <p>It actually works and metamodels are generated inside build dir of my project (not src!) under        </p>
  
  <pre><code>generated.sources.annotationProcessor.java.main.petmenu.entities
  </code></pre>
  
  <p>The problem is that they declare the same package of their source entities instead of their expected one, and they don't even import their source entities classes, like if they reside into the same package.</p>
  
  <pre><code>package petmenu.entities;
  
  import javax.annotation.Generated;
  import javax.persistence.metamodel.SetAttribute;
  import javax.persistence.metamodel.SingularAttribute;
  import javax.persistence.metamodel.StaticMetamodel;
  
  @Generated(value = "org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor")
  @StaticMetamodel(Costituente.class)
  public abstract class Costituente_ {
  ...
  ...
  ...
  }
  </code></pre>
  
  <p>Obviously I could easily fix the package declaration and the missing imports, but it sounds strange to me that these tasks are not accomplished automatically.
  Am I doing something wrong?</p>
  
  <p>EDIT:
  This is the error Eclipse throws on package declaration</p>
  
  <pre><code>The declared package "petmenu.entities" does not match the expected package "generated.sources.annotationProcessor.java.main.petmenu.entities"
  </code></pre>