I’m using ejb 2.1 BMP, JBoss 7.1 AS
I need to get List ordered by some field(it depends on user choice)
from database using ORDER BY in SQL statement.
Home Interface:
public interface AliveHome {
...
Collection<Alive> findAllConstraint(...) [exceptions];
...
}
When i change return type to List i get exception:
java.lang.ClassCastException: java.util.HashSet cannot be cast to java.util.List
$Proxy13.findAllConstraint(Unknown Source)
But i need List (because with HashSet there is no sense in ORDER BY)
How to get List?
There is no solution for JBoss 7. I just install JBoss 6
and it works with return type List !
=)