Another way would be to set up the hibernate.jdbc.time_zone property in Hibernate properties file that is used to construct the session factory. This way we could specify the timezone once for the entire application.

4. Mapping java.sql Types

The java.sql package contains JDBC types that are aligned with the types defined by the SQL standard:

Date corresponds to the DATE SQL type, which is only a date without time

Time corresponds to the TIME SQL type, which is a time of the day specified in hours, minutes and seconds

Timestamp includes information about date and time with precision up to nanoseconds and corresponds to the TIMESTAMP SQL type

As these types are in line with SQL, so their mapping is relatively straight-forward. We can use either the @Basic or the @Column annotation: