title: Guice JpaRepositoryModule with multiple Persistence Units
body: <p>I've declared my 2 PUs on persistence.xml as below:</p>
  
  <pre><code>&lt;persistence-unit name="myJpaUnit" transaction-type="RESOURCE_LOCAL"&gt;
      &lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt;
      &lt;!-- JPA entities must be registered here --&gt;
      &lt;class&gt;MyUserClass&lt;/class&gt;...
  
  &lt;persistence-unit name="anotherJpaUnit" transaction-type="RESOURCE_LOCAL"&gt;
      &lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt;
      &lt;!-- JPA entities must be registered here --&gt;
      &lt;class&gt;MyAnotherClass&lt;/class&gt;
  
      &lt;properties&gt;
          &lt;property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"&gt;&lt;/property&gt;...
  </code></pre>
  
  <p>Configured JpaPersistenceModule as below:</p>
  
  <pre><code>new IBSJpaRepositoryModule("myJpaUnit", "anotherJpaUnit")
  </code></pre>
  
  <p>Binded the repository classes:</p>
  
  <pre><code>protected void bindRepositories(RepositoryBinder binder) {
      binder.bind(UserRepository.class).to("myJpaUnit");
  
      binder.bind(TableauUserRepository.class).to("anotherJpaUnit");
  }
  </code></pre>
  
  <p>Repository classes are annotated with @Transacional declaring wich PU it is:</p>
  
  <pre><code>@Transactional(value = "myJpaUnit")
  public interface UserRepository extends JpaRepository&lt;User, String&gt;, EntityManagerProvider {
  
  }
  
  @Transactional(value = "anotherJpaUnit", readOnly = true)
  public interface TableauUserRepository extends JpaRepository&lt;TableauUser, Integer&gt; {
  
  }
  </code></pre>
  
  <p>I have only one Entity mapped on "anotherJpaUnit", declared this way:</p>
  
  <pre><code>@PersistenceContext(unitName="anotherJpaUnit")
  @Entity(name = "_user")
  @Data
  public class TableauUser {
      @Id
      private int id;
      @Column(length = 255)
      private String name;
      @Column(name = "url_namespace", length = 255)
      private String urlNamespace;
      @Column(length = 255)
      private String status;
  }
  </code></pre>
  
  <p>But when I start my application, Guice initialization throws errors:</p>
  
  <pre><code>Caused by: javax.persistence.PersistenceException: [PersistenceUnit: myJpaUnit] Unable to build EntityManagerFactory
  at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:914)
  at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:889)
  at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)
  at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:287)
  at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:310)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
  ... 38 more
  Caused by: org.hibernate.HibernateException: Missing table: _user
      at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1265)
  </code></pre>
  
  <p>The table "_user" only exists on "anotherJpaUnit", why it tries to bind with "MyJpaUnit"? I don't know what I'm doing wrong here. Anyone has an example of JpaRepositoryModule with multiple PU working?</p>