Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to turn off hbm2ddl?

I couldn't find a reference on how to switch hbm2ddl off.

like image 322
Alex Avatar asked Jul 05 '10 13:07

Alex


People also ask

How do I stop a table from hibernation?

Just set the hibernate. hbm2ddl. auto property to none instead of update since you don't need the DB schema to be generated for you.

What is the use of hbm2ddl Auto?

auto Automatically validates or exports schema DDL to the database when the SessionFactory is created. With create-drop, the database schema will be dropped when the SessionFactory is closed explicitly.

What is Spring JPA Hibernate DDL Auto?

spring. jpa. hibernate. ddl-auto (enum) is a Hibernate feature that controls the behavior in a more fine-grained way.


1 Answers

Just omitting hibernate.hbm2ddl.auto defaults to Hibernate not doing anything. From the reference documentation:

1.1.4. Hibernate configuration

The hbm2ddl.auto option turns on automatic generation of database schemas directly into the database. This can also be turned off by removing the configuration option, or redirected to a file with the help of the SchemaExport Ant task.

Setting hbm2ddl.auto to none (undocumented) might generate a warning, such as: org.hibernate.cfg.SettingsFactory - Unrecognized value for "hibernate.hbm2ddl.auto": none

like image 102
Pascal Thivent Avatar answered Sep 20 '22 06:09

Pascal Thivent