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());
請幫我...