[英]How to Join multple table in R2DBC and Spring WebFlux?
//1. //1. Person Entity
个人实体
class Person {
private Integer id;
private String name;
Private Address addId;
}
//2. //2。 Address Entity
地址实体
class Address {
private Integer addId;
private String city;
Private String state;
Private String country;
Private Integer zip;
}
Currently R2DBC doesnt support annotation such as @OneToMany.目前 R2DBC 不支持 @OneToMany 等注解。 So in Address you shuld have a property called userId of type Integer and pertsist Person and then persist Address.
因此,在 Address 中,您应该有一个名为 userId 的 Integer 类型的属性,并坚持 Person,然后坚持 Address。 And to get them you should first get the Person and find the Address by the userId
要获取它们,您应该首先获取 Person 并通过 userId 找到地址
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.