Search code examples
hibernatehbm2ddl

What level of hibernate.hbm2ddl.auto to use in development mode


my case is as follows:

  1. I make changes in already existing tables.
  2. I add new tables.
  3. In the import script for hibernate (import.sql) sometimes i make changes in old queries and sometimes i add new queries.
  4. In Production it should be set to none, and use an sql script instead, right ?

please advise.


Solution

  • Yes. It should be

    hibernate.hbm2ddl.auto=update
    

    Also the other important properties should be set at a development env only,

    hibernate.show_sql=true
    hibernate.format_sql=true
    

    To track the hibernate queries generated.