您需要设置属性“jadira.usertype.databaseZone”。
将其设置为显式时区,或“jvm”以使用 JVM 的默认时区。
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
p:jpaProperties-ref="jpaProps" />
<util:properties id="jpaProps">
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.format_sql">true</prop>
<prop key="jadira.usertype.autoRegisterUserTypes">true</prop>
<!-- defaults to storing UTC dates in DB otherwise -->
<prop key="jadira.usertype.databaseZone">jvm</prop>
<prop key="jadira.usertype.javaZone">jvm</prop>
</util:properties>