Javatpoint Logo

hibernate configuration files

By: ashish*** On: Sun Jul 17 14:38:16 IST 2016     Question Reputation0 Answer Reputation0 Quiz Belt Series Points0  0Blank User
<hibernate-configuration>

<session-factory>
<property name="hbm2ddl.auto">update</property> ------- Please Explain
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property> ------- Please explain
<property name="connection.url">jdbc:oracle:thin:@localhost:1521:xe</property>
<property name="connection.username">system</property>
<property name="connection.password">oracle</property>
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<mapping resource="employee.hbm.xml"/>
</session-factory>

</hibernate-configuration>


what is the first property used for "hbm2ddl.auto". Is this like update query in SQL. Do I need to have records in the table??Please explain.
Up0Down

 
hbm2ddl.auto is automatically validates and exports DDL to schema when the sessionFactory is created.

By default, It is not doing any creation or modification automatically on db. If user sets below values then it is doing DDL schema changes automatically.

create - doing creating schema
update - updating existing schema
validate - validate existing schema
create-drop - create and drop the schema automatically when session is starts and ends.
Image Created0Down

By: [email protected] On: Tue Jul 19 19:02:04 IST 2016 Question Reputation0 Answer Reputation0 Belt Series Points0 0User Image
Are You Satisfied :0Yes0No