-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: delete all tables, how?
PostPosted: Wed Nov 02, 2005 7:23 pm 
Senior
Senior

Joined: Tue Sep 13, 2005 2:01 am
Posts: 137
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.