java - @OneToOne Relationship on Spring mcv -
i'm tired of trying things , don't have results. user has 1 country , country has many user. problem when make new user. don't have idea problem. i have user bean: @entity @table(name="usuarios") public class usuario { @id @generatedvalue @column(name="id") private integer id; @column(name="nombre", nullable=false) private string nombre; @onetoone @joincolumn(name = "id_pais") private pais pais; /* getters & setters */ .... } the country bean: @entity @table(name="paises") public class pais { @id @generatedvalue(strategy = generationtype.auto) @column(name="id") private integer id; @column(name="nombre") private string nombre; @onetomany(mappedby="pais") private set<usuario> usuarios; /* getters & setters */ } the controller: @controller @requestmapping(value = "/usuario...