Compare items in an existing list based on property in HQL
Let say I have two class:
public class A{
public virtual int Id; ...开发者_运维问答 ...
}
public class B{
public virtual int Id; public virtual A a; ...
}
I have a list of A. List existingObjectAList;
and also I want to search object B's which contains existingObjectAList.
How can I do this In C# with HQL.
var bs = session.CreateQuery("from B where A in (:list)"
.SetParameterList("list", existingObjectAList)
.List<B>();
精彩评论