| eeff soft In order to exclude the EntityB form the persistence unit you have to add
<exclude-unlisted-classes>true</exclude-unlisted-classes>
to the <pesistence-unit> <persistence-unit name="persistenceunitA" transaction-type="RESOURCE_LOCAL"> .... <class>ar.com.eeff.hibernatebugtest.A.TableA</class> <exclude-unlisted-classes>true</exclude-unlisted-classes> .... </persistence-unit> Without
<exclude-unlisted-classes>true</exclude-unlisted-classes>
Hibernate scans all classes in the root of the Persistence Unit searching for all the annotated managed classes and in your case the second entity you defined TableB has not a corresponding table in the schema databaseA you are connecting to. |