title: How to validate Hibernate mapping against database
body: <p>How to check that Hibernate mapping configuration matches database? I'd like know if I am using wrong version of hibernate mapping before I start executing update and queries, which then would fail.</p>
  
  <p>I have bunch of classes that have been mapped with Hibernate annotations. I also have connection to corresponding database. Now I'd like to check if Hibernate mapping matches the database. </p>
  
  <p>I'd like to  check at least following things:</p>
  
  <ul>
  <li>all mapped tables in Hibernate configuration have corresponding object in database (e.g table or view)</li>
  <li>all mapped fields exist in database</li>
  <li>all mapped fields have correct types</li>
  </ul>
  
  <p>I'd prefer that I do not have to execute queries to mapped tables, preferably the check is based solely on database meta data.</p>