Any update on this issue? Still not working for me on NH 3.3.3.4001 ! On Tuesday, January 18, 2011 8:55:08 AM UTC-8, [email protected] wrote: > > Try the trunk version in svn. It appears support this now. > > On Jan 18, 11:18 am, santiagokci <[email protected]> wrote: > > same issue too... > > > > On 10 ene, 12:01, James Crowley <[email protected]> wrote: > > > > > I've hit the same issue - did you find a solution? If you find a way > while > > > still using LINQ (rather than having to bring in direct NH > dependencies on > > > HQL/QueryOver) please do post back here! > > > > > Not sure if there's a JIRA bug for this stuff, but would seem like a > common > > > requirement? > > > > > Thanks! > > > > > James > > > > > On 6 January 2011 13:02, Variant <[email protected]> wrote: > > > > > > I am trying to perform a group by Linq query with NH3. Knowing the > > > > underling SQL difficulties I know it's not possible but Ideally I > > > > would like to do the group by an entity and have it retrieved in > it's > > > > entirety. Something like: > > > > > > var list = from proposals in Session.Query<Proposal>() > > > > group proposals by proposals.Job > > > > into jobGrouping > > > > select new { > > > > Job = jobGrouping.Key, > > > > TotalProposals = jobGrouping.Count() > > > > }; > > > > This generates an illegal SQL query as it tries to retrieve the > whole > > > > Job entity but group only by its Id. > > > > > > I have tried grouping by a composite field: > > > > > > var list = from proposals in Session.Query<Proposal>() > > > > group proposals by new { proposals.Job.Name, > > > > proposals.Job.Status} > > > > into jobGrouping > > > > select new { > > > > Job = jobGrouping.Key.Name, > > > > Status = jobGrouping.Key.Status, > > > > TotalProposals = jobGrouping.Count() > > > > }; > > > > But whenever I try this I get an Exception when NHibernate tryes to > > > > build an expression tree: > > > > > > An item with the same key has already been added. > > > > > > Anyone knows if there is any way to accomplish that with NHibernate > ? > > > > > > Thanks, Ilan > > > > > > -- > > > > You received this message because you are subscribed to the Google > Groups > > > > "nhusers" group. > > > > To post to this group, send email to > > > > [email protected]<javascript:>. > > > > > To unsubscribe from this group, send email to > > > > [email protected] <javascript:>< > nhusers%[email protected] <javascript:>> > > > > . > > > > For more options, visit this group at > > > >http://groups.google.com/group/nhusers?hl=en.
-- You received this message because you are subscribed to the Google Groups "nhusers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/nhusers. For more options, visit https://groups.google.com/groups/opt_out.
