• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

cascadeType.Persists in hibernate

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?

 
I knew I would regret that burrito. But this tiny ad has never caused regrets:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic