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,6 +1483,9 @@ public class Node implements INode, Serializable {
|
||||||
// check if types match, otherwise throw exception
|
// check if types match, otherwise throw exception
|
||||||
DbMapping nmap = dbmap == null ? null : dbmap.getPropertyMapping (propname);
|
DbMapping nmap = dbmap == null ? null : dbmap.getPropertyMapping (propname);
|
||||||
if (nmap != null && nmap != value.getDbMapping()) {
|
if (nmap != null && nmap != value.getDbMapping()) {
|
||||||
|
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());
|
throw new RuntimeException ("Can't set "+propname+" to object with prototype "+value.getPrototype()+", was expecting "+nmap.getTypeName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue