重複嵌入型我有這個類,我試圖在休眠3.6.x的如何休眠
@Entity @Table(name = "address") @Inheritance()
public abstract class Address {
@Column(name = "address_type") @Enumerated(EnumType.STRING)
private final AddressType addressType;
@Embedded @AttributeOverrides({@AttributeOverride(name = "addressLine", column = @Column(name = "address_line1"))})
private final AddressLine addressLine1;
@Embedded @AttributeOverrides({@AttributeOverride(name = "addressLine", column = @Column(name = "address_line2"))})
private final AddressLine addressLine2;
@Embedded @AttributeOverrides({@AttributeOverride(name = "addressLine", column = @Column(name = "address_line3"))})
private final AddressLine addressLine3;
@Embedded @AttributeOverrides({@AttributeOverride(name = "addressLine", column = @Column(name = "address_line4"))})
private final AddressLine addressLine4;
@Embedded @AttributeOverrides({@AttributeOverride(name = "addressLine", column = @Column(name = "address_line5"))})
private final AddressLine addressLine5;
@Embedded @AttributeOverrides({@AttributeOverride(name = "postcode", column = @Column(name = "postcode"))})
private final Postcode postcode;
}
我得到這個錯誤映射。 (我不完全理解 - 有人可以解釋一下嗎?)
在實體映射重複列: 地址欄:addressLine(應 與插入映射=「假」更新=「假」)
儘管@Embeddable AddressLine只是一個包裝字符串的對象,我想保留該類型,以便稍後添加行爲/規則。
任何暗示會允許這種類型的配置?