h3a wrote:
what about export ??
and what does validate do ???
There is no such option as
'export' -
3.4. Optional configuration properties ->
Table 3.7. Miscellaneous Properties:
Quote:
hibernate.hbm2ddl.auto
Automatically validate or export 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.
eg. validate | update | create | create-drop
About
'validate' option:
Quote:
Another hbm2ddl.auto setting useful in development is validate. It enables
SchemaValidator to run at startup. This tool can compare your mapping against the JDBC metadata and tell you if the schema and mappings match. You can also run SchemaValidator programmatically:
Code:
Configuration cfg = new Configuration().configure();
new SchemaValidator(cfg).validate();
An exception is thrown if a mismatch between the mappings and the database
schema is detected.