-->
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: How to get Map List from HQL?
PostPosted: Sat Mar 12, 2005 5:56 am 
Senior
Senior

Joined: Wed Dec 17, 2003 4:24 am
Posts: 188
Hi everyone:

Is there any query method can return a Map List?
For example:

Code:
  List list=session.createQuery("from Article").list();


The list will be [Map1,Map2,Map3,Map4]. The map will be :Map1["name","yashnoo"]. How to query database using hibernate can do this? Thks!

_________________
You are not alone...


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 13, 2005 4:00 am 
Regular
Regular

Joined: Tue Mar 01, 2005 2:35 pm
Posts: 60
Use a projection. You should have a good reason for doing this, though, since it's preferred to get objects back.

SELECT a.name, a.id ...
FROM Article a


Top
 Profile  
 
 Post subject: :(
PostPosted: Mon Mar 14, 2005 7:56 am 
Senior
Senior

Joined: Wed Dec 17, 2003 4:24 am
Posts: 188
pkulak wrote:
Use a projection. You should have a good reason for doing this, though, since it's preferred to get objects back.

SELECT a.name, a.id ...
FROM Article a


"Use a projection"? what's your meaning? If I use your method, I will get is a object[] other than map list. :-(

_________________
You are not alone...


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.