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:
hns 2001-08-22 01:16:19 +00:00
parent 35ac6602bc
commit c4fa72c66e

View file

@ -477,16 +477,18 @@ public class Relation {
if (propname != null) { if (propname != null) {
INode home = constraints[i].isGroupby ? parent : parent.getNonVirtualParent (); INode home = constraints[i].isGroupby ? parent : parent.getNonVirtualParent ();
String localName = constraints[i].localName; String localName = constraints[i].localName;
String value = null; if (localName == null || localName.equals (ownType.getIDField ())) {
if (localName == null || localName.equals (ownType.getIDField ())) child.setNode (propname, parent);
value = home.getID (); } else {
else if (ownType.isRelational ()) String value = null;
value = home.getString (ownType.columnNameToProperty (localName), false); if (ownType.isRelational ())
else value = home.getString (ownType.columnNameToProperty (localName), false);
value = home.getString (localName, false); else
if (value != null) { value = home.getString (localName, false);
System.err.println ("SETTING "+child+"."+propname+" TO "+value); if (value != null) {
child.setString (propname, value); // System.err.println ("SETTING "+child+"."+propname+" TO "+value);
child.setString (propname, value);
}
} }
} }
} }