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();
|
Object mappedByObject = info.result.getMappedByValue();
|
||||||
if (mappedByFieldMapping != null && mappedByObject != null)
|
if (mappedByFieldMapping != null && mappedByObject != null)
|
||||||
if (mappedByObject instanceof OpenJPAId &&
|
if (mappedByObject instanceof OpenJPAId &&
|
||||||
mapping.getExtraFieldDataIndex(mappedByFieldMapping.
|
mapping.getExtraFieldDataIndex(mappedByFieldMapping.getIndex()) != -1) {
|
||||||
getIndex()) != -1)
|
|
||||||
// The inverse relation can not be set since
|
// The inverse relation can not be set since
|
||||||
// we are eagerly loading this sm for
|
// we are eagerly loading this sm for
|
||||||
// a sm owner that is still in the process of
|
// a sm owner that is still in the process of
|
||||||
|
@ -379,10 +378,15 @@ public class JDBCStoreManager
|
||||||
// The inverse relation is set later by
|
// The inverse relation is set later by
|
||||||
// setInverseRelation() when the sm owner is fully
|
// setInverseRelation() when the sm owner is fully
|
||||||
// initialized.
|
// initialized.
|
||||||
sm.setIntermediate(mappedByFieldMapping.getIndex(),
|
int index = mappedByFieldMapping.getIndex();
|
||||||
mappedByObject);
|
if (sm.getLoaded().get(index)) {
|
||||||
else
|
sm.setImplData(index, mappedByObject);
|
||||||
|
} else {
|
||||||
|
sm.setIntermediate(index, mappedByObject);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
setMappedBy(sm, mappedByFieldMapping, mappedByObject);
|
setMappedBy(sm, mappedByFieldMapping, mappedByObject);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// load the selected mappings into the given state manager
|
// load the selected mappings into the given state manager
|
||||||
if (res != null) {
|
if (res != null) {
|
||||||
|
|
Loading…
Reference in New Issue