-->
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: problem querying an array of elements
PostPosted: Tue Jun 29, 2004 1:29 pm 
Newbie

Joined: Tue Jun 29, 2004 12:31 pm
Posts: 1
I have a problem querying an array of elements,
The mapping of the element is

<class name="Profiles" table="profiles">
.....
<array name="languages" cascade="all" table="profileLanguages">
<key column="profileId"/>
<index column="arrayIdx"/>
<element column="language" type="string"/>
</array>
....
</class>

Save, update, delete are OK.
I am using mysql( so it does not support subselects), so I tried the following query:

"from Profiles p join p.languages as plg where p.city like :city and plg.language in (:langs)"

and I got the following error:
cannot dereference scalar collection element

When I used the same approach to query based on a mapped class(instead of an element) and it worked.
It seems that when joining, collections of mapped classes and elements are treated differently


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.