Hello, Do you think this behavior will be changed in NH3 RTM ? Actually, the provider always generates an inner join (I think also it's a good idea to generate an outer Join).
Cordially. On 18 juil, 14:39, Fabio Maulo <fabioma...@gmail.com> wrote: > About this matter we can talk a lot... > Do you remember that times when to write hardcoded SQL everywhere was a bad > choice ? > > Well... now I'm seeing LINQ-to-persistence wrote everywhere in the > application and people continue saying me that is not the same. > > P.S. I have some white hair, a wife, a daughter and a dog and I know > something about the immortality of the medusa. > > > > > > On Sun, Jul 18, 2010 at 9:20 AM, Frans Bouma <fr...@sd.nl> wrote: > > > The main difference between LINQ and HQL is that HQL was designed to be > > > translated to SQL. > > > We have to design our systems to use the best query-tool for a specific > > > task. > > > I'm working with NH3 in production with more than one project using HQL, > > > QueryOver, LINQ, H-SQL, SQL and even Criteria (variable no strongly typed > > > queries). > > > We don't have to limit our possibilities (EQO is with me ;) ) > > > It's also not wise to limit a query api to just Linq, as you can't > > express all queries in linq, for example a simple join with an ON clause > > using an expression other than an equality operator is not possible: you've > > to revert to cross joins with a where clause, which not always can be > > optimized properly by the RDBMS compared to an ansi join. This is IMHO als > > one of the more cumbersome aspects of MS' O/R mappers and one which is > > often > > ignored by bookwriters/speakers, I wonder why ;) > > > FB > > > > -- > > > Fabio Maulo > > > > El 18/07/2010, a las 07:48, Richard Birkby <rbir...@gmail.com> escribió: > > > > > On 18 Jul 2010, at 11:34, Frans Bouma <fr...@sd.nl> wrote: > > > > >> One could argue to always do an FKSide LEFT JOIN PKside, even if the > > > >> fk side has no nullable fk fields, though it might be an RDBMS can > > > >> optimize the INNER JOIN better than the LEFT JOIN. > > > > > Yes - SQL compact will not rearrange tables in a queryplan when it has > > > > an outer join. Ironically, i've used this fact to force a more optimal > > > > queryplan by using an outer join in HQL. > > > > > Richard > > -- > Fabio Maulo