Hibernate configs

Documentation

In the hibernate.cfg.xml there is an option – ‘hibernate.hbm2ddl.auto’ that controls how it interacts with the database schema (assuming the user you used to connect has the appropriate privileges). The options for this config are as follows:

So the list of possible options are,

  • validate: validate the schema, makes no changes to the database.
  • update: update the schema.
  • create: creates the schema, destroying previous data.
  • create-drop: drop the schema at the end of the session.