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
--
James Kovacs, B.Sc., M.Sc., MCSD, MCT
Microsoft MVP - C# Architecture
http://www.jameskovacs.comjkovacs@post.harvard.edu
403-397-3177 (mobile)
On Tue, Jul 8, 2008 at 5:12 PM, Fabio Maulo <
fabiomaulo@gmail.com> 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