I am using EJB3. Initially I set
<property name="hibernate.hbm2ddl.auto"
value="update"/>
all data are kept when deploy/undeploy applications as expected.
Some data schema is changed, and I need to remove all tables and let JBoss generate new table mapping. I tried
<property name="hibernate.hbm2ddl.auto"
value="create"/>
<property name="hibernate.hbm2ddl.auto"
value="create-drop"/>
Some tables were removed, but some tables data are still there. I tried to remove them one by one, but some reference constraints did not allow me to do so. It is time consuming task to remove all tables.
What is the way to delete all tables and let JBOSS build table mapping again when deploying application? thanks.
The configuation I changed is the persistence.xml in entity.par
<?xml version="1.0" encoding="UTF-8"?>
<entity-manager>
<name>dc</name>
<jta-data-source>java:/DefaultDS</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto"
value="create-drop"/>
</properties>
<!-- optional stuff
<mapping-file>ormap.xml</mapping-file>
<jar-file>MyApp.jar</jar-file>
<class>com.widgets.Order</class>
<class>com.widgets.Customer</class>
-->
</entity-manager>
The related config under ejb3.deployer/meta-info/persistence.xml are commented out.
|