-->
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: hibernate want to add an existing constraint
PostPosted: Thu Sep 16, 2004 9:55 am 
Newbie

Joined: Wed Sep 15, 2004 9:35 am
Posts: 13
hi,
hibernate want to create a constraint which exists soon in the database.
how can I tell hibernate , to use the existing constraint?

BasisModell and land have here a n:m relation in the table BASISMODELL_LAND

here my error message:

ERROR - Unsuccessful: alter table BASISMODELL_LAND add constraint FK7DE96F69205D3619 foreign key (BASISMODELL_ID) references BASISMODELL
ERROR - ORA-02275:such a referential constraint already exists in the table

here the BASISMODELL hbn.xml

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>
<class name="XX.xx.XX
" table="BASISMODELL">
<id name="id" column="ID" type="string">
<generator class="assigned">
</generator>
</id>

<many-to-one name="fahrzeugKlasse" column="FZGKLASSE_ID" class="de.xx.xx.FahrzeugKlasse"/>
<many-to-one name="fahrzeugTyp" column="FZGTYP_ID" class="de.xx.xx.FahrzeugTyp"/>

<set name="laender" table="BASISMODELL_LAND">
<key column="BASISMODELL_ID"/>
<many-to-many column="ID_LAND" class="de.xx.xx.Land"/>
</set>

<property name="bezeichnung" column="BASISMODELL_BEZ"/>
<property name="hersteller" column="HERSTELLER"/>
<property name="karrosserie" column="KARROSSERIE"/>
<property name="triebsatz" column="TRIEBSATZ"/>
<property name="giltVon" column="GILTVON"/>
<property name="giltBis" column="GILTBIS"/>
<property name="us" column="US"/>
<property name="ts" column="TS"/>
</class>

</hibernate-mapping>


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.