From a8fd428530f962829d4de2dc762ad9dc705ba59f Mon Sep 17 00:00:00 2001 From: hns Date: Thu, 6 Dec 2001 22:35:24 +0000 Subject: [PATCH] Every DbMapping object must now have a reference to the application it belongs to. --- src/helma/objectmodel/db/DbMapping.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/helma/objectmodel/db/DbMapping.java b/src/helma/objectmodel/db/DbMapping.java index 5a74e0d2..8b9bcc46 100644 --- a/src/helma/objectmodel/db/DbMapping.java +++ b/src/helma/objectmodel/db/DbMapping.java @@ -88,7 +88,9 @@ public class DbMapping implements Updatable { /** * Create an empty DbMapping */ - public DbMapping () { + public DbMapping (Application app) { + + this.app = app; prop2db = new Hashtable (); db2prop = new Hashtable (); @@ -471,7 +473,7 @@ public class DbMapping implements Updatable { if (parentMapping != null) return parentMapping.getPropertyMapping (null); } - + Relation rel = (Relation) prop2db.get (propname.toLowerCase()); if (rel != null) { // if this is a virtual node, it doesn't have a dbmapping @@ -480,7 +482,7 @@ public class DbMapping implements Updatable { else return rel.otherType; } - + if (propertiesRel != null) return propertiesRel.otherType; if (parentMapping != null) @@ -502,7 +504,7 @@ public class DbMapping implements Updatable { groupbyMapping = app.getDbMapping (subnodesRel.groupbyprototype); // if mapping doesn' exist or isn't defined, create a new (anonymous internal) one if (groupbyMapping == null) - groupbyMapping = new DbMapping (); + groupbyMapping = new DbMapping (app); groupbyMapping.subnodesRel = subnodesRel.getGroupbySubnodeRelation (); if (propertiesRel != null) groupbyMapping.propertiesRel = propertiesRel.getGroupbyPropertyRelation ();