Hi,
I found the solution to the problem.
Change the code from:
Code:
fabricantes = (IList) NHibernateUtil.getSession()
.CreateCriteria(typeof(Fabricante))
.AddOrder(NHibernate.Expression.Order.Asc("NomeFabricante"))
.SetFetchMode("Revendas", NHibernate.FetchMode.Eager)
.List();
To this code appending:
Quote:
.SetResultTransformer(NHibernate.CriteriaUtil.DistinctRootEntity)
Code:
fabricantes = (IList) NHibernateUtil.getSession()
.CreateCriteria(typeof(Fabricante))
.AddOrder(NHibernate.Expression.Order.Asc("NomeFabricante"))
.SetFetchMode("Revendas", NHibernate.FetchMode.Eager)
.SetResultTransformer(NHibernate.CriteriaUtil.DistinctRootEntity)
.List();
I found the solution in this topic:
http://forum.hibernate.org/viewtopic.php?t=952693
Thanks,
Cleiton