if (hit != null)
{
NodeImplProxy proxy = hit.getNode();
if (proxy.getNode() == null)
{
throw new NodeDoesNotExistException("No node of type " + nodeType + "found at path: " + fullPath);
}
return proxy;
}
Criteria c = new Criteria();
c.addEqualTo("fullPath", fullPath);
c.addEqualTo("nodeType", new Integer(nodeType));
Query query = QueryFactory.newQuery(NodeImpl.class, c);
Node nodeObj = (Node) getPersistenceBrokerTemplate().getObjectByQuery(query);
if (null != nodeObj)
{
NodeImplProxy proxy = new NodeImplProxy(nodeObj);
addToCache(new NodeCache(proxy));
return proxy;
}
else
{
addToCache(new NodeCache(new NodeImplProxy(fullPath, nodeType)));
throw new NodeDoesNotExistException("No node of type " + nodeType + "found at path: " + fullPath);
}
}