我想知道
通过 Hibertate
(Hibertate )能够做到这一点吗?我知道触发器很容易。
这是我的方法;
@Entity
@Table(name = "A")
@SecondaryTable(name = "B")
public class A {
@Id
@Column(name = "id")
private int id;
// This property in both
@AttributeOverrides({
@AttributeOverride(column = @Column(name = "something", table = "B"), name = "something"),
@AttributeOverride(column = @Column(name = "something", nullable = true), name = "something")})
private int something;
}
请注意
赛达诺