In spring boot starter data rest 2.7.4 the following problem arises when defining a relationship in this way.
@ManyToOne
@JoinColumn(name = "country_id", referencedColumnName = "id")
private Country country;
public Country getCountry() {
return country;
}
public void setCountry(Country country) {
this.country = country;
}
All time return a relation user:null
The only solution I have found is to modify it as follows.
@ManyToOne
@JoinColumn(name = "country_id", referencedColumnName = "id")
private Country countries;
public Country getCountry() {
return countries;
}
public void setCountry(Country country) {
this.countries = country;
}
by changing the name of the property and leaving the setter and getter different if the relationship resolves.
I will appreciate any help or information regarding this.