How to initialize hibernate with reflection

1
Hello, I need to initialize a list using Hibernate.initialize (list) within a Generic DAO.

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?

    
asked by anonymous 04.08.2016 / 14:50

0 answers