A Projections.GroupOnlyProperty method added to allow creation of GROUPs without adding the property to the SELECT clause

Description

The Projections.GroupProperty factory method creates a PropertyProjection with the "IsGroup" flag set to true. But unfortunately, this projection automatically inserts the property in the SELECT clause also. I didn't found any way to add the property just to the GROUP BY clause, so I made a patch with some minor changes to the Projections, PropertyProjection and ProjectionList classes.
Please take a look, and if you find it is a required function, add it to the new NH version. (Personally I need to give my "Query Builder" user the chance to create a GROUP BY clause without necessarily add that property to the SELECT clause, so I find it very important)

Best regards,
Bogdan

Environment

None

Attachments

1

Activity

Show:

Tuna Toksoz 
November 12, 2008 at 6:05 AM

Duplicate of NH-1426. Closing.

PertaB 
October 13, 2008 at 11:19 PM

Ok, anyways, as my time will let me, I will also try to make another patch using the other solution you suggested.
Thanks.

Tuna Toksoz 
October 13, 2008 at 11:14 PM

Please keep in mind that It may take some time for me to start working on this. I'll try to get into this ASAP but no promises.

PertaB 
October 13, 2008 at 11:11 PM

"Well, this way didn't sound natural to me. you are adding projection to the projection list but you are faking it." -> Yes, indeed, it isn't too natural but until a better choice is available I'm using it on my project.

"Maybe we could add a GroupBy thing to Criteria and do the reverse? If property is grouponly it won't be added to projection list, if not it will. " -> yes, could be a better idea.

Thanks for assigning this issue,

Best regards,
Bogdan

Tuna Toksoz 
October 13, 2008 at 9:36 AM

Well, this way didn't sound natural to me. you are adding projection to the projection list but you are faking it. Maybe we could add a GroupBy thing to Criteria and do the reverse? If property is grouponly it won't be added to projection list, if not it will.

What do you think?

Duplicate

Details

Assignee

Reporter

Components

Affects versions

Priority

Who's Looking?

Open Who's Looking?
Created September 19, 2008 at 6:56 AM
Updated September 4, 2015 at 2:29 PM
Resolved September 4, 2015 at 2:29 PM
Who's Looking?