Search code examples
oraclehibernatetimestamphqltimestamp-with-timezone

Update records with timestamp where clause with Hibernate HQL


I wrote a query with Hibernate HQL that updates some records with timestamp columns:

where clause:

creationTime >= :creationTimeFrom and creationTime <= :creationTimeTo

set Parameters:

query.setDate("creationTimeFrom", creationTimeFrom);
query.setDate("creationTimeTo", creationTimeTo);

In some cases the result of query don't match with records correctly and some records dont't update,

I guess the problem is about timezone.The oracle server timezone is set to UTC. but the timezone of client is different.


Solution

  • I use deprecated class in my HQL code. I fix that and problem was resolved.