Yes. I just meant that you can produce cartesian products in criteria as well (my example).
From: [email protected] [mailto:[email protected]] On Behalf Of Ken Egozi Sent: den 19 maj 2009 13:50 To: [email protected] Subject: [nhusers] Re: HQL vs Criterion 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]<mailto:[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]> [mailto:[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]<mailto:[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/blog http://www.delver.com http://www.musicglue.com http://www.castleproject.org http://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 -~----------~----~----~----~------~----~------~--~---
