Quantcast
Channel: Spring Community Forums - Data
Viewing all articles
Browse latest Browse all 297

JPA: Pagination sort on parameterized property ?

$
0
0
I've just discovered the awesome out-of-the-box working feature of pagination ! Well done ! :D

It works perfectly for elementary properties.

My question however is whether the api also allows for sorting on something like an indexed property ?

-----

My use case is to show a table in a web application. The first columns are typically id and name. Which are properties matching 1/1 on a database column.

The remainder of the columns however are values out of a map with String keys: Ie Object getValue(String key). Depending on the use case certain columns are shown and some hidden. I'd really like to sort on those columns too but there's nothing like a value property.

So I was wondering if the Spring Data API provides for such a case. Looking to the code I would say not. But then again I hope I missed it. :)

If it isn't, is there a usual workaround for this ? Unfortunately I can't make properties named after the keys because the keys are always different. And they're way too numerous for the most database engines.

TIA !

Jan

Viewing all articles
Browse latest Browse all 297

Trending Articles