NHibernate:检索要作为字符串执行的SQL [英] NHibernate: Retrieve SQL to be executed as a string

查看:84
本文介绍了NHibernate:检索要作为字符串执行的SQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以从ICriteria中检索包含NHibernate计划执行的SQL的字符串? 我知道可以接收到跟踪,但是我想知道是否可以调用一种生成SQL的方法(例如,因此您不必实际刷新到数据库).

From an ICriteria, is it possible to retrieve a string containing the SQL that NHibernate is planning on executing? I know that is possible to receive a trace, but I was wondering if there is a method that can be called that generates the SQL (for example, so you don't have to actually flush to the database).

推荐答案

NHibernate Profiler非常适合我们.在nhprof.com/上有一个试用版. NHProf会将自己附加在从您的计算机到数据库的连接上,并捕获传递的所有SQL,以及结果的数量和在获取处理上花费的时间. NHProf还为您提供了各种建议,可以提高性能.

NHibernate Profiler works great for us. there's a trial available at nhprof.com/ edit: NHProf attaches itself on the connection from your machine to the database and captures any SQL passing by, with the number of results and the time spent on fetching processing. NHProf also gives you all sorts of advice that will improve performance.

这篇关于NHibernate:检索要作为字符串执行的SQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆