openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pinaki Poddar <>
Subject Re: Audit log with OpenJPA
Date Wed, 27 Jul 2011 02:39:37 GMT
Hi Bengt,
  I find that accessing the old state is possible using internal mechanics
-- but could not find a way to do it from the current API unless I expose
some internals. After a bit of deliberation, I am suggesting that we add the
following method to SaveFieldManager.

     * Gets the old values for the given list of fields provided they are
     * @param fields a list of field names. null implies all dirty fields.
     * @return a map of old values for each given field, if they are dirty.
     * The map values are a pair of objects in an array -- the 0-th element 
     * is the old value and the 1-st element is the current value.
    public Map&lt;String, Object[]&gt; getOldValues(String...fields)

I have tested your supplied classes with the classes you supplied.

If you do not mind being in the bleeding edge, i.e. if you can consume
OpenJPA nightly builds, then I will commit the changes.


Pinaki Poddar
Chair, Apache OpenJPA Project
View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message