OPENJPA-1253: clean up code for uni-directional one-to-many Map using foreign key strategy

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@818531 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Fay Wang 2009-09-24 16:12:09 +00:00
parent d8eadfe600
commit 7d3497781c
1 changed files with 3 additions and 6 deletions
openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats

View File

@ -89,11 +89,11 @@ public class HandlerRelationMapTableFieldStrategy
if (isUni1ToMFK()) {
sel.whereForeignKey(field.getElementMapping().getForeignKey(),
sm.getObjectId(), field.getElementMapping().getDeclaredTypeMapping(), store);
sel.select(vals[idx], field.getElementMapping().
getSelectSubclasses(), store, fetch, eagerMode, null);
} else {
sel.whereForeignKey(field.getJoinForeignKey(),
sm.getObjectId(), field.getDefiningMapping(), store);
}
if (!isUni1ToMFK()) {
Joins joins = joinValueRelation(sel.newJoins(), vals[idx]);
sel.select(vals[idx], field.getElementMapping().
getSelectSubclasses(), store, fetch, eagerMode, joins);
@ -102,10 +102,7 @@ public class HandlerRelationMapTableFieldStrategy
//### thus we can use first mapping of union only
if (idx == 0)
resJoins[1] = joins;
} else {
sel.select(vals[idx], field.getElementMapping().
getSelectSubclasses(), store, fetch, eagerMode, null);
}
}
}
});
Result res = union.execute(store, fetch);