【发布时间】:2019-06-03 03:04:28
【问题描述】:
我有一个实体,其 ZonedDateTime 归档并带有 @CreationTimestamp 注释:
@CreationTimestamp
@Column(name = "created")
private ZonedDateTime created;
运行时:
mvn liquibase:diff
我收到以下错误:
[ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:3.5.5:diff (default-cli) on project myproject: Error setting up or running Liquibase: org.hibernate.HibernateException: Unsupported property type for generator annotation @CreationTimestamp -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
这是我在 pom.xml 中的 hibernate 和 liquibase 依赖项:
<!-- The hibernate version should match the one managed by
https://mvnrepository.com/artifact/io.github.jhipster/jhipster-dependencies/${jhipster-dependencies.version} -->
<hibernate.version>5.2.12.Final</hibernate.version>
<!-- The liquibase version should match the one managed by
https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies/${spring-boot.version} -->
<liquibase.version>3.5.5</liquibase.version>
<liquibase-hibernate5.version>3.6</liquibase-hibernate5.version>
@CreationTimeStamp 用于 ZonedDateTime 字段的正确版本是什么?
【问题讨论】:
-
我发现的唯一解决方法是在运行 liquibase:diff 命令之前删除注释,然后将其放回原处。仍然不支持 ZonedDateTime,即使使用 hibernate 5.4.0.final ?
标签: java hibernate maven jhipster liquibase