christian wrote:
And: surely touching the original collection would be wrong. How could Hibernate order your Set, for example? Yes, the name "filter" is not really good.
Adding an order by clause somewhere for example (there the possibility to add an order by in the mapping file fo example, but not on the fly)...it would be useful in my opinion.
I try to examplain...ok this feature is not necessary, but i think it would be really useful in MVC pattern.
I pass the bean with the collection to the presentation layer (JSP), and there i iterate on its collection to show all the items owned by the entity.
If i want to change something in the order for example I can't use the collection from the bean, and I have to store the filtered collection in my controller (servlet for example) in a request or session attribute. And it is less elegant maybe.