1

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?

Marcin
  • 3,232
  • 4
  • 31
  • 48
user359187
  • 2,269
  • 6
  • 29
  • 44

2 Answers2

4

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.

Community
  • 1
  • 1
NimChimpsky
  • 46,453
  • 60
  • 198
  • 311
0

change your hibernate config, from this

create to this

update

The DB will create 1 time

reznic
  • 672
  • 6
  • 9