From 69589a1928fbbbccd320bc8e295bae8e76181636 Mon Sep 17 00:00:00 2001 From: hns Date: Mon, 15 Jan 2001 16:41:17 +0000 Subject: [PATCH] fixed dbmapping check for untyped virtual nodes --- src/helma/objectmodel/db/Property.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/helma/objectmodel/db/Property.java b/src/helma/objectmodel/db/Property.java index eaa9bbd5..38851a00 100644 --- a/src/helma/objectmodel/db/Property.java +++ b/src/helma/objectmodel/db/Property.java @@ -230,8 +230,9 @@ public final class Property implements IProperty, Serializable, Cloneable { if (rel != null && rel.other != null) { DbMapping vmap = value.getDbMapping (); // check if actual type matches expected type - if (rel.other != vmap) + if (rel.other != vmap && (!rel.virtual || rel.prototype != null)) { throw new RuntimeException ("Can't assign property: expected prototype "+rel.other+", got "+vmap); + } // check if this is a forward relation, i.e. if we point to a field in the value object // if so, we may use something else than the object's id to refer to it. if (!rel.virtual && rel.direction == Relation.FORWARD) {