-->
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.  [ 3 posts ] 
Author Message
 Post subject: Return a List of countries from a DB
PostPosted: Sat Oct 17, 2009 7:36 am 
Newbie

Joined: Sat Oct 17, 2009 7:34 am
Posts: 9
Hello,

I want to return a list of countries from a table.
The table is simply called Countries. has one column called "country"
This column lists countries

How do I write a Hibernate XML file to map this column to java.util.List
I cant figure it out

A bag will do, I think for a <list> i need an extra column for indexing.
I dont mind if the result set doesnt come back in the same order because I can just do a sort on the collection
Or to an order by in the query actually.

Thanks
Ally


Top
 Profile  
 
 Post subject: Re: Return a List of countries from a DB
PostPosted: Sat Oct 17, 2009 8:12 am 
Newbie

Joined: Sat Oct 17, 2009 8:09 am
Posts: 1
have you tought about use Set instead of List?


Top
 Profile  
 
 Post subject: Re: Return a List of countries from a DB
PostPosted: Sat Oct 17, 2009 8:21 am 
Newbie

Joined: Sat Oct 17, 2009 7:34 am
Posts: 9
So what is the syntax for a set. I am really struggling to map

Country
------
Ireland
France
Germany
etc

to java.util.String


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

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.