setting a node with null prototype will now set the prototype to the expected
value. If the prototype is already set to a different value, an exception is thrown.
This commit is contained in:
parent
eb05a99a29
commit
3f285ac8fd
1 changed files with 4 additions and 1 deletions
|
@ -1483,7 +1483,10 @@ public class Node implements INode, Serializable {
|
|||
// check if types match, otherwise throw exception
|
||||
DbMapping nmap = dbmap == null ? null : dbmap.getPropertyMapping (propname);
|
||||
if (nmap != null && nmap != value.getDbMapping()) {
|
||||
throw new RuntimeException ("Can't set "+propname+" to object with prototype "+value.getPrototype()+", was expecting "+nmap.getTypeName());
|
||||
if (value.getDbMapping () == null)
|
||||
value.setDbMapping (nmap);
|
||||
else
|
||||
throw new RuntimeException ("Can't set "+propname+" to object with prototype "+value.getPrototype()+", was expecting "+nmap.getTypeName());
|
||||
}
|
||||
|
||||
checkWriteLock ();
|
||||
|
|
Loading…
Add table
Reference in a new issue