TypedLists: Grouping and Sorting

Posts   
 
    
jmeckley
User
Posts: 403
Joined: 05-Jul-2006
# Posted on: 08-Feb-2007 15:47:30   

I know this question has been asked before. Why do Typed lists not contain default sorts and groupings methods?

I would think creating these methods would be simple enough in the typed list designer/code generator the same way the relationpredicatebucket is generated.

I can select which aggregate functions to apply to column in the typedist. Why couldn't a grouping object also be defined for the non aggregated columns. As it stands now I must define this outside of my typed list.

I would assume sorting could be done similarly. when selecting which fields to display for the typedlist and what aggregation to apply you could also set the sort order/rank ASC/DESC and 1,2,3,4,5... much like MS SQL EM View Designer.

Predicates will have to be added via the relationBucket or defined outside the typedlist as this usually envolves user input which cannot be known at design time.

then when calling adapter.FetchTypedList(myTypedList) a default configuration is already set. If I need to alter any of the defaults I could call the public function to get that object (grouping, fields, sort, relation). modify it and then call the associated overload method.

could I do this myself by adusting the templates for typedlists? I don't think it would work since the interfaces and base objects do not define these methods. These are defined in the ORMSupport assemblies and I do not want to adjust them.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 08-Feb-2007 16:06:36   

jmeckley wrote:

I know this question has been asked before. Why do Typed lists not contain default sorts and groupings methods?

I would think creating these methods would be simple enough in the typed list designer/code generator the same way the relationpredicatebucket is generated.

I can select which aggregate functions to apply to column in the typedist. Why couldn't a grouping object also be defined for the non aggregated columns. As it stands now I must define this outside of my typed list.

I would assume sorting could be done similarly. when selecting which fields to display for the typedlist and what aggregation to apply you could also set the sort order/rank ASC/DESC and 1,2,3,4,5... much like MS SQL EM View Designer.

Predicates will have to be added via the relationBucket or defined outside the typedlist as this usually envolves user input which cannot be known at design time.

then when calling adapter.FetchTypedList(myTypedList) a default configuration is already set. If I need to alter any of the defaults I could call the public function to get that object (grouping, fields, sort, relation). modify it and then call the associated overload method.

could I do this myself by adusting the templates for typedlists? I don't think it would work since the interfaces and base objects do not define these methods. These are defined in the ORMSupport assemblies and I do not want to adjust them.

The sort isn't specified as it's common not to do that in a view as well: it's left to the user of the view to sort the data as required. The group by is indeed a different matter if you specify aggregated columns.

A default sort could be added as well. It's a nice idea. I'll see if I can cram this into v2.1.

Frans Bouma | Lead developer LLBLGen Pro