Petr Mensik
Petr Mensik

Reputation: 27536

Recreating table structure with JPA

This is a simply one - how can I make my DB (I am using Derby) to commit the changes in entity(I mean changing the column name, constraints, etc)? Because I've discovered when I change something in entity atributes, my DB still remains the same. I am also using Netbeans if there is any functionality for this.

I am now aware of hibernate.hbm2ddl.auto, but I am looking for something similar(e.g. I don't want to drop date during structure changes from entity to DB)

Upvotes: 1

Views: 905

Answers (1)

beerbajay
beerbajay

Reputation: 20300

You didn't specify your persistence provider, but I'll assume hibernate; you can use the hibernate.hbm2ddl.auto configuration parameter to tell hibernate to recreate the tables. See this SO question for more details. Note that you should not use this in production; see this SO question for those details.

Upvotes: 4

Related Questions