我对 mapstruct 中的 @ManyToOne 映射有疑问。我有两张桌子
第一个:
@Entity
@Table(name = "members", schema = vsm)
public class MemberEntity{
@Column(name = "id", nullable = false)
protected Long id;
@ManyToOne(optional = false)
@JoinColumn(name = "case_id", nullable = false)
private CaseEntity case;
}
Run Code Online (Sandbox Code Playgroud)
第二个:
@Entity
@Table(name = "cases", schema = vsm)
public class CaseEntity {
@Column(name = "id", nullable = false)
protected Long id;
@Column(name = "description", nullable = false)
protected String description;
}
Run Code Online (Sandbox Code Playgroud)
我有一个像这样的案例:
public class CasesDto{
protected Long id;
protected String description;
private …
Run Code Online (Sandbox Code Playgroud)