[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-6783?page=c...
]
Wojciech Biela commented on HHH-6783:
-------------------------------------
I also found the same problem, and have spent a few hours figuring it out. With lazy
fetching works one way, with eager the other, the argument that it is by design and not a
bug would stand if it would behave the same way in both cases.
Anyway why does a user of the API have to care about what kind of join is done there
under. If I save 3 entities, I want to fetch 3, not 5.
Using FetchType.EAGER with @ElementCollection results in multiple
entity copies returned via Criteria query
-----------------------------------------------------------------------------------------------------------
Key: HHH-6783
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-6783
Project: Hibernate Core
Issue Type: Bug
Components: annotations
Affects Versions: 3.6.0
Environment: MySQL
Reporter: Greg Burcher
If we specify FetchType.EAGER on an @ElementCollection:
@ElementCollection(fetch = FetchType.EAGER)
@Column(name = "emailAddress")
private Set<String> emailAddresses;
then request all persisted objects of this class via Criteria:
session.createCriteria(ReportSchedule.class).list();
The returned list contains multiple references to each ReportSchedule, one per email
address.
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira