Im using hibernate.hbm2ddl.auto=validate
in my persistence.xml. But the problem I have is my project connects to multiple databases using multiple data sources.
So when I turn on validation then it will try to find out tables in wrong databases since they are annotated as tables. Is there any way to specify which tables each validator should look into ? following is the part of persistence.xml I have
<persistence-unit name="primary">
<jta-data-source>java:jboss/datasources/oneDataSource</jta-data-source>
<shared-cache-mode>DISABLE_SELECTIVE</shared-cache-mode>
<properties>
<property name="hibernate.hbm2ddl.auto" value="validate"/>
</properties>
</persistence-unit>
<persistence-unit name="mymysql">
<jta-data-source>java:jboss/datasources/twoDataSource</jta-data-source>
<shared-cache-mode>DISABLE_SELECTIVE</shared-cache-mode>
<properties>
<property name="hibernate.hbm2ddl.auto" value="validate"/>
</properties>
</persistence-unit>