【问题标题】:CheckNullability of PrimaryKeyJoinColumn检查 PrimaryKeyJoinColumn 的可空性
【发布时间】:2011-05-17 18:52:42
【问题描述】:

我有一个具有 ObjectX 属性的实体类:

@OneToOne(fetch = FetchType.LAZY)
@PrimaryKeyJoinColumn
public ClassOfObjectX getObjectX() {
return this.ObjectX;
}

这个 ObjectX 不能为空?

在 Hibernate 3.4 中,我可以毫无问题地将这个对象保存在存储库中 但现在在 Hibernate 3.6 中它抛出了这个异常:

org.hibernate.PropertyValueException: not-null property references a null or transient value:

【问题讨论】:

    标签: hibernate join null transient one-to-one


    【解决方案1】:

    你可以在设置属性时检查它是否有效 hibernate.check_nullability 为假?

    【讨论】:

      猜你喜欢
      • 2021-05-13
      • 1970-01-01
      • 2021-11-07
      • 2012-12-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-24
      • 1970-01-01
      相关资源
      最近更新 更多