]
Paul Brooks commented on HHH-2306:
----------------------------------
Am using 3.2.2 and can confirm this issue is present. Workaround is to specify
lazy="false" - not ideal but it'll do until a fix is released.
put() fails on lazy one-to-many Map
-----------------------------------
Key: HHH-2306
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2306
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.2.0.ga, 3.2.1
Environment: HIbernate 3.2.1. with Mysql 4
Reporter: Andreas Idl
Priority: Critical
Attachments: MapTest.zip
If I add n objects to a lazy-loaded one-to-many map, the first added object is not
contained afterwards.
The size of the map is (n-1).
Document document = (Document) session.load(Document.class,documentId);
DocumentHistory history = new DocumentHistory();
history.setVersion(1);
history.setTitle(document.getTitle());
history.setContent(document.getContent());
history.setDocument(document);
// Put the new history into the map.
Map<Integer, DocumentHistory> histories = document.getHistories();
histories.put(history.getVersion(), history);
//not equal because histories.size() is 0
assertEquals(1, histories.size());
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: