views:

26

answers:

1

I know how to enable debugging so all queries that get run appear in my console. Is there any way to simply output the generated query without executing it?

+1  A: 

Nope, you can't. NHibernate wouldn't know what to return as a result of the query method if it didn't execute the actual SQL against an actual database. For example:

Client[] = Client.FindAll();

The method has to return some collection of clients, and if ActiveRecord/NHibernate didn't send the SQL to the database it wouldn't know what to return.

Mauricio Scheffer
Thank you. I also found http://stackoverflow.com/questions/1882583/hibernate-and-dry-running-hql-queries-statically which is related.
Mike

related questions