7

I am using Hibernate 3.2.6 with hbm files. When using option hibernate.hbm2ddl.auto=validate, I receive only the first validation error. Is there a way to show all erros in schema?

Example: City.hbm.xml file has a property called 'name'. When I drop that column from table, I get: Missing column: name in nfe.dbo.city So far OK. But, City.hbm.xml file has another property called state. When I drop 'state' column from table, I receieve the same error (Missing column: name in nfe.dbo.city) and would like to receive all erros in schema (not just the first one).

2 Answers 2

3

There is no way to get it to show all errors in the schema because of how the code is written. If you read the code for Configuration.validateSchema() you'll see it throws a HibernateException on the first error found and thus ends the validation process.

Sign up to request clarification or add additional context in comments.

1 Comment

thanks, well I might just change that code or implement my own validation process.
3

I just created a custom Configuration class to get all the schema violations together. Posting the gist, could be useful to someone else :)

1 Comment

It would be awesome to add this to the hibernate maven plugin... I may try to tackle that when I get some time. I'll update if I do it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.