Hibernate关系映射
2021-07-12 20:05
标签:false ber nat value reference ignore 一对多 class onetomany 1.一对多,多字段 2.一对一,多字段 Hibernate关系映射 标签:false ber nat value reference ignore 一对多 class onetomany 原文地址:http://www.cnblogs.com/margin-gu/p/7081017.html@JsonIgnore
@OneToMany(mappedBy = "abc",cascade={CascadeType.PERSIST},fetch=FetchType.LAZY)
private Set
@ManyToOne(optional = true,fetch = FetchType.LAZY)
@JoinColumnsOrFormulas(value={
@JoinColumnOrFormula(column=@JoinColumn( name = "id" ,referencedColumnName = "id" ,insertable =false, updatable = false)),
@JoinColumnOrFormula(column=@JoinColumn( name = "tid" ,referencedColumnName = "tid" ,insertable =false, updatable = false))})
private ABC abc;
@JsonIgnore
@OneToOne(optional = true,fetch = FetchType.LAZY)
@JoinColumns(value={
@JoinColumn(name="id",referencedColumnName="id",insertable =false, updatable = false),
@JoinColumn(name="uid",referencedColumnName="uid",insertable =false, updatable = false)})
private Entity entity;