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?

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

3 Comments

But i have only <property name="hibernate.hbm2ddl.auto">update</property> this in my hibernate config file
then hibernate is not creating a database, it is only altering it
Then how i got create multiple indexes in my database. Is there any other config to change?
0

change your hibernate config, from this

create to this

update

The DB will create 1 time

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.