From ff95d49d4ae7b8d22cef002e84fb7c5673416cde Mon Sep 17 00:00:00 2001 From: hns Date: Thu, 27 Feb 2003 13:06:43 +0000 Subject: [PATCH] Make getVirtualMapping() aware of prototyped collections, i.e. the application's DbMapping is returned instead of a synthetic virtualMapping. --- src/helma/objectmodel/db/Relation.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/helma/objectmodel/db/Relation.java b/src/helma/objectmodel/db/Relation.java index 7554356a..c29a08c1 100644 --- a/src/helma/objectmodel/db/Relation.java +++ b/src/helma/objectmodel/db/Relation.java @@ -344,9 +344,20 @@ public final class Relation { } + /** + * get a DbMapping to use for virtual aka collection nodes. + */ public DbMapping getVirtualMapping () { + // return null unless this relation describes a virtual/collection node. if (!virtual) return null; + // if the collection node is prototyped, return the app's DbMapping + // for that prototype + if (prototype != null) { + return otherType; + } + // create a synthetic DbMapping that describes how to fetch the + // collection's child objects. if (virtualMapping == null) { virtualMapping = new DbMapping (ownType.app); virtualMapping.subRelation = getVirtualSubnodeRelation ();