-->
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: HQL / JPA QL to navigate the elemets of a Map (hashmap)
PostPosted: Thu Aug 09, 2007 7:31 am 
Newbie

Joined: Tue Aug 07, 2007 6:18 am
Posts: 3
Hi,

I have the following mapping in a class called Address:
@CollectionOfElements(fetch=FetchType.EAGER)
@JoinTable(name="ADDRESS_ADDRESSROWS", joinColumns=@JoinColumn(name="ADDRESSROW_ID"))
private Map<String, String> addressRows = new HashMap<String, String> ();


Now I want to make a HQL / JPA QL query that navigates through the elements of the Map.
How do I address them?
I want to ask something like this:
select from Address as a inner join a.addressRows as aRows where aRows.???= 'street' and aRows.??? like 'Big Street 1'.
Is it possible to make a query like this in HQL and/or JPA QL?
Or it the SQL the way to go?

Using Criteria this would be very elegant, unfortunately it does not work (the reason why is listed under the hibernate advanced FAQ).

Regards!


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.