Wednesday, January 5, 2011

Hibernate

hbm2ddl.auto possibilities..

See this blog :

http://blog.eyallupu.com/2007/05/hibernates-hbm2ddl-tool.html

create - Creates the schema and reads /import.sql if exists

create-drop - Creates the schema when entity manager factory is created. [which holds the session factory], but when entity manager is explicitly closed, it deletes the schema. Uses /import.sql if exists.

update - Tries to create the scripts to update the schema changes depending on the mapping. Some times it may not be possible to do this.

validate - Doesn't do any action pertaining the schema.