English 中文(简体)
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 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).
最佳回答

the answer has been published in the official OrientDB Group: https://groups.google.com/d/msg/orient-database/ZwVVvvl69KI/YOxXY0oqwngJ

Lvc@

问题回答

暂无回答




相关问题
Looking for distributed, in-memory Graph DB [closed]

Is there a database which will satisfy all (or at least most) of this requirements? Graph oriented - optimized for storing graphs and traversal(e.g HyperGraphDB, Neo4j) Running in memory, but having ...

Graph-structured databases and Php

I want to use a graph database using php. Can you point out some resources on where to get started? Is there any example code / tutorial out there? Or are there any other methods of storing data that ...

Problem Working with Neo

I downloaded Neoclipse Source and downloaded the Neo4J source. However some of the classes that the Neoclipse source file refers to are not found in the Neo4J source. Are they deprecated? Can I get ...

热门标签