[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-6112?page=c...
]
Edmondo Porcu commented on HHH-6112:
------------------------------------
I had found a solution to the issue, but I really don't like it. I guess it takes ages
to people to find it:
@Column(nullable=true)
@OrderColumn(name="Ordinal")
@JoinTable(name= "tenor6mcurve_fras6m",joinColumns=@JoinColumn(name =
"Tenor6MCurve_curveName"))
@Fetch(value = FetchMode.SELECT)
@ElementCollection(fetch=FetchType.EAGER)
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira