2 Replies Latest reply on Nov 22, 2017 7:50 AM by jaikiran pai

    wildfly 11.0.0.Final Hibernate 5.1 Entity mapping doe not seem to honor schema parameter in @Table annotation

    Richard Yang Apprentice

      I am trying to migrate my app running on wildfly 8.2.0.Final to latest 11.0 release.

      One show stopper is that the "schema" parameter inside the @Table annotation does not seem to work anymore.

      For example I have the following Entities:

      @Entity
      @Table(name = "ObjectA", schema = "schemaA")

      public class A {

       

       

           @JoinColumn(name = "schemaB_ID")

           public B getPropertyType() {

              return b;

           }

      }

      @Entity
      @Table(name = "ObjectB", schema = "schemaB")

      public class B {

       

      }

       

      The two entities are in different schemas sitting on the same mysql server.

      In persistence.xml my default entityManagerFactory is schemaA.

      However when I use jpa query:

      A fetch Join B, the application tries to find Table "ObjectB" on schemaA instead of trying to find it on SchemaB. So the @Table(name = "ObjectB", schema = "schemaB") is ignored?

       

      The same query works fine in wildfly 8.2 with hibernate 4.3.

      Not sure what I have to change in wildfly 11 with hibernate 5.1 and not sure what is breaking this, JPA? Hibernate? or Wildfly?

       

       

      Thanks.