[hibernate-issues] [Hibernate-JIRA] Created: (HHH-2306) put() fails on lazy one-to-many Map

Andreas Idl (JIRA) noreply at atlassian.com
Wed Dec 13 07:20:05 EST 2006


put() fails on lazy one-to-many Map
-----------------------------------

         Key: HHH-2306
         URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2306
     Project: Hibernate3
        Type: Bug

    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