//1。个人实体
class Person {
private Integer id;
private String name;
Private Address addId;
}
//2.地址实体
class Address {
private Integer addId;
private String city;
Private String state;
Private String country;
Private Integer zip;
}
- 如何在R2DBC和Spring WebFlux中连接多个表
当前R2DBC不支持@OneToMany之类的注释。因此,在Address中,必须有一个名为userId的属性,类型为Integer和pertsist-Person,然后持久化Address。要获取它们,您应该首先获取Person并通过userId 找到地址