Persists @ManyToOne NULL

1

I have a User class and another Contact which have a relationship between them. It's all working correctly the question that I need to only write a contact if there is any filled contact attribute, but if the user only fill the mandatory user attributes and discard the contact fill precise that in the user table is NULL and not generating a Contact only with your ID. Relationship Mapping.

@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinColumn(name = "contact_id")
private Contato contato;
    
asked by anonymous 07.12.2016 / 15:17

0 answers