如何在Nhibernate中创建表之间的连接 [英] How do I create join between tables in Nhibernate
本文介绍了如何在Nhibernate中创建表之间的连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试基于列创建表之间的连接。
假设Api和Data是两个表,Data table有一个列'Id',表Api.Id的外来约束
请告诉我如何在Nhibernate中为SQL编写查询: -
选择*从Api加入状态Api.Id == Data.Id
其中Api.RowStatus == 1和Data.PubType == 2
解决方案
尝试
如何在NHibernate中进行内部加入 [ ^ ]
NHibernate - Critieria查询加入 [ ^ ]
I am trying to create a join between table based on a column.
Suppose Api and Data are two tables, Data table has a column 'Id' with foreign constraint to table Api.Id
Please tell me how to write query in Nhibernate for below SQL :-
select * from Api join Status on Api.Id == Data.Id
where Api.RowStatus == 1 and Data.PubType == 2
解决方案
Try
How to do Inner Join in NHibernate[^]
NHibernate - Critieria Query Joins[^]
这篇关于如何在Nhibernate中创建表之间的连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文