Roger, this is not a cartesian product, this is a join.

On 19 Mai, 13:50, Ken Egozi <[email protected]> wrote:
> it creates joins from Foo to everywhere.
> all with an "ON" clause on the join.
>
> SELECT ...
> FROM Table1, Table2    -- (no join)
>                                    -- (no rel restricting WHERE)
>
> this can be done in HQL, and afaik not in Criteria
>
> On Tue, May 19, 2009 at 2:48 PM, Roger Kratz <[email protected]>wrote:
>
>
>
>
>
> > << you can not make cartesian products with criteria.>>
>
> > ?
> > aCartesianProduct = s.CreateCriteria(typeof(Foo))
> > .SetFetchMode("ACollection", FetchMode.Join)
> > .SetFetchMode("BCollection", FetchMode.Join)
> > .SetFetchMode("CCollection", FetchMode.Join)
> > .SetFetchMode("DCollection", FetchMode.Join)
> > .List<Foo>();
>
> > -----Original Message-----
> > From: [email protected] [mailto:[email protected]] On Behalf
> > Of Stefan Steinegger
> > Sent: den 19 maj 2009 13:33
> > To: nhusers
> > Subject: [nhusers] Re: HQL vs Criterion
>
> > Forgot to mention: you can not make cartesian products with criteria.
> > So you can't select columns from different tables if they don't have a
> > mapped reference. This could be important for reports or when using
> > legacy databases.
>
> > On 19 Mai, 13:30, Stefan Steinegger <[email protected]> wrote:
> > > This is not a trivial question at all. I still don't know many
> > > differences between hql and criteria features, and hope you get some
> > > good answers here :-)
>
> > > AFAIK, you don't have these pseudo-properties or functions like
> > > elements and class, and you don't have the index operator [] on lists.
>
> > > I do as much as possible with criteria, because it is more stable then
> > > hql, that is evaluated at runtime. And I have a lot of dynamic
> > > queries, which would be a pain to build up with hql. I really hope
> > > that criteria will be as powerful as hql in the future.
>
> > > On 19 Mai, 12:18, dnagir <[email protected]> wrote:
>
> > > > Hi,
>
> > > > I read somewhere that HQL is a bit more powerful that Criteria API.
>
> > > > Just wondering what we cannot do in HQL and cannot in Criteria API.
> > > > And vice versa.
>
> > > > I'm very new to NH so soryy of this is too obvious question.
> > > > For me it looks like Criteria API is much more powerful (though
> > > > usually requires a bit more code to write) and I like it.
>
> > > > Cheers,
> > > > Dmitriy.
>
> --
> Ken 
> Egozi.http://www.kenegozi.com/bloghttp://www.delver.comhttp://www.musicglue.comhttp://www.castleproject.orghttp://www.gotfriends.co.il
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to