Announcement Announcement Module
No announcement yet.
Hibernate: not all elements of a map are persisted Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Hibernate: not all elements of a map are persisted

    Hi all

    I know, that this question is not really Spring-related, but I hope that somebody has encountered the same problem already.

    I have a ClassA with a bidirectional <map/> of ClassB instances associated through a join-table. The map has a cascade="all" set.

    Now, when I save an object ClassA with the properly populated ClassB elements in the map, I can see that ClassB objects as well as ClassA objects are inserted into the DB, but the join-table is getting only the 1st record of ClassA-->ClassB relation.
    Last edited by Injecteer; Feb 20th, 2007, 04:45 AM.

  • #2
    Ok, I fixed it.

    the problem was, that I had inverse="true" on ClassA's map, but when I moved it onto ClassB's <join>, all map's entries are persisted properly now