can hibernate convert date field into given timezo

2019-07-26 17:37发布

问题:

We are working on a feature to store 'date' in a given timezone, irrespective of the current JVM timezone.

It is important for me to store it in a given timezone, because lot of other existing systems needs it that way.

I know we can set the current timezone of the JVM and everything will work. But we have requests coming from different timezones concurrently, which will break with above approach.

Can we do something similar to the timezone setting of JVM @ transaction or session level in Hibernate to handle this situation?

After googling for a while, I could not see related problem. Need some help! direction or work around?