Hi,
I have a class -
public class LocalizedString extends BaseEntity{
@CollectionOfElements
@MapKey(columns = { @Column(name = "locale", nullable = false)})
private Map<Locale, String> values;
............................ more code
}
BaseEntity has field (id ).
(1) Currently, 3 locales (english,french,spanish) exists for each LocalizedString. Is the relation, OneToMany? If not, what it is and why?
(2) And, values is getting stored in table named "LocalizedString_values" with fields (id, locale, elemet). What will be the corresponding HQL to access the values field from LocalizedString ? I want the whole map at a time.
I wrote - select localizedString.values from LocalizedString localizedString where localizedString.id = ?"
But its not working. :(
Thanks,
Sucheta.
|