How to obtain NHibernate generated SQL in code at runtime?

前端 未结 3 1430
-上瘾入骨i
-上瘾入骨i 2021-02-04 15:30

I know you can view the NHibernate generated SQL by hooking it up to log4net or piping it out to the console (\"show_sql\" option), but is there any way to obtain the generated

3条回答
  •  花落未央
    2021-02-04 15:33

    Here is an article describing how to get the underlying sql from hql or criteria in Hibernate; I'd imagine porting this to use NHibernate wouldn't be too tricky:

    http://narcanti.keyboardsamurais.de/hibernate-criteria-to-sql-translation.html

提交回复
热议问题