Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

"not-null property references a null or transient value" At Delete

 
Zain Rizvi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am able to save the objects in the database, but not delete them.

I have the following classes:





Here are the hibernate mapping





When I try to do


I get the following error:


One fix I found was, if I change the cascade values (in the Action hbm) to "save-update", and then delete each component separately. But I don't want to do that.
I think another solution would be if I can tell hibernate the order to delete the components, but I cannot find how to do this.

Any suggestions would be greatly appreciated.
Thank you
 
Pablo Abbate
Ranch Hand
Posts: 30
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please try with inverse = false and let us know ...
 
Zain Rizvi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Doing inverse="false" for the sets required me to do

in all 3 classes; Participant, Precondition, and Effect.

But running the application gave me the error

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic