-->
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.  [ 2 posts ] 
Author Message
 Post subject: Duplicate entry error
PostPosted: Tue Jan 24, 2006 12:24 pm 
Newbie

Joined: Tue Jan 24, 2006 12:11 pm
Posts: 7
I have a type table, it define animal type. Then I have another table like animal define a foregin key to link to type mkey. each time when I try to
insert data into animal table ( get object from type ), get error:
Caused by: java.sql.SQLException: Duplicate entry '1' for key 3


For animal table define:

<many-to-one name="animaltype"
class="Animaltype"
column="TYPEID"
cascade="none"
not-null="true" />

I define cascade="none" to try no effect type table. if I take off not-null="true", it can not insert typeID into animal table. How do I solve this problem?


Top
 Profile  
 
 Post subject: more info
PostPosted: Tue Jan 24, 2006 2:06 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
Please post all the relevant information according to suggested posting format, it greatly increases chances to get help

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


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