-->
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: returning list of objects as a Map
PostPosted: Wed Nov 28, 2007 5:27 am 
Newbie

Joined: Wed Sep 05, 2007 9:26 am
Posts: 16
Hi,

I have this entity:

@Entity
@Table(name = "country")
public class Country {

private String iso;
private String name;

@Id
@Column(length=2)
// getter/setters
}

Now I'd like the list of this table to return as a Map:
return (Map<String, String>) session.createQuery("select iso, name from Country").list();
this does not work, any way to do this? Thanks.
A.C.


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.