9
我有這樣NHibernate的映射:命名查詢不知道
<?xml version="1.0" encoding="utf-8"?>
<hibernate-mapping namespace="News.BusinessEntity" assembly="News.BusinessEntity" xmlns="urn:nhibernate-mapping-2.2">
<class name="News" table="News">
<property name="NewsId" type="Int64" column="NewsId" />
<property name="NewsTitle" type="String" column="NewsTitle" />
</class>
<sql-query name="Sp_News">
<return class="News" />
exec Sp_News
</sql-query>
</hibernate-mapping>
當我打電話session.GetNamedQuery("Sp_News")
我得到以下錯誤:
Named query not known: Sp_News.
任何幫助將非常感激。
仍然錯過了這個......謝謝。 –