Best practices for querying with NHibernate

nhibernateorm

I've come back to using NHibernate after using other technologies (CSLA and Subsonic) for a couple of years, and I'm finding the querying a bit frustrating, especially when compared to Subsonic. I was wondering what other approaches people are using?

The Hibernate Query Language doesn't feel right to me, seems too much like writing SQL, which to my mind is one of the reason to use an ORM tools so I don't have to, furthermore it's all in XML, which means it's poor for refactoring, and errors will only be discovered at runtime?

Criteria Queries, don't seem fluid enough.

I've read that Ayende's NHibernate Query Generator, is a useful tool, is this what people are using? What else is out there?

EDIT: Worth a read
http://www.ayende.com/Blog/archive/2007/03/17/Implementing-Linq-for-NHibernate-A-How-To-Guide–Part.aspx

Best Answer

The thing with LINQ for NHibernate is still in beta; I'm looking forward to NHibernate 2.1, where they say it will finally make the cut.

I made a presentation on LINQ for NHibernate around a month ago, you might find it useful. I blogged about it here, including slides and code:

LINQ for NHibernate: O/R Mapping in Visual Studio 2008 Slides and Code