-->
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: Any way to remove an unnamed constraint?
PostPosted: Wed May 25, 2011 7:23 am 
Newbie

Joined: Tue May 24, 2011 2:24 pm
Posts: 1
I've got a web application that uses Hibernate and a 2.0.0 HSQLDB for data storage, and I'm trying to update it to use the latest 2.2.1 release of HSQL. However, I've run into some issues. I've since resolved most of them, but I have one problem I can't figure out.

Previously, when we declared our model objects, we declared them as both primary keys (using the @Id annotation) and unique. Apparently the new 2.2.1 HSQLDB doesn't like this, giving an error stating "a UNIQUE constraint already exists on the set of columns in statement...".

Removing this extraneous "unique" modifier on the model objects is not a problem. (In fact I'm not sure why it was ever added.) However, my issue comes when trying to upgrade a previous version of the database. I need to remove the unique constraint from the existing database in an SQL statement, but the only way I can find to do that is using a statement like:

ALTER TABLE [table_name] DROP CONSTRAINT [name_of_constraint];

But since Hibernate auto-generated the constraint I have no idea how to refer to it. Is this possible? is there another way to get rid of this constraint? Any hints or suggestions on how to tackle this problem would be appreciated.

Thanks!


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.