Hi Mihai
the difference is that your query will result in something like following:
select from V_Comment where in('E_DocComment').@rid in [ "#19:5" ]
that is quite different from
select from V_Comment where in('E_DocComment').@rid in [ #19:5 ]
You can achieve the same result just passing an ORecordId instead of a
string:
OrientGraphFactory graphFactory = new OrientGraphFactory(SERVER_URL,
USER_LOGIN, USER_PASS);
ORecordId documentId = new ORecordId(19, 5);
OSQLSynchQuery<ODocument> query = new OSQLSynchQuery<>("select from
V_Comment where in('E_DocComment').@rid in [ ? ] ");
List<ODocument> result = graphFactory.getDatabase().command(query).execute(
documentId);
Luigi
2015-10-02 10:55 GMT+02:00 Mihai Ocneanu <[email protected]>:
> If I run the following query in studio:
>
> select from V_Comment where in('E_DocComment').@rid in [ #19:5 ]
>
> I get one result, as expected.
>
> If I run this code, using the Java API I get no results.
>
>
> OrientGraphFactory graphFactory = new OrientGraphFactory(SERVER_URL,
> USER_LOGIN, USER_PASS);
>
> String documentId = "#19:5";
> OSQLSynchQuery<ODocument> query = new OSQLSynchQuery<>("select from
> V_Comment where in('E_DocComment').@rid in [ ? ] ");
>
> List<ODocument> result = graphFactory.getDatabase().command(query).execute
> (documentId);
>
> Where does the difference come from?
>
> Thanks,
> Mihai
>
> P.S. Structure is:
> V_Document -- E_DocComment --> V_Comment
>
> --
>
> ---
> 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.
>
--
---
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.