getRootNode(): Set DbMapping and prototype name to app.getRootMapping()

This commit is contained in:
hns 2005-05-18 08:44:43 +00:00
parent 0eb623afd5
commit e284f39be5

View file

@ -101,8 +101,14 @@ public final class NodeManager {
* Gets the application's root node. * Gets the application's root node.
*/ */
public Node getRootNode() throws Exception { public Node getRootNode() throws Exception {
DbKey key = new DbKey(app.getRootMapping(), app.getRootId()); DbMapping rootMapping = app.getRootMapping();
return getNode(key); 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. * Checks if the given node is the application's root node.