Hi Marc,
You should
call com.orientechnologies.orient.core.db.ODatabaseComplex#getDatabaseOwner
to get ObjectDB instance after that you can fetch Pojo.

About dirty fields,  index tracker (which also is registered as a hook)
clears them so your hook should be first ,
use com.orientechnologies.orient.core.hook.ORecordHook.HOOK_POSITION#FIRST
as position value.


On Sun, Jan 12, 2014 at 7:20 PM, Marc Haisenko <[email protected]> wrote:

> Hi folks,
>
> I'm wondering what's the best way to get a POJO in an ORecordHook's
> onTrigger.
>
> To update my GUI and models, I've got various hooks registered. Sometimes
> I need to access the POJO to make decisions on how to update the GUI/model.
> But if I do the equivalent of "myDB.load(oRecord.getIdentity());" I
> sometimes get the old version of the record, as the new one doesn't seem to
> be committed yet.
>
> It looks like all the necessary data is already present in the ORecord
> (ODocument) object, so can I somehow create a POJO instance with such an
> ORecord?
>
> Also, is there a way to query which fields will be/have been updated?
> "((ODocument)oRecord).getDirtyFields()" doesn't seem to do that.
>
> 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.
>



-- 
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