Inserting values into the map works just fine.
After some values have been succesfully inserted, the following code (using a new unique key/value pair) causes all but one entry to be deleted from the map:
Test Case
Session session = sessionFactory.openSession();
Transaction tx = session.beginTransaction();
MapHolder mapHolder = (MapHolder) session.get(MapHolder.class, mapHolderId);
// This passes - the map is not empty at this point:
assert(mapHolder.getMap().size() > 0);
MapValue mapValue = new MapValue();
mapValue.setName(valueString);
session.save(mapValue);
MapKey mapKey = new MapKey();
mapKey.setDefaultValue(mapValue);
mapKey.setName(keyString);
session.save(mapKey);
mapHolder.getMap().put(mapKey, mapValue);
tx.commit();
session.close();
Now if you open a new session and load the same map, you can see that there is only 1 entry in the map (the newly inserted entry). All previous entries were deleted.
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
Here is a summary of the important bits of the mappings and code, so you don't have to download the attachment to understand the problem:
Inserting values into the map works just fine.
After some values have been succesfully inserted, the following code (using a new unique key/value pair) causes all but one entry to be deleted from the map:
Now if you open a new session and load the same map, you can see that there is only 1 entry in the map (the newly inserted entry). All previous entries were deleted.