Hi,
you have two ways: bind the @RID in a field of your POJO or retrieve it by
database.
1) Bound it in a field
*public class MyPojo{ *
*@Id*
*private Object orientId;....*
*public Object getOrientId(){*
*return orientId;*
*}public void setOrientId(Object iOrientId){ orientId = iOrientId;}*
*}*
in this way the Orient RID will be bound to "orientId" field (the name is
arbitrary). @Id is the JPA annotation but you can also use the Orient @OId
annotation.
2) use the database to retrieve it
you can use the API ODatabaseObjectTx.getIdentity(Object) to get the Record
Id.
Bye
Luca
2014-02-12 21:34 GMT+01:00 Dmitry <[email protected]>:
>
> Hi!
>
> I save my POJO to OObjectDatabaseTx with db.save(entity);
>
> How I can get/find the appropriate id (@rid) for this object?
>
> Thanks.
>
> --
>
> ---
> 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.
>
--
Luca Molino
--
---
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.