Using the Java api on an Orient-DB 2.0 rc1. *Is it possible to use a string 
as a RID?*

Documentation : 
http://www.orientechnologies.com/docs/last/orientdb.wiki/Document-Database.htmlmore
 
specifiaclly the section SQL Commands

JSON received:

{
    userRID:"#100:100",
    code:"someCode"
}

JAVA CODE (xtend script):

def addUserInGroup(Message<JsonObject> message){
    val params = new JsonObject() => [
        putString("userId", message.body().getString("userRID"));
        putString("code", message.body().getString("group"));
    ]

    var queryCommand= "update Table add users=(Select @rid from User where 
@rid= :userId) where code=:code";

    Map<String, Object> paramsFormatted = params.toMap();

    database.command( new OCommandSQL(queryCommand) ).execute(paramsFormatted);
}

Table structure :

users : linklist (user object)
code : string

When I run the following commands in the studio they all work :

update Table add users=(Select @rid from User where @rid=#100:100) where 
code='someCode' update Table add users=#100:100 where code='someCode'

But none of these command work in the API. I'm guessing there is something 
wrong in way I'm using the RID.

JAVA error received or type (OCommandExecutionException) :

Error on execution of command: sql.Select @rid from User where @rid= :userId

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to