Hello all...
I have the follow HQL:
Code:
IList _list = session.Find("select distinct geral.Estate from TowerGeral geral");
So, I got all distincts estates from my Table!
I´m trying to do the same thing with ICriteria... I done that:
Code:
ICriteria _crit = session.CreateCriteria(typeof(TowerGeral));
_crit.Add(Expression.Eq("Estate", __estate));
_crit.SetResultTransformer(NHibernate.CriteriaUtil.DistinctRootEntity);
I think with SetResultTransformer I get distinct entitys... But I need distinct Estates.
Example:
Table:
1 - X - 30500 - 2006
2 - Y - 43000 - 2004
3 - W - 2300 - 2002
4 - X - 299 - 2003
5 - W - 876 - 1999
I´d like to return only X,Y,W once like in previous HQL... Help?
[]´s