-->
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.  [ 2 posts ] 
Author Message
 Post subject: convert hibernate query results into arraylist
PostPosted: Wed Mar 16, 2011 11:29 am 
Newbie

Joined: Fri Nov 26, 2010 7:21 am
Posts: 4
Hi to all,

i have a search page which retrieves data corresponding to the employee name which i entered. i have to display arraylist contents on jsp page by iterating them. here i need to convert hibernate query results into arraylist. how can i do this? i have a confusion on this conversion. please guide me.


Top
 Profile  
 
 Post subject: Re: convert hibernate query results into arraylist
PostPosted: Wed Mar 16, 2011 2:27 pm 
Newbie

Joined: Fri Dec 24, 2010 2:08 pm
Posts: 6
Hi prabhajan,

Please provide some more info and code fragment for this.

We can get the List of objects which you are querying for.
Query query = session.createQuery
("from Employee");
List<Employee> teams = (List<Employee>)query.list();

If you wish to have list of different pojo results you have to map these pojo's first and fetch the list.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.