-->
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: accessing <map> keys with criteria
PostPosted: Thu May 24, 2007 3:41 pm 
Newbie

Joined: Fri Mar 16, 2007 6:04 am
Posts: 14
Hello,

I have a pojo like this:

Code:
class Coutry {
long id;
Map titles;
}


The Map keys are Locale objs and the values are Strings.
My mapping is as follows:

Code:
<class name="foo.bar.Country" table="countries">
   <id name="id" column="id" type="long" access="field">
       <generator class="native" />
   </id>
       
   <map name="titles"
      table="country_titles"
      batch-size="20"
      order-by="country_id"
      cascade="all-delete-orphan">
<key column="country_id"  foreign-key="FK_country_to_country_titles" />
<map-key column="locale" type="java.util.Locale" length="16" />
<element column="title" type="java.lang.String" length="128" />
    </map>
</class>


Now, I want a query that gets a list of all countries whose title in Locale.UK is 'foo'. So, how can I have access in the map keys and values so I can add the appropriate restrictions within my criteria??

Thanks,
akz


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.