if (!(args[0] instanceof Scriptable)) {
throw new IllegalArgumentException("Second argument to HopObject.definePrototype() must be Object");
}
Scriptable desc = (Scriptable) args[0];
Properties childmapping = core.scriptableToProperties(desc);
if (!childmapping.containsKey("collection")) {
// if contained type isn't defined explicitly limit collection to our own type
childmapping.put("collection", HopObjectCtor.this.getFunctionName());
}
Properties props = new Properties();
props.put("_children", childmapping);
DbMapping dbmap = new DbMapping(core.app, null, props, true);
dbmap.update();
WrappedNodeManager nmgr = core.app.getWrappedNodeManager();
Node node = new Node("HopQuery", Long.toString(collectionId++), null, nmgr);