Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: retrieve specific column from number of given select column
PostPosted: Thu Apr 26, 2012 9:52 am 
Newbie

Joined: Tue Sep 20, 2011 10:17 am
Posts: 4
Hi all,

List<Object[]> rs = session.executeQuery("select column0, column1, column2 from table");

We get the result list of object array. ie List<Object[2]>

For the same query, can i get List<Object>, ie. i need to mention the alias name as parameter as given below,

List<Object> rs = session.executeQuery("select column0, column1, column2 from table", "column1");

I need only column1 results in the list... Omit the other columns in the execution..


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 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.