I am not able to reproduce any inconsistency using MySQL 5.7, mysql-connector-java-5.1.36-bin.jar with 5.0.1, 5.0.2, or 5.0.12. If schema is set using:
- @Table( schema="myschema", ...), the schema value is ignored;
- <property name="hibernate.default_schema" value="myschema"/>, the default schema name is ignored.
If the catalog is set using:
- @Table( catalog="mycatalog", ...), the table name is prefixed with "mycatalog"
- <property name="hibernate.default_catalog" value="mycatalog"/>, the table name is prefixed with "mycatalog"
In 5.0.1 and 5.0.12:
- Hibernate determines that MySQL does not support schemas because DatabaseMetaData#supportsSchemasInTableDefinitions returns false;
- Hibernate determines that MySQL supports catalogs because DatabaseMetaData#supportsCatalogsInTableDefinitions returns false;
If you are seeing a difference, the please provide a test case that reproduces the difference. Also please provide the exact MySQL version, JDBC version used. You can find test templates at: https://github.com/hibernate/hibernate-test-case-templates |