What does hibernate.default_schema mean to Hibernate ?
It sets the default database schema. Check out the User Guide for more details.
If I set hibernate.default_schema to say mock_schema1 does it set for Main table(@ Table) or secondary table(@ SecondaryTable) ?
The default schema applies to all tables mapped by your entities.
I was wondering if I can use any similar hibernate property for Dbtest which can use a different schema( mock_schema1 ) instead of the default schema( schema1 ).
This question is not very clear. You could use the hibernate.default_catalog if you want to set the default database catalog used by Hibernate, and vary the catalog for production or testing using Maven build profiles.
The below query is generated in the normal case by hibernate.
this_.objid as objid1_0_0_,
this_.name as name2_0_0_,
this_.resourceKey as resource3_0_0_,
this_.uuid as uuid4_0_0_,
this_1_.healthStatus as healthSt1_2_0_,
this_1_.lastSync as lastSync2_2_0_
In case of Dbtest, i want the query to use mock_schema2.Cluster instead of schema2.Cluster.
I want to know how to modify entity mapping metadata without modifying entity definition.
With hibernate property
One more thing i noticed
When i use hibernate.default_schema ZZZZZZ
Hibernate generated query contains
But when i use hibernate.default_catalog ZZZZZZ
I was expecting query to be something like ZZZZZZ.Cluster this_1_