I have been asking myself a lot of times about this question. Actually I've come for some solution three times and I don't fully like none of them.
My last solution has been based on ExtendedDataModel and it's very similar to the solution from the following URL:
But I still don't like some parts of this solution with sorting and filtering. Because JSF acts very odd and the DataModel sometimes executes the same sql queries twice per request.
I wonder if there is some similar solution published on Richfaces forum. And I also very want to know the answer for the next question. Are you going to add a similar solution to RF 4.0 or may be to RF 4.0 usage examples? It could help a lot if you simply add some solution based on DataModel class into RF live demo. I even can help a little bit and write an article about this topic if you don't have it already. =) Because I think this stuff is very usefull in development of an enterprise application.
I appreciate any answers,
Thanks for your attention!