When I deploy my application in WildFly, I get a bunch of log statements from hibernate for tables with underscore in the name:
2016-05-03 11:39:25,344 INFO [org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl] (ServerService Thread Pool – 61) HHH000262: Table not found: AAA_BBB
I've investigated a bit and found that it is due to the usage of sp_tables. This (which is what Hibernate uses) does not work:
exec sp_tables N'AAA_BBB',N'',N'MyDb',N'''''''TABLE'''',''''VIEW''''''', @fUsePattern = 1
This however, works:
exec sp_tables N'AAA_BBB',N'',N'MyDB',N'''''''TABLE'''',''''VIEW''''''', @fUsePattern = 0
Microsoft SQL Server 2012
can you provide a test that reproduce the issue?
Hibernate does not use sp_tables. Hibernate simply uses the capabilities provided by JDBC; your driver is simply forwarding that as a call to sp_tables.
Use of database vendor specific schema metadata schema or props is beyond the scope of Hibernate. We do however offer pluggable extension points allowing you to tell Hibernate a different way to obtain the necessary information an alternative way.