Reputation: 31
I am trying to validate database schema before running any queries using jdbc template. So is there any way to identify schema changes before making any queries in spring programmatically?? Currently I am using spring boot 2 and hibernate 5.
Upvotes: 2
Views: 2218
Reputation: 1085
Add this to the configuration file.
hibernate.hbm2ddl.auto=validate
If the value is validated then hibernate only validates the table structure- whether the table and columns have existed or not. If the table doesn’t exist then hibernate throws an exception.
Validate is the default value for hbm2ddl.auto.
Upvotes: 3