• 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

Cascade Deletion

 
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

To simplify the situation, I will construct a simple example:
Consider, I have a Person that has addresses (bi-directional)



The problem is:
When I update an existing address or when I create a new address, I simply use the

method and everythink works as expected.
But when I delete an address the deletion is not detected by the EntityManager,
beause I cannot see any SQL statements when I call

Is this the intended bahaviour? I was expecting the address to be removed when merging the appropriate person.

Any comments?
I am using Sun App Server 9 (TopLink) for this example.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Merging is for reattaching detached objects. Why aren't you calling persist to actually persist the change/deletion.

It depends, and it is explained in the Java Persistence with Hibernate book and also on the Hibernate website documentation page.

Mark
 
reply
    Bookmark Topic Watch Topic
  • New Topic