Make createNode smarter about the prototype for the new child node it is
about to create. Otherwise, if called on a persistent node, the new child node will be persisted with a possibly bogus id.
This commit is contained in:
parent
1271379eda
commit
7991f133d5
1 changed files with 13 additions and 1 deletions
|
@ -984,7 +984,19 @@ public final class Node implements INode, Serializable {
|
|||
anon = true;
|
||||
}
|
||||
|
||||
Node n = new Node(nm, null, nmgr);
|
||||
String proto = null;
|
||||
|
||||
// try to get proper prototype for new node
|
||||
if (dbmap != null) {
|
||||
DbMapping childmap = anon ?
|
||||
dbmap.getSubnodeMapping() :
|
||||
dbmap.getPropertyMapping(nm);
|
||||
if (childmap != null) {
|
||||
proto = childmap.getTypeName();
|
||||
}
|
||||
}
|
||||
|
||||
Node n = new Node(nm, proto, nmgr);
|
||||
|
||||
if (anon) {
|
||||
addNode(n, where);
|
||||
|
|
Loading…
Add table
Reference in a new issue