-->
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.  [ 3 posts ] 
Author Message
 Post subject: Drop and Create
PostPosted: Fri Jun 29, 2007 3:57 am 
Newbie

Joined: Thu Jun 28, 2007 2:50 am
Posts: 2
Hello,

On version 1.2.0 GA

I get the SchemaExport when I do a "Create", the table is dropped and created. Is there a way to do a create without drop ?

Regards,


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 29, 2007 1:39 pm 
Expert
Expert

Joined: Fri May 13, 2005 11:13 am
Posts: 292
Location: Rochester, NY
The SchemaExport class is fairly limited in the scope of what it does, so I wonder if it was even intended for more sophistcation than what it has.

Given the available methods, I don't know of any way to do it other than to capture the output from SchemaExport.Create( true, false ) by redirecting Console.Out, then pruning what you don't need and executing yourself.

This seems like a really ugly hack to me (I use SchemaExport, but only in testing so this hasn't been an issue) since it would seem preferrable for SchemaExport to have this functionality. Perhaps some more sophisticated extensions would be of interest to others as well.

Others may have better insights/more experience with this.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 29, 2007 2:01 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
SchemaExport was not really intended to be in any way a general tool. You can use cfg.GenerateSchemaCreationScript(dialect) (that's what SchemaExport uses) to get just the creation SQL.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.