【发布时间】:2010-04-16 13:54:55
【问题描述】:
我已经映射了 .hmb.xml 中的实体,并为类中的所有实体定义了属性。
我有一些基本的成就,并使用下面的代码获得了所有记录。
public List<DevelopmentStep> getDevelopmentSteps()
{
List<DevelopmentStep> developmentStep;
developmentStep = Repository.FindAll<DevelopmentStep>(new OrderBy("Id", Order.Asc));
return developmentStep;
}
我从网上查到我们可以写HQL,现在的问题是如何像这样执行这个HQL..
string hql = "From DevelopmentSteps d inner join table2 t2 d.id=t2.Id where d.id=IDValue";
我需要添加哪些额外的类或其他东西来执行这种 HQL?
请帮帮我----谢谢
【问题讨论】:
-
获得会话是 NHibernate 的基础,没有会话你什么都做不了。看一下手册的第一章:“快速入门”,例如《玩猫》:nhforge.org/doc/nh/en/index.html#quickstart-playingwithcats
标签: asp.net nhibernate fluent-nhibernate hql