YWI*_*LLS 4 java spring hibernate jpa spring-boot
我想将枚举放入我的实体中。但我在验证时遇到错误,JPA 不会将smallint 设置为枚举。我该如何解决这个问题。
“架构验证:表 [
order] 中的 [status] 列遇到错误的列类型;找到 [int2 (Types#SMALLINT)],但需要 [int4 (Types#INTEGER)]”[在此处输入图像描述]
Sha*_*rup 12
在实体中的 OrderStatus 处添加 columnDefinition="int2"。
@Column(name = "status", columnDefinition = "int2")
OrderStatus status;
Run Code Online (Sandbox Code Playgroud)
在 Spring Boot 2.2.10 上测试
| 归档时间: |
|
| 查看次数: |
2188 次 |
| 最近记录: |