user359187
user359187

Reputation: 2279

Hibernate create database every time run the project

I have running a project in hibernate and the connection and pojo classes are successfully created for me. Now my problem is when i have running a project each time the hibernate is trying to create the database in the connected host, that's why unwanted indexes in my database each time when i run the project. Anybody know how could i avoid that?

Upvotes: 1

Views: 3478

Answers (2)

reznic
reznic

Reputation: 710

change your hibernate config, from this

create to this

update

The DB will create 1 time

Upvotes: 0

NimChimpsky
NimChimpsky

Reputation: 47290

change your hibernate config, from this

<property name="hbm2ddl.auto">create</property>

to this

<property name="hbm2ddl.auto">validate</property>

To stop hibernate creating the database each deploy. Alternate options are also available.

Upvotes: 4

Related Questions