-->
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 : Selecting the Map from a class
PostPosted: Fri Aug 03, 2007 3:23 am 
Newbie

Joined: Fri Jul 27, 2007 5:48 am
Posts: 8
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.


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.