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