-->
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.  [ 2 posts ] 
Author Message
 Post subject: Creating new tables without destroing the previous database
PostPosted: Thu Jul 05, 2007 12:41 pm 
Newbie

Joined: Thu Jul 05, 2007 12:20 pm
Posts: 3
Location: Vargem Grande do Sul, SP, BRAZIL!
Hi!

Sorry if the title of the topic is strange, bu i couldn't write in a better way, my english is a little poor :(

I have a web application that uses Hibernate. In this app, we have a lot of entities that are exported to tables using the SchemaExport utility class. I need to develop another app that will have entities relationated to some entities of the another application. I made a .jar that contains the entities of the first app, but theres a problem. If I use the SchemaExport to create the tables of the new app, the entities of the first app will overwrite the tables that were generated. Is there a way to tell the SchemaExport to not overwrite the existing tables?

Thanx!

_________________
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." (Fowler)


Top
 Profile  
 
 Post subject: I think I solved the problem...
PostPosted: Thu Jul 05, 2007 1:57 pm 
Newbie

Joined: Thu Jul 05, 2007 12:20 pm
Posts: 3
Location: Vargem Grande do Sul, SP, BRAZIL!
Hi everybody!

I think I solved the problem, it´s not the way that I wanted, but It will work.

I was using the "create" method of SchemaExport. This method generates a "drop if exists" clause. Now I´m using the "execute" method.

Code:
se.execute( true, true, false, true );


With the third parameter as false, Hibernate will not generate the drop clause in the sql script, so, if the table already exists, it will be manteined.

If anyone knows a better way to do this, I will be gratefull.

Thanx again!

_________________
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." (Fowler)


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

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.