-->
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: SchemaExport and Oracle Unique key already exists error.
PostPosted: Thu Jul 15, 2004 10:30 am 
Newbie

Joined: Thu Jul 15, 2004 10:18 am
Posts: 1
This probably is a a problem with the mapping but it might be a bug also. I'm sure the experts here will be able to help...

Here is the simplified mapping version of the mapping we are using:
<hibernate-mapping>
<class name="testing.WhatThe" table="WhatThe" dynamic-update="false" dynamic-insert="false" >
<id name="id" column="WhatThe_ID" type="java.lang.Long" >
<generator class="native"> </generator>
</id>

<property
name="strongPersistentIdentifier"
type="java.lang.String"
update="true"
insert="true" >
<column
name="StrongPersistentIdentifier"
unique-key="SPI_KEY"
unique="true"
/>
</property>
</class>
</hibernate-mapping>

The generated sql for Oracle is:
create table WhatThe (
WhatThe_ID NUMBER(19,0) not null,
StrongPersistentIdentifier VARCHAR2(255) unique,
primary key (WhatThe_ID),
unique (StrongPersistentIdentifier)
);

This causes an extra unique key error from Oracle. Removing the
"unique (StrongPersistentIdentifier)" line from the generated SQL is the correct DDL for Oracle.

Searches on the forum didn't reveal any obvious answers but my apologies ahead of time if this is a known issue.


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.