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!
|