In Hibernate 4, there was an org.hibernate.tool.hbm2ddl.DatabaseMetadata
class that provided information about the underlying database.
I have some logic based on this, namely using the DatabaseMetadata
class to provide some information about a table by returning a TableMetadata
instance, like this:
databaseMetadata = new DatabaseMetadata(connection, dialect, null);
TableMetadata tableMetadata = databaseMetadata.getTableMetadata(TABLE_NAME, "", "", false);
if (tableMetadata == null) {
tableMetadata = databaseMetadata.getTableMetadata(TABLE_NAME, databaseUsername, "", false);
}
However, in Hibernate 5, the DatabaseMetadata
class is gone. What replaces it? Is there another way to obtain a TableMetadata
instance?