-->
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: Saving a bi-directional child on 2 'owners'
PostPosted: Fri Apr 18, 2008 12:08 am 
Beginner
Beginner

Joined: Thu Nov 20, 2003 1:30 pm
Posts: 27
Using Hibernate 3.2.6.ga

I have bi-directional Parent and Child classes.
And have a UncleChild class.

In the beginning of the transaction I save the Parent. It inserts the Parent and all the children. Later in the same transaction I
uncleChild.setChild(parent.getChildren().get(0)) and save the uncleChild.

It now tells me org.hibernate.PropertyValueException: not-null property references a null or transient value: com.myapp.UncleChild.child

Its definitely not null and I just saved the child via the cascade in Parent so it shouldn't be transient (right?).

The child is DEFINITELY in the database.

As a test, before the save(uncleChild) I did, get(Child.class, childId) ... it returned null, but its definitely in the database at this point. I don't know what this means, but something is funky.


Any ideas? Anything I can try?

I'm at a loss.

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.