How do I map with Hibernate @OneToOne
and save only if the information has data in the related table?
Example:
public class ObservacaoPessoa {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Integer id;
public Integer PessoaId;
public String TextoObservacao;
}
public class Pessoas {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Integer id;
public String Nome;
public ObservacaoPessoa Obs;
}
I want to make Pessoas.Save
but only write Obs
if some value has been entered.