【问题标题】:Exception when having Object type field in JPA @Entity: Caused by: org.hibernate.MappingException: property mapping has wrong number of columns在 JPA @Entity 中有对象类型字段时出现异常:原因:org.hibernate.MappingException:属性映射的列数错误
【发布时间】:2022-10-06 02:04:43
【问题描述】:

我有一个具有如下字段的 JPA 对象:

@Column(name = \"check_close\")
private Object check_close;

和我得到的开始

Caused by: org.hibernate.MappingException: property mapping has wrong number of columns: rf.dom.billing.model.billing.TransactionRegistry.check_close type: object

为什么错误与错误的列数有关?它不应该指向使用的错误类型吗?

    标签: java hibernate


    【解决方案1】:

    将类型更改为像String 这样更有价值的类型使得这个错误永远不会被抛出,但是,为什么错误消息与Object 类型作为JPA 实体字段的无用无关,这对我来说仍然很有趣。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-04-11
      • 1970-01-01
      • 2011-07-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-19
      相关资源
      最近更新 更多