From e284f39be5580f01d1290f4e6271e1f73bf598dc Mon Sep 17 00:00:00 2001 From: hns Date: Wed, 18 May 2005 08:44:43 +0000 Subject: [PATCH] getRootNode(): Set DbMapping and prototype name to app.getRootMapping() --- src/helma/objectmodel/db/NodeManager.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/helma/objectmodel/db/NodeManager.java b/src/helma/objectmodel/db/NodeManager.java index a8babbbe..c41b7d6b 100644 --- a/src/helma/objectmodel/db/NodeManager.java +++ b/src/helma/objectmodel/db/NodeManager.java @@ -101,8 +101,14 @@ public final class NodeManager { * Gets the application's root node. */ public Node getRootNode() throws Exception { - DbKey key = new DbKey(app.getRootMapping(), app.getRootId()); - return getNode(key); + DbMapping rootMapping = app.getRootMapping(); + DbKey key = new DbKey(rootMapping, app.getRootId()); + Node node = getNode(key); + if (node != null && rootMapping != null) { + node.setDbMapping(rootMapping); + node.setPrototype(rootMapping.getTypeName()); + } + return node; } /** * Checks if the given node is the application's root node.