Vivek Pandey
Vivek Pandey

Reputation: 1

How to Join multple table in R2DBC and Spring WebFlux?

//1. Person Entity

class Person {
    private Integer id;
    private String name;
    Private Address addId;
}

//2. Address Entity

class Address {
    private Integer addId;
    private String city;
    Private String state;
    Private String country;
    Private Integer zip;  
}
  1. How to Join multple table in R2DBC and Spring WebFlux?

Upvotes: 0

Views: 364

Answers (1)

AleGallagher
AleGallagher

Reputation: 1893

Currently R2DBC doesnt support annotation such as @OneToMany. So in Address you shuld have a property called userId of type Integer and pertsist Person and then persist Address. And to get them you should first get the Person and find the Address by the userId

Upvotes: 0

Related Questions