Suppose the schema or catalog contains two tables with similar names, eg an_entity and anoentity. When looking up table metadata via the JDBC metadata for the an_entity the underscore (single character wildcard) will cause two rows of metadata to be returned since the underlying metadata query seems to use a LIKE predicate and hence the wildcard matches both names.
will throw an error in the event that multiple rows are returned.
A test case is attached. Run first with hbm2ddl.auto to create and then setting to update will show the problem. The test case is in the form of an Eclipse Maven project.
I also have a suggested fix which I will submit, in which we find the row of metadata whose name actually matches that requested.
Tested on Oracle12, MySQL5.6