-->
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: hibernate xdoclet set I AM LOST
PostPosted: Thu Feb 07, 2008 6:48 pm 
Newbie

Joined: Thu Feb 07, 2008 6:42 pm
Posts: 4
hello i am stuck can anyone help please... all of this works fine for mapping and retrieving data, BUT when i save a new object i get an error because the channelid is column in my table and has a foreign key relation.

what do i need to add to the xdoclet hibernate.set to fix this? or what do i need to change in the database shema to makes this work... thanks

/**
* @hibernate.set cascade="all"
*
* @hibernate.collection-key column="channelID"
*
* @hibernate.collection-one-to-many class="Channel"
*/
public Set getChannels() {
return channels;
}

public void setChannels(Set channels) {
this.channels = channels;
}


here is my error

java.sql.BatchUpdateException: null, message from server: "Cannot add
or update a child row: a foreign key constraint fails (`site`,
CONSTRAINT `fk_channelID` FOREIGN KEY (`channelID`) REFERENCES `channel`
(`channelID`))"


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 07, 2008 9:07 pm 
Newbie

Joined: Thu Feb 07, 2008 6:42 pm
Posts: 4
is this a mysql bug then?

http://bugs.mysql.com/bug.php?id=5103


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.