mirror of https://github.com/apache/openjpa.git
OPENJPA-1474: Setting intermediate field should take into account the loaded state
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@901464 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b94d23268f
commit
d23199bf20
|
@ -369,8 +369,7 @@ public class JDBCStoreManager
|
|||
Object mappedByObject = info.result.getMappedByValue();
|
||||
if (mappedByFieldMapping != null && mappedByObject != null)
|
||||
if (mappedByObject instanceof OpenJPAId &&
|
||||
mapping.getExtraFieldDataIndex(mappedByFieldMapping.
|
||||
getIndex()) != -1)
|
||||
mapping.getExtraFieldDataIndex(mappedByFieldMapping.getIndex()) != -1) {
|
||||
// The inverse relation can not be set since
|
||||
// we are eagerly loading this sm for
|
||||
// a sm owner that is still in the process of
|
||||
|
@ -379,10 +378,15 @@ public class JDBCStoreManager
|
|||
// The inverse relation is set later by
|
||||
// setInverseRelation() when the sm owner is fully
|
||||
// initialized.
|
||||
sm.setIntermediate(mappedByFieldMapping.getIndex(),
|
||||
mappedByObject);
|
||||
else
|
||||
int index = mappedByFieldMapping.getIndex();
|
||||
if (sm.getLoaded().get(index)) {
|
||||
sm.setImplData(index, mappedByObject);
|
||||
} else {
|
||||
sm.setIntermediate(index, mappedByObject);
|
||||
}
|
||||
} else {
|
||||
setMappedBy(sm, mappedByFieldMapping, mappedByObject);
|
||||
}
|
||||
}
|
||||
// load the selected mappings into the given state manager
|
||||
if (res != null) {
|
||||
|
|
Loading…
Reference in New Issue