Postgresql 将LocalDateTime映射到时间戳时发生Hibernate架构验证错误

Postgresql 将LocalDateTime映射到时间戳时发生Hibernate架构验证错误,postgresql,hibernate,spring-boot,spring-data,Postgresql,Hibernate,Spring Boot,Spring Data,我在其中一个实体中添加了一个LocalDateTime列,根据Postgresql,这是在SQL方面映射到TIMESTAMP类型的 但是,在休眠模式下运行Spring Boot应用程序时,由于以下原因,启动失败: Caused by: org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: wrong column type encountered in column [request_date_ti

我在其中一个实体中添加了一个
LocalDateTime
列,根据Postgresql,这是在SQL方面映射到
TIMESTAMP
类型的

但是,在休眠模式下运行Spring Boot应用程序时,由于以下原因,启动失败:

Caused by: org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: wrong column type encountered in column [request_date_time] in table [prepayment]; found [timestamp (Types#TIMESTAMP)], but expecting [bytea (Types#VARBINARY)]

您知道是什么导致了这种行为吗?

此问题可能是由于使用的hibernate版本不支持LocalDateTime、ZonedDateTime和类似的日期类等类型造成的。 为了解决此问题,请尝试添加hibernate-java8依赖项,例如,如果您使用的是gradle:

编译组:“org.hibernate”,名称:“hibernate-java8”,版本: “5.0.12.决赛”


谢谢,解决了。不了解这个“hibernate-java8”项目,很高兴知道。