1
我想从两个不同的表中使用连接两列。我得到重复值。我试过.SetResultTransformer(Transformers.DistinctRootEntity
)和.SetResultTransformer(new DistinctRootEntityResultTransformer())
,但没有任何帮助。在探查我得到的查询,如:独特加入Nhibernate
SELECT job1_.DeptName as y0_, this_.refDeptId as y1_ FROM [Emp] this_ inner join [Dept] job1_ on this_.refDeptId=job1_.DeptId
我想查询不同values.like:SELECT distinct job1_.DeptName as y0_, this_.refDeptId as y1_ FROM [Emp] this_ inner join [Dept] job1_ on this_.refDeptId=job1_.DeptId
我在NHibernate的查询是:
IList ListOfElements= (session
.CreateCriteria(typeof(EmpModel))
.CreateCriteria("objEmpDeptId1", "job",NHibernate.SqlCommand.JoinType.InnerJoin)
.SetProjection(a_ProjectionList).List());
请帮我...