I have an application which uses @Version annotation (on last update timestamp of record) on entity objects to maintain data integrity. The application works well...until there comes an requirement that the application needs to process from multiple countries. To support such requirement, it is needed to log country specific last update time for records.
E.g. current application time is 20:00:00 GMT+4, the request is from UK, which is of timezone GMT+0. For this UK request, we need to log record last update time as 16:00:00 GMT+0.
My question is, how can I do to convert the record last update time based on a specific timezone when I'm using @Version annotation?
My gut feeling is that I can add some conversion logic into lisenters or interceptors before record is flushed. But later I found that the 'version' is maintained in EntityEntry which I can not make any changes.
Can anyone give me some advices or directions to achive that?
|