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).
A:
It's not directly exposed anywhere. Keep in mind the generated SQL is dialect, driver and batcher dependant, so generation of the final SQL occurs late in the pipeline.
Diego Mijelshon
2010-08-25 12:45:03