sagimann wrote:
what is the code in geneManager.getAll()?
If you have used the "GenericDao" in the books of "Java Persistence and with Hibernate". you can find in the GenericDaoHibernate. The code is as following:
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
public List<T> getAll() {
// return super.getHibernateTemplate().loadAll(this.persistentClass);
List<T> list =super.getHibernateTemplate().loadAll(this.persistentClass);
return list;
}
I have change the code as following:
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
public List<T> getAll() {
// return super.getHibernateTemplate().loadAll(this.persistentClass);
List<T> list =super.getHibernateTemplate().loadAll(this.persistentClass);
DistinctRootEntityResultTransformer transformer = new DistinctRootEntityResultTransformer();
list = transformer.transformList(list);
return list;
}