Hi Andrey,
now it works, but my mistake was in the wrong management in handling null
cases.
However, what is the best way to perform a select like this?
Il giorno lunedì 14 luglio 2014 15:09:32 UTC+2, Andrey Kovalev ha scritto:
>
> I believe both methos are almost equal. As I understand developers
> translate java method calls to sql then.
> Did you try this where userId is a java.lang.String?
> this.txGraph.command(new OCommandSQL("select * from Users where userId =
> ?")).execute(userId);
>
> On Monday, 14 July 2014 11:31:32 UTC+1, Tiziano Fortin wrote:
>>
>> Hi luca,
>>
>> I've this java code:
>>
>> String userId;
>> Iterable<Vertex> vertexes = this.txGraph.command(new OCommandSQL("select
>> * from Users where userId = '" + userId + "'")).execute();
>> Vertex v = vertexes.iterator().next();
>>
>> but I obtain this error on vertexes.iterator().next() :
>>
>> java.util.NoSuchElementException
>>
>> at
>> com.tinkerpop.blueprints.impls.orient.OrientDynaElementIterator.next(OrientDynaElementIterator.java:31)
>>
>> at
>> myproject.adapter.persistence.OrientAdapterImpl.getUserData(OrientAdapterImpl.java:56)
>>
>>
>> In OrientStudio I retrieve correctly the result with same query. How i
>> can fix it?
>>
>
--
---
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.