考虑以下3个主表:
现在考虑以下联接表,其列名称引用相应的主表/联接表:
我只是不知道如何用Hibernate在Spring Boot(Java)中表示这一点。
为简单起见,我在上面粘贴了选项2的代码
df.query("value1 != value2").dropna()
Out[3035]:
col1 col2 value1 value2
2 type_5 type_6 apples oranges
public class Tender {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "id")
private Integer id;
//Omitted other attributes for brevity
@JsonIgnore
@ManyToMany(fetch = FetchType.EAGER, cascade = CascadeType.MERGE)
@JoinTable(name = "tender_commodity", joinColumns = @JoinColumn(name = "tender", referencedColumnName = "id"), inverseJoinColumns = @JoinColumn(name = "commodity", referencedColumnName = "id"))
private Set<Commodity> commodity;
}
public class Commodity {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "id")
private Integer id;
//Omitted other attributes for brevity
}
public class TenderCommodity {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "id")
private Integer id;
@ManyToOne(optional = false, fetch = FetchType.EAGER)
@JoinColumn(name = "commodity")
private Commodity commodity;
@ManyToOne(optional = false, fetch = FetchType.EAGER, cascade = CascadeType.ALL)
@JoinColumn(name = "tender")
private Tender tender;
}
我在上面的实现中遇到了各种各样的错误消息,范围从: