setConstraints now is safe for transient nodes, since it uses
a node property instead of the node id to establish object references.
This commit is contained in:
parent
35ac6602bc
commit
c4fa72c66e
1 changed files with 12 additions and 10 deletions
|
@ -477,20 +477,22 @@ public class Relation {
|
|||
if (propname != null) {
|
||||
INode home = constraints[i].isGroupby ? parent : parent.getNonVirtualParent ();
|
||||
String localName = constraints[i].localName;
|
||||
if (localName == null || localName.equals (ownType.getIDField ())) {
|
||||
child.setNode (propname, parent);
|
||||
} else {
|
||||
String value = null;
|
||||
if (localName == null || localName.equals (ownType.getIDField ()))
|
||||
value = home.getID ();
|
||||
else if (ownType.isRelational ())
|
||||
if (ownType.isRelational ())
|
||||
value = home.getString (ownType.columnNameToProperty (localName), false);
|
||||
else
|
||||
value = home.getString (localName, false);
|
||||
if (value != null) {
|
||||
System.err.println ("SETTING "+child+"."+propname+" TO "+value);
|
||||
// System.err.println ("SETTING "+child+"."+propname+" TO "+value);
|
||||
child.setString (propname, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// a utility method to escape single quotes
|
||||
|
|
Loading…
Add table
Reference in a new issue