我正在试验OrientDB(社区版v1.7-rc2)/ Oriento(0.4.0)
功能
function linkChildToParent(oChild, oParent) {
return (
oDB.edge.from(oChild).to(oParent)
.create({"@class": 'OrgUnit_isPartOf_OrgUnit'})
.tap(log)
.return(oChild)
);
}
失败并出现异常
C:\Users\Udo\workspace\NodeOrient\node_modules\oriento\node_modules\bluebird\js\main\async.js:93
throw res.e;
^
OrientDB.RequestError: Cannot find a command executor for the command request: sql.#11.1
at Operation.parseError (C:\Users\Udo\workspace\NodeOrient\node_modules\oriento\lib\transport\binary\protocol\operation.js:806:13)
at Operation.consume (C:\Users\Udo\workspace\NodeOrient\node_modules\oriento\lib\transport\binary\protocol\operation.js:396:35)
at Connection.process (C:\Users\Udo\workspace\NodeOrient\node_modules\oriento\lib\transport\binary\connection.js:324:17)
at Connection.handleSocketData (C:\Users\Udo\workspace\NodeOrient\node_modules\oriento\lib\transport\binary\connection.js:250:17)
at Socket.emit (events.js:95:17)
at Socket.<anonymous> (_stream_readable.js:764:14)
at Socket.emit (events.js:92:17)
at emitReadable_ (_stream_readable.js:426:10)
at emitReadable (_stream_readable.js:422:5)
at readableAddChunk (_stream_readable.js:165:9)
From previous event:
at Function.Promise$All [as all] (C:\Users\Udo\workspace\NodeOrient\node_modules\bluebird\js\main\promise.js:193:12)
at generateDependents (C:\Users\Udo\workspace\NodeOrient\setupOrgDB.js:202:35)
From previous event:
at Function.Promise$Join [as join] (C:\Users\Udo\workspace\NodeOrient\node_modules\bluebird\js\main\join.js:118:15)
at BinaryTransport.populateDB (C:\Users\Udo\workspace\NodeOrient\setupOrgDB.js:219:20)
所以我调试了驱动程序,直到找到
function createEdge (db, config, from, to) {
var command = "CREATE EDGE",
className, attributes;
config = edgeConfig(config);
className = config[0];
attributes = config[1];
command += ' ' + className + ' FROM ' + edgeReference(from) + ' TO ' + edgeReference(to);
if (attributes) {
command += ' CONTENT ' + JSON.stringify(attributes);
}
return db.query(command);
}
return db.query(command);
之前的命令内容
CREATE EDGE OrgUnit_isPartOf_OrgUnit FROM (#11.1) TO (#11.0)
然后我使用(基于浏览器的)控制台来验证OrgUnit_isPartOf_OrgUnit实际上是从Edge继承的。我还验证了它将OrgUnit与OrgUnit Vertices链接,并且OrgUnit是从Vertex派生的。我还双重验证了记录#11.1和#11.0实际存在于数据库中。
然后我发了
CREATE EDGE OrgUnit_isPartOf_OrgUnit FROM (#11.1) TO (#11.0)
直接在控制台中获得
com.orientechnologies.orient.core.command.OCommandExecutorNotFoundException: Cannot find a command executor for the command request: sql.#11:1
这基本上是相同的例外。通过Google,我发现了一些Javadoc for this exception。然而,这根本没有帮助我。
有什么问题,我该如何解决?
答案 0 :(得分:2)
正确的命令应该没有括号。括号执行子查询:
CREATE EDGE OrgUnit_isPartOf_OrgUnit FROM #11:1 TO #11:0
有关更多信息,请查看Create Edge命令。