title: Editing the name parameter of @java.persitence.Entity through external jaxb-Binding
body: <p>I have the following constellation:
  B1.xsd and B2.xsd both import A.xsd. Using <em>maven-hyperjaxb3-plugin</em> I created Java classes with JPA annotations for both B1.xsd and B2.xsd. So the classes of A.xsd are created in the project of B1.xsd as well es in the project of B2.xsd. 
  In order to use this two sets of classes in one persistence unit, I set through jaxb external binding the database schema on each Entity, like shown in <a href="https://stackoverflow.com/questions/32334881/editing-java-persitence-table-in-external-jaxb-binding">Editing @java.persitence.Table in external jaxb-Binding</a>.</p>
  
  <p>The problem is, after deploying to wildfly, wildfly throws <strong>org.hibernate.DuplicateMappingException: duplicate import: B1_ClassName refers to both B1_ClassName and B2_ClassName (try using auto-import=\"false\")"}}</strong></p>
  
  <p>So what I need to do is editing the name parameter of the Entity annotation through jaxb external binding so that</p>
  
  <pre><code>@XmlRootElement(name = "B1_Element1")
  @Immutable
  @Cacheable(true)
  @Entity(name = "B1_Element1")
  @Table(name = "B1_Element1")
  public class B1_Element1
      implements Serializable, Equals, HashCode, ToString
  {
  ...
  }
  </code></pre>
  
  <p>will look like</p>
  
  <pre><code>@XmlRootElement(name = "B1_Element1")
  @Immutable
  @Cacheable(true)
  @Entity(name = "PACKAGE_NAME.B1_Element1")
  @Table(name = "B1_Element1")
  public class B1_Element1
      implements Serializable, Equals, HashCode, ToString
  {
  ...
  }
  </code></pre>
  
  <p>My actual <em>bindings-xjc.xjb</em> looks like this</p>
  
  <pre><code>&lt;jaxb:globalBindings localScoping="toplevel"&gt;
      &lt;xjc:serializable /&gt;
  &lt;/jaxb:globalBindings&gt;
  
  &lt;jaxb:bindings schemaLocation="B1.xsd"
      node="/xs:schema"&gt;
  
      &lt;hj:persistence&gt;
  
          &lt;hj:default-generated-id name="Hjid"&gt;
              &lt;orm:generated-value strategy="IDENTITY" /&gt;
          &lt;/hj:default-generated-id&gt;
  
          &lt;hj:default-entity&gt;
              &lt;orm:table schema="B1_database_schema" /&gt;
          &lt;/hj:default-entity&gt;
  
      &lt;/hj:persistence&gt;
  
      &lt;jaxb:schemaBindings&gt;
          &lt;jaxb:package name="b1.package.name" /&gt;
      &lt;/jaxb:schemaBindings&gt;
  
  &lt;/jaxb:bindings&gt;
  </code></pre>
  
  <p><strong>Anybody has an idea how I can edit the name parameter of @java.persitence.Entity?</strong></p>