OPENJPA-1250: fix ClassCast exception with eagerly fetched ElementCollection

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@805090 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Fay Wang 2009-08-17 18:47:59 +00:00
parent f4dfdf90b5
commit c35c13497b
2 changed files with 3 additions and 1 deletions

View File

@ -408,6 +408,8 @@ public class JDBCStoreManager
// Check if the owner has eagerly loaded ToMany relations.
for (int i = 0; i < fms.length; i++) {
if (res.getEager(fms[i]) != null) {
if (fms[i].isElementCollection() && !fms[i].getElement().isTypePC())
continue;
Object coll = owner.fetchObject(fms[i].getIndex());
if (coll instanceof Map)
coll = ((Map)coll).values();

View File

@ -52,7 +52,7 @@ public class EntityA_Coll_String implements Serializable {
@Basic(fetch=FetchType.LAZY)
int age;
@ElementCollection // use default table (BasicA_NICKNAMES)
@ElementCollection(fetch=FetchType.EAGER)
@CollectionTable(name="NickNames_Tbl")
@Column(name="nicknames1", length=20)
protected Set<String> nickNames = new HashSet<String>();