[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2306) put() fails on lazy one-to-many Map
Paul Brooks (JIRA)
noreply at atlassian.com
Tue Apr 10 14:58:06 EDT 2007
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_26674 ]
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: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list