• Post Reply Bookmark Topic Watch Topic
  • New Topic

Modifying Hibernate object after fetching data from Sql

 
Nilesh Vidyarthi
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am selecting a timezone on my site and i want that the hibernate should change the time fetched from a particular table of the database to this selected timezone every time when a flag is switched on for TimeZone .
So how can i modify the fetched object with my time zone before parsing it further
 
Roel De Nijs
Sheriff
Posts: 10763
148
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nilesh Vidyarthi,

First of all, a warm welcome to CodeRanch!

Nilesh Vidyarthi wrote:So how can i modify the fetched object with my time zone before parsing it further

Did you already consider the JPA lifecycle events, in particular the PostLoad one?

Hope it helps!
Kind regards,
Roel
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!