-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Using PathExpressions on unindexed collections 3.6.Final
PostPosted: Sun Jun 26, 2011 1:09 pm 
Newbie

Joined: Tue May 31, 2011 8:25 am
Posts: 2
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.