-->
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: Can SchemaExportTask Generate DDL That Checks Existence?
PostPosted: Fri Feb 02, 2007 7:43 pm 
Newbie

Joined: Thu Feb 01, 2007 7:29 pm
Posts: 5
Currently when I generate DDL using org.hibernate.tool.hbm2ddl.SchemaExportTask I get this:

alter table ATTRS drop constraint PARENT_ID_FK;

I would like the DDL to check for existence first like this:

if exists
(select * from sysobjects where id = object_id('PARENT_ID_FK')
and OBJECTPROPERTY(id, N'IsConstraint') = 1)
ALTER TABLE ATTRS DROP CONSTRAINT PARENT_ID_FK

Is there a way to do this? Maybe by configuring SchemaExportTask or the mapping XML files?

I'm using the SQL Server dialect.

Thx,

Dan


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.