Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Is CURSOR concept available in Hibernate?
PostPosted: Wed Jun 11, 2008 9:57 am 
Newbie

Joined: Wed Jun 11, 2008 9:54 am
Posts: 3
please help me on this..


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 11, 2008 12:42 pm 
Newbie

Joined: Sun Jun 20, 2004 7:41 am
Posts: 7
Code:

Query q = session.createQuery("from your.package.ClassName cn where cn.property = \"foo\"");

for(ClassName object : (List<ClassName>)q.list()) {
  // process your objects
}



Alternatively you can use the Query.iterate() method that will return an instance of Iterator to the collection of objects returned by your query.

hope this helps

K.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 11, 2008 1:03 pm 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
As hincar said, you can certainly obtain a list of results, and loop through those results at your leisure. But is that what you were looking for with regards to using a Cursor?

More specifically, what type of functionality that you are using now with your cursor do you need?

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


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