HI,
Sure,

Entity is a document which contains 2 fields: rid and key, so it is like
> Map.Enitity.
> Your solution is not workaround it is how you should use this document.
> But instead of entityDocument.rawField("rid") (it is internal API) you
> should use entityDocument.field("rid") or if you do not want to load
> associated document and get only identity use entityDocument.field("rid",
> OType.LINK).
> If you want to return only rids associated with references use
> entityBaseClass.getClassIndex(GraphModel.IDX_ENTITY_REFERENCE).getValues(references).



On Thu, Jan 30, 2014 at 11:01 AM, <[email protected]> wrote:

> Hi,
>
> I'm told that this is not a bug but the so by design and that I was using
> the index incorrectly.
> Perhaps Andrey would be so kind as to put his answer here as well for
> those that may come across this entry.
>
> Regards,
>  -Stefán
>
> On Tuesday, January 28, 2014 11:21:36 PM UTC, [email protected]:
>>
>> done
>>
>> On Tuesday, January 28, 2014 8:12:15 PM UTC, Lvc@ wrote:
>>>
>>> Hi Stefan,
>>> this means it's a bug. The rid document should be retrieved. Please
>>> could you open a new issue for that we can work asap?
>>>
>>> Thanks!
>>> Lvc@
>>>
>>>
>>> On 28 January 2014 20:55, <[email protected]> wrote:
>>>
>>>>
>>>> Workaround for this silly adventure:
>>>>
>>>> OrientVertex oEntity = graph.getVertex( entityDocument.rawField("rid")
>>>> );
>>>>
>>>>
>>>> On Tuesday, January 28, 2014 6:01:49 PM UTC, 
>>>> [email protected]:
>>>>>
>>>>> should I create an issue?
>>>>>
>>>>> On Tuesday, January 28, 2014 4:42:24 PM UTC, 
>>>>> [email protected]:
>>>>>>
>>>>>> Yup,
>>>>>>
>>>>>> It's the first thing I tried but it seems to return a corrupt
>>>>>> instance that throws a NullPointerException no matter what.
>>>>>>
>>>>>>    - OrientVertex oEntity = graph.getVertex(entityDocument);
>>>>>>    - if (oEntity == null) -> throws a null pointer exception
>>>>>>    - if ("" + oEntity) -> throws a null pointer exception
>>>>>>
>>>>>> Regards,
>>>>>>   -Stefán
>>>>>>
>>>>>> On Tuesday, January 28, 2014 4:35:43 PM UTC, Lvc@ wrote:
>>>>>>>
>>>>>>> Hi,
>>>>>>> the graph.getVertex() accepts the ODocument and ORID. Have you tried
>>>>>>> with:
>>>>>>>
>>>>>>>     OrientVertex oEntity = graph.getVertex(entityDocument);
>>>>>>>
>>>>>>> Lvc@
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On 28 January 2014 17:33, <[email protected]> wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I'm retrieving a document from an index (works fine):
>>>>>>>>
>>>>>>>> entities = entityBaseClass.getClassIndex(GraphModel.IDX_ENTITY_
>>>>>>>> REFERENCE).getEntries(references);
>>>>>>>>
>>>>>>>>
>>>>>>>> Calling the getVertex with the ODocument item returns null:
>>>>>>>>
>>>>>>>> for (ODocument entityDocument : entities) {
>>>>>>>>
>>>>>>>>     OrientVertex oEntity = graph.getVertex(entityDocument
>>>>>>>> .getIdentity());
>>>>>>>>
>>>>>>>>
>>>>>>>> I need and OrientVertex instance to work with and there is no
>>>>>>>> obvious way to cast ODocument to OrientVertex.
>>>>>>>>
>>>>>>>> I find no form of this that works: OrientVertex oEntity =
>>>>>>>> entityDocument.getRecord();
>>>>>>>>
>>>>>>>>
>>>>>>>> Thank you.
>>>>>>>>   -Stefán
>>>>>>>>
>>>>>>>> --
>>>>>>>>
>>>>>>>> ---
>>>>>>>> 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/groups/opt_out.
>>>>>>>>
>>>>>>>
>>>>>>>  --
>>>>
>>>> ---
>>>> 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/groups/opt_out.
>>>>
>>>
>>>  --
>
> ---
> 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/groups/opt_out.
>



-- 
Best regards,
Andrey Lomakin.

Orient Technologies
the Company behind OrientDB

-- 

--- 
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/groups/opt_out.

Reply via email to