1
时,当试图使用可枚举法上一个命名查询,具有无状态会话,如例所示:NotSupportedException异常使用statelesssession
http://www.nhforge.org/doc/nh/en/#batch-statelesssession
我看到一个NotSupportedException异常。堆栈跟踪是如下:
System.NotSupportedException: Specified method is not supported.
at NHibernate.Impl.StatelessSessionImpl.Enumerable(String query, QueryParameters parameters)
at NHibernate.Impl.QueryImpl.Enumerable()
这里是我的代码片段:
<query name="GetLinesByFileId" cacheable="false" read-only="true">
<![CDATA[
from FileLineEntity lineItem where lineItem.FileId=:FileIdInput
]]>
</query>
任:
IStatelessSession statelessSession = sessionFactory.OpenStatelessSession();
var fileLines = statelessSession.GetNamedQuery("GetLinesByFileId")
.SetInt32("FileIdInput", fileId).Enumerable<FileLineEntity>();
命名查询,GetLinesByFileId在HBM如下定义关于我可能在这里失踪的建议?
糟糕的文档?目前的NH Trunk引发了这种异常。只需使用List <>。 – dotjoe 2010-03-23 20:52:14