Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cascadeType.Persists in hibernate

 
srini carry
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am using hibernate
I have parent A and children b .


I want just save cascade from A to b and if a is deleted I donot want to delete b. So in A I specified CascaseType.Persisits,
when I save parent it does not save b and If I say cascadetype.all only then it saves


I am surprised is this the usuals behaviour or am I missing something for which cascadeType.Persists is not working ?


 
srini carry
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
srini carry wrote:
I am using hibernate
I have parent A and children b .


I want just save cascade from A to b and if a is deleted I donot want to delete b. So in A I specified CascaseType.Persisits,
when I save parent it does not save b and If I say cascadetype.all only then it saves


I am surprised is this the usuals behaviour or am I missing something for which cascadeType.Persists is not working ?




I will put in different words ,


I am using hibernate
I have parent A and children b .


I want just to save b when I save A and if A is deleted I don't want to delete b. So in A I specified CascaseType.Persisits,
when I save A it does not save b and If I use cascadetype.all only then it saves b .


I am surprised is this the usual behavior or am I missing something for which cascadeType.Persists is not working ?

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic