Call a Stored Procedure with a DetachedCriteria?

感情迁移 提交于 2020-01-15 12:43:20

问题


Is it possible to construct a DetachedCriteria in nHibernate which queries a stored procedure? How would I accomplish such a task?


回答1:


I have not done it but you can use some alternatives:

  • Named Queries and SQL Queries
  • Map to a view instead.
  • Map to a TableValued Function (yes this I know this isn't great but it's got me out of a few jams)



回答2:


No, it's not possible.

You have to use a SQLQuery to call a stored procedure.



来源:https://stackoverflow.com/questions/6611124/call-a-stored-procedure-with-a-detachedcriteria

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!