I believe QueryOver is just a type safe layer on top of Criteria. http://nhforge.org/blogs/nhibernate/archive/2009/12/17/queryover-in-nh-3-0.aspx
On Tue, Jan 25, 2011 at 10:12 AM, Daniel Lidström <[email protected]> wrote: > On 14 Jan, 01:27, Vikram Nayak <[email protected]> wrote: >> Are there any best practices / scenarios when one API is better than >> the other? > > Here's what I've learnt: > > * Use CriteriaQueries when you are letting user build queries > dynamically. Actually you have other options now, with Linq to > NHibernate you can do this with Specification Design Pattern. > * Use named queries for best performance. They will be initialized by > NHibernate. You can use them for frequent querying. You will use > Hibernate Query Language for this. > * Use Linq to NHibernate if you prefer type-safe query code. You can > also use L2Nh to implement the Specification Design Pattern. > > I'm not sure when to use QueryOver. I keep forgetting which means it > is not that interesting to me :-) > Good luck! > > P.S. For more about Specifications you can see this post: > http://huyrua.wordpress.com/2010/08/25/specification-pattern-in-entity-framework-4-revisited/ > > Daniel > > -- > You received this message because you are subscribed to the Google Groups > "nhusers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > > -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
