Java Mailing List Archive

Home » the NHibernate development list »

Re: [NHibernate-development] [nhusers] Re: Subquery in From Clause

James Kovacs


Replies: Find Java Web Hosting

Author LoginPost Reply
Moving this over to the development list...

From my perspective, we have two too many ways to translate a query into SQL already - HQL, Criteria, and NHish SQL. Each have their own codebase to translate a query into SQL, which is bad. Imagine if LINQ translated directly to SQL rather than via Criteria. Every new query feature would require 4 different, divergent implementations. I've said it before, but NHibernate really needs an AST that HQL, Criteria, and LINQ can be translated to. I personally am not familiar enough with compiler theory to make this happen at the moment. I know Fabio spent a lot of time on it, as have Aaron and Oren, and it's a tough problem. I hate to re-open the AST can-of-worms, but I think this issue must be seriously addressed in the NH 2.1 timeframe. (Then again, I've got no voting rights as I'm not a committer. So feel free to ignore my rantings.)

James Kovacs, B.Sc., M.Sc., MCSD, MCT
Microsoft MVP - C# Architecture
403-397-3177 (mobile)

On Tue, Jul 8, 2008 at 5:12 PM, Fabio Maulo <> wrote:
We can continue to add features to CriteriaAPI but, for me, CriteriaAPI is not the way to work allow NH to work with LINQ.
So far NH have 3 way to query entities:
1) HQL
2) Criteria
3) SQL (nh-style)

Each way is parsed and translated to a SQL query.
I don't understand why for LINQ we need an additional step like LINQ->Criteria->SQL.

BTW this is a matter to talk in NH-development-list.
Fabio Maulo

You received this message because you are subscribed to the Google Groups "nhusers" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Sponsored by: Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at
Nhibernate-development mailing list
©2008 - Jax Systems, LLC, U.S.A.