Alter database design with JPA -
i working on database jpa , curios altering database design. lets have table , want add/remove column in table.
i have tried re-deploying technique did not work me. using jpa 2.0
so, want know there standard way alter database tables or manually add/remove table's design? possible change primary key of table ?
any highly appreciated.
thanks :)
for non-production dbs can use persistence.xml
properties either create, drop-create or update existing db schema (example hibernate):
<persistence ...> <persistence-unit ...> <property name="hibernate.hbm2ddl.auto" value="create-drop" />
for eclipselink, property name different , available options:
<property name="eclipselink.ddl-generation" value="create-tables"/> <property name="eclipselink.ddl-generation.output-mode" value="database"/>
for production dbs stick manual changes have careful details , timing.
Comments
Post a Comment