User Template
@Entity
public class Usuario {
@Expose
@ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE})
private List<AreaAtuacao> areasAtuacao = new FastList<>();
@Expose
@ManyToMany(cascade = {CascadeType.MERGE})
private List<AreaInteresse> areasInteresse = new FastList<>();
@Expose
@OneToOne(cascade = {CascadeType.ALL})
private RegistroResponsavel registroResponsavel;
}
RecordResponseable Template
@Entity
public class RegistroResponsavel {
@Expose
@OneToOne
private Usuario usuarioCriacao;
@Expose
@Temporal(TemporalType.TIMESTAMP)
private Date dataCriacao;
@Expose
@OneToOne
private Usuario usuarioAlteracao;
@Expose
@Temporal(TemporalType.TIMESTAMP)
private Date dataAlteracao;
}
Initializing the list that is within the Responsible Registry > User > areasAction & areasInteresse, using reflection?