Try
record.getIdentity();
Il giorno venerdì 23 dicembre 2016 14:41:42 UTC+1, TomekK ha scritto:
>
> Hello, could you help me?
>
> I have class with documents with link to attachments in another class.
> I need to get RIDs and some (not all) fields.
>
> My code:
> final OSQLSynchQuery<ODocument> query = new
> OSQLSynchQuery<ODocument>("select @rid as id, attachmentRID, field_1,
> field_2 from Mail");
> for (ODocument record : resultset) {
> ORID rid = ((ODocument)record.field("id")).getIdentity();
> ORID arrachmentRid =
> ((ODocument)record.field("attachment")).getIdentity();
> ...
> }}
>
> 1) What's the proper way to get RID of document, or linked document?
> I suppose that there is a better way, because I don't want to get all
> document, but only RIDs.
>
> 2) Is "select field_1, field_2, ... field_k from..." faster or require
> lower memory than getting all field "select * from... "?
> Some of the fields stores files, and I don't want to download them from
> the database, when it's not necessary. Should I put them into different
> class and use OType.Link?
>
>
>
>
>
--
---
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.