Object API: generated schema with in/out relations

26 views
Skip to first unread message

Wouter de Vaal

unread,
Feb 19, 2015, 10:05:22 AM2/19/15
to orient-...@googlegroups.com
Hi,

I'm using Object API and let orient generate a schema for me with the objectDatabaseTx.getMetadata().getSchema().generateSchema() method.

If there is a link to another class, it adds it as a property link, but not as an in/out graph relation:

public class Login extends BasePersistentObject {

    private User belongsTo;

    private String username;

    private String passwordHash;
... more stuff

orientdb {db=orientdbtest}> info class Login

Class................: Login
Super class..........: BasePersistentObject
Default cluster......: login (id=117)
Supported cluster ids: [117]
Cluster selection....: round-robin
PROPERTIES
-------------------------------+-------------+-------------------------------+-----------+----------+----------+-----------+-----------+----------+
 NAME                          | TYPE        | LINKED TYPE/CLASS             | MANDATORY | READONLY | NOT NULL |    MIN    |    MAX    | COLLATE  |
-------------------------------+-------------+-------------------------------+-----------+----------+----------+-----------+-----------+----------+
 username                      | STRING      | null                          | false     | false    | false    |           |           | default  |
 belongsTo                     | LINK        | User                          | false     | false    | false    |           |           | default  |
 passwordHash                  | STRING      | null                          | false     | false    | false    |           |           | default  |
-------------------------------+-------------+-------------------------------+-----------+----------+----------+-----------+-----------+----------+

It has some data:

orientdb {db=orientdbtest}> select from Login

----+------+------+--------+------------+---------+------------------------------------
#   |@RID  |@CLASS|username|passwordHash|belongsTo|persistentObjectUuid                
----+------+------+--------+------------+---------+------------------------------------
0   |#117:0|Login |admin   |somepass    |#120:0   |0820df47-e52b-4050-a876-7c2f8375bc07
...
And we see the belongsTo link is ok, but when I query for out relations it gives nothing:

orientdb {db=orientdbtest}> select out() from Login

----+------+----
#   |@CLASS|out 
----+------+----
0   |null  |[0] 

Is there a way to have the schema be generated with relations? Or am I misunderstanding something here?

Thanks,
Wouter


Wouter de Vaal

unread,
Feb 23, 2015, 3:04:47 PM2/23/15
to orient-...@googlegroups.com
Anyone?

Op donderdag 19 februari 2015 16:05:22 UTC+1 schreef Wouter de Vaal:
Reply all
Reply to author
Forward
0 new messages