Hello,
Using Hibernate 3.6.0.Final.
I'm trying to use a query like: SELECT p FROM Person p WHERE :1 MEMBER OF p.address.city.residents Where address.city.houses would be a OneToMany association to all the Person instances who live in that city.
I tried using Collections, Sets and Lists without an index column (since I don't really need the collection's terms ordered), and got the "unindexed collection before [] p.address.city.residents in: SELECT ....".
Having read Hibernate source code, it appears there is an assumption in PathExpressionParser that the Collection we're using is indexed - and only JPA's @OrderColumn / Hibernate's @IndexColumn would do. This means that if I'm using either sorted collections (like SortedSet) for Java sorting, @OrderBy for in-memory sorting, or no sorting at all - I cannot use any path expressions over collections?
I saw no mentioning of such a requirement in the JPA 2.0 Specification concerning collection mapping. Furthermore, in order to use Lists (an ordered, indexed collection), I saw JPA examples which only specify @OrderBy, which causes Hibernate to use Bags and not actual Lists (see line 293 in CollectionBinder) - unlike the JPA official examples?
Thanks in advance,
Gil.
|