Re: [nhusers] Re: Subquery in From Clause

"Ayende Rahien" <[email protected]> Wed, 9 Jul 2008 07:08:50 +0300
Newsgroups gmane.comp.windows.dotnet.nhibernate.devel
Message-ID <[email protected]>
There isn't anyone who work with NH that haven't felt this issue.
You can trust me on that, I & Fabio has several discussions on this very
matter, many times.

Ideally, what I would like to see is everything produces an AST, that AST is
sent to the dialect for processing.
This isn't how Hibernate works. Hibernate has an AST (sort of), but it is
directly translated to SQL and than further processed using string parsing.

Having an AST to construct the queries would be a great help.

The reason that Linq is using Criteria is very simple, I wasn't about to
write a LinqQuerySTranslator myself, too big a task, to put it simply

On Wed, Jul 9, 2008 at 6:21 AM, James Kovacs <[email protected]>
wrote:

> 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.com
> [email protected]
> 403-397-3177 (mobile)
>
> On Tue, Jul 8, 2008 at 5:12 PM, Fabio Maulo <[email protected]> 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 [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
>> -~----------~----~----~----~------~----~------~--~---
>>
>>
>
> -------------------------------------------------------------------------
> Sponsored by: SourceForge.net 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 http://www.sourceforge.net/community/cca08
> _______________________________________________
> Nhibernate-development mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/nhibernate-development
>
>

-------------------------------------------------------------------------
Sponsored by: SourceForge.net 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 http://www.sourceforge.net/community/cca08

_______________________________________________
Nhibernate-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nhibernate-development