Thanks for the answer. I should have mentioned that I know that this could be solved using a subquery, but for performance reasons it is sometimes better to use joins.
So could you solve this using joins and not subqueries? On Jun 16, 2:50 pm, cws <[email protected]> wrote: > Hello! > > Using subqueries. > > Seehttp://ayende.com/Blog/archive/2009/05/19/nhibernate-queries-examples... > > look for "force a load for the Posts collection" > > On 15 Juni, 17:45, Tobias Eriksson <[email protected]> > wrote: > > > I have a problem that when creating an alias the sql also returns the > > columns of the alias table. > > > For example > > session.CreateCriteria(typeof (A), "a").CreateAlias("B", "b", > > JoinType.InnerJoin).List(); > > is fetching all column for both A and B. > > > In HQL you can write like this > > select a from A a inner join a.B b > > > Can you do something similar with criteria? > > > There was an earlier discussion about this in this thread, but with no > > solutionhttp://groups.google.com/group/nhusers/browse_thread/thread/cc6c61bc7... > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
