I'm try with hibernate and their POJO, cast to my POJO but have classcastexception How can fix?
private void open() throws Exception {
//private ArrayList<Curso> listaCursos = new ArrayList<Curso>();
try {
sf = NewHibernateUtil.getSessionFactory();
se = sf.openSession();
Query query = se.createQuery("FROM Curso");
System.out.println(listaCursos);
List<Curso> lisst = new ArrayList<Curso>();
for (Object c : query.list()) {
listaCursos.add((Curso) c);
}
} catch (Exception e) {
System.out.println(e);
}
}
And see error log:
java.lang.ClassCastException: modelo.DAO.HIBERNATE.POJO.Curso cannot be cast to POJO.Curso