mirror of
https://github.com/apache/openjpa.git
synced 2025-02-22 18:32:06 +00:00
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:
parent
f4dfdf90b5
commit
c35c13497b
@ -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();
|
||||
|
@ -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>();
|
||||
|
Loading…
x
Reference in New Issue
Block a user