Check if a virtual/collection/mountpoint object needs persistence when it is

created on a transient object.
This commit is contained in:
hns 2003-06-05 16:50:13 +00:00
parent ff563e677c
commit 9808820d92

View file

@ -1664,11 +1664,15 @@ public final class Node implements INode, Serializable {
// from a transient node for the first time, or when we get a collection whose
// content objects are stored in the embedded XML data storage.
if ((state == TRANSIENT) && propRel.virtual) {
INode node = new Node(propname, propRel.getPrototype(), nmgr);
Node pn = new Node(propname, propRel.getPrototype(), nmgr);
node.setDbMapping(propRel.getVirtualMapping());
setNode(propname, node);
prop = (Property) propMap.get(propname);
pn.setDbMapping(propRel.getVirtualMapping());
if (propRel.needsPersistence()) {
setNode(propname, pn);
prop = (Property) propMap.get(propname);
} else {
prop = new Property(propname, this, pn);
}
}
// if this is from relational database only fetch if this node
// is itself persistent.