有人可以解释一下我在这里做错了什么吗?我似乎无法使链接正常工作。当它创建链接时,为什么它说它创建了 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).