现在我的两个库关联是通过属性关联,而不是对象。如下
public class UserHouseRent {
@Id
@Column(name = "id", nullable = false, length = 20)
private BigInteger id;
@Column(name = "pk_house", nullable = false, length = 36)
private String pkHouse;
}
public class HouseRent {
@Id
@Column(name = "id", nullable = false, length = 20)
private BigInteger id;
@Column(name = "pk_house", nullable = false, length = 36)
private String pkHouse;
}
关联的列是pkHouse。没有采用主外键方式一对多关联。请问这种方式下,如何解决N+1冗余SQL问题
换句话来说,两表没有添加关联