有人可以解释一下我在这里做错了什么吗?我不能 似乎让链接工作。当它创建链接时为什么会说 它创建了0个链接?当我想删除postid为什么它会得到 我错误:字符串索引超出范围:28?
[root@localhost bin]# java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)
[root@localhost bin]# ./console.sh
ORIENT database v.1.0rc2 www.orientechnologies.com
Type 'help' to display all the commands supported.
> CREATE DATABASE local:../databases/test admin admin local
Creating database [local:../databases/test] using the storage type
[local]...
Database created successfully.
Current database is: local:../databases/test
> connect local:../databases/test admin admin
Connecting to database [local:../databases/test] with user
'admin'...OK
> CREATE CLASS POST
Class created successfully with id=2
> CREATE CLASS COMMENT
Class created successfully with id=3
> INSERT INTO POST (id, title) VALUES ( 10, 'NoSQL movement' );
Inserted record 'POST#5:0{id:10,title:NoSQL movement} v0' in 0.002000
sec(s).
> INSERT INTO POST (id, title) VALUES ( 20, 'New OrientDB' );
Inserted record 'POST#5:1{id:20,title:New OrientDB} v0' in 0.000000
sec(s).
> INSERT INTO COMMENT (id, postId, text) VALUES ( 0, 10, 'First' );
Inserted record 'COMMENT#6:0{id:0,text:First,postId:10} v0' in
0.000000 sec(s).
> INSERT INTO COMMENT (id, postId, text) VALUES ( 1, 10, 'Second' );
Inserted record 'COMMENT#6:1{id:1,text:Second,postId:10} v0' in
0.000000 sec(s).
> INSERT INTO COMMENT (id, postId, text) VALUES ( 21, 10, 'Another' );
Inserted record 'COMMENT#6:2{id:21,text:Another,postId:10} v0' in
0.001000 sec(s).
> INSERT INTO COMMENT (id, postId, text) VALUES ( 41, 20, 'First again' );
Inserted record 'COMMENT#6:3{id:41,text:First again,postId:20} v0' in
0.000000 sec(s).
> INSERT INTO COMMENT (id, postId, text) VALUES ( 82, 20, 'Second Again' );
Inserted record 'COMMENT#6:4{id:82,text:Second Again,postId:20} v0' in
0.000000 sec(s).
> CREATE LINK comments FROM comment.postId To post.id INVERSE
[==========] 100% Done.
Created 0 link(s) in 0.003000 sec(s).
> UPDATE comment REMOVE postId
Error: String index out of range: 28
> select * from post where comments.size() > 0
0 item(s) found. Query executed in 0.0030 sec(s).
答案 0 :(得分:2)
答案已在OrientDB集团官方发布: https://groups.google.com/d/msg/orient-database/ZwVVvvl69KI/YOxXY0oqwngJ
LVC @