• 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

Deleting object from list not being deleted in the database

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi I have a one to many relationship defined in the following way:

<list name="timeEntryDetailsList" cascade="all-delete-orphan" lazy="false" >
<key column="timeEntryId" not-null="true"/>
<index column="idx"/>
<one-to-many class="com.msdw.pbefficiency.servicestracker.hibernate.pojo.TimeEntryDetails"/>
</list>

When I remove an object from my list using iterator.remove() and the call saveOrUpdate() the removed object still exists in the database. I thought all that was required was a cascade="all-delete-orphan" in the hbm, but this did not work. Any suggestions on why?
 
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
There is no "all-delete-orphan" There is an "all" and a "delete-orphan" and you can use both by seperating them with a comma.

"all, delete-orphan"

Mark
 
I AM MIGHTY! Especially when I hold this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic