Advantages:
1. Converting JAVA datatypes to DATABASE datatypes.
For Example: int --> number, string --> varchar2.
2. Auto generation of Schema & Tables.
hbm2ddl.auto = validate | update | create | create-drop
create = Creates new schema/table by dropping existing schema/table.
update = Updates the existing schema/table. If table doesn't exist, it creates
new one.
create-drop = creates new schema/table but it drops when session factory is
closed.
3. Automatic primary key generation.
Identity - MySQL, SQL Server, DB2, HQSQL
Sequence - Oracle, Postgre SQL, SQL Server, DB2, HQSQL
Table (Sequence) - Using a database table.
1. Converting JAVA datatypes to DATABASE datatypes.
For Example: int --> number, string --> varchar2.
2. Auto generation of Schema & Tables.
hbm2ddl.auto = validate | update | create | create-drop
create = Creates new schema/table by dropping existing schema/table.
update = Updates the existing schema/table. If table doesn't exist, it creates
new one.
create-drop = creates new schema/table but it drops when session factory is
closed.
3. Automatic primary key generation.
Identity - MySQL, SQL Server, DB2, HQSQL
Sequence - Oracle, Postgre SQL, SQL Server, DB2, HQSQL
Table (Sequence) - Using a database table.