OrientDB create link problem
Can someone please explain me what am I doing wrong here? I can't seem to get the link working. When it creates the link why does it say it created 0 links? and when I want to remove postid why does it get me Error: String index out of range: 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 command开发者_JAVA技巧s 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).
the answer has been published in the official OrientDB Group: https://groups.google.com/d/msg/orient-database/ZwVVvvl69KI/YOxXY0oqwngJ
Lvc@
精彩评论