[ 
https://issues.apache.org/jira/browse/WICKET-4535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13765547#comment-13765547
 ] 

Jesse Long commented on WICKET-4535:
------------------------------------

Hi Betlista,

Originally, I was actually in favor of just standardizing on Strings, but now 
that sort parameters are part of Wicket, I make heavy use of them.

This is how I use it: I have Field<R, T> objects. These objects describe a 
field that is either in a table of type R, or reachable from a R record via 
joins. Each sortable column returns a Field<R, T> as sort property. My 
ISortableDataProvider is a ISortableDataProvider<R, Field<R, T>> and returns R 
records representing a row in the R table. Each column then uses its Field 
object to retrieve and render the data for that column from the R record - the 
type of the data in the column is T. When sorting, the the 
ISortableDataProvider is given the Field object for the column selected, and it 
uses that to generate the correct SQL joins and "ORDER BY" phrase. All my 
paging, filtering and ordering is done by the database. IDataProvider#size() is 
implemented as a "SELECT COUNT(*) ..." query.
                
> Inconsistent use of generics in sorting APIs
> --------------------------------------------
>
>                 Key: WICKET-4535
>                 URL: https://issues.apache.org/jira/browse/WICKET-4535
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 6.0.0-beta1
>            Reporter: Jesse Long
>            Assignee: Martin Grigorov
>            Priority: Minor
>             Fix For: 6.0.0-beta2
>
>         Attachments: myproject.zip, WICKET-4535-1.patch, WICKET-4535-2.patch, 
> WICKET-4535-3.patch, WICKET-4535-4.patch, WICKET-4535-5.patch
>
>
> The Sort APIs use very generics inconsistently. Classes like 
> SortableDataProvider, ISortState, SortParam etc do not all uniformly cater 
> for sort properties other than string. There is a lot of unchecked casting, 
> which is not really required, if generics were used across the board.
> Fixing this will probably cause API changes for 6.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to