[hibernate-issues] [Hibernate-JIRA] Created: (HHH-6112) ElementsCollection with List of Embeddables and FetchType.Eager result in wrong fetch

Edmondo Porcu (JIRA) noreply at atlassian.com
Mon Apr 11 13:30:59 EDT 2011


ElementsCollection with List of Embeddables and FetchType.Eager result in wrong fetch
-------------------------------------------------------------------------------------

                 Key: HHH-6112
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6112
             Project: Hibernate Core
          Issue Type: Bug
          Components: annotations
    Affects Versions: 3.5.4
         Environment: MYSQL 5, Hibernate Core and Annotation 3.5.4-Final
            Reporter: Edmondo Porcu
            Priority: Critical


Dear all,
a simple collection of embeddables who is not a set cannot be fetched correctly by Hibernate if one needs a fetchType.Eager .

    @Column(nullable=true)
    @IndexColumn(name="Ordinal")
    @JoinColumn(name = "Curve_curveName")
    @ElementCollection(fetch = FetchType.EAGER)
    private List<CurveInstrument> oisList;

I have been forced to add the indexColumn to avoid fetching multiple bags at once, and this worked fine in persisting my objects. When i retrieve them from the database, however, my list contains only the first element of the collection I have persisted.


@Embeddable
public class CurveInstrument implements Serializable {

    private static final long serialVersionUID = 4797265087176461985L;
    private String name;
    @Column(nullable=true)
    @Type(type="org.hibernate.type.NumericBooleanType")
	private boolean active = false;
    @Column(nullable=true)
    private double value=0;
    @Column(nullable=true)
    private double spread=0;
// Getters and setters
}



-- 
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