-->
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: Criteria API and Reports
PostPosted: Thu Nov 03, 2005 5:58 am 
Beginner
Beginner

Joined: Tue Jan 04, 2005 5:39 am
Posts: 37
Hibernate version:3.0.5

Hi,

I have Hibernate based object model and I would like to use Hibernate Criteria API to build queries which feed my report engine. But after some thinking, I think that it won't be usable to retrieve all objects into the memory. So I have a question:

I still would like to use Criteria API to build queries, but then, I would like to retrieve a sql string from the Criteria and to execute plain JDBC select.

Is it possible? I looked for this kind of "Projection" class, but couldn't find ...

Thanks!
Misha.


Top
 Profile  
 
 Post subject: Partial solution
PostPosted: Thu Nov 03, 2005 7:04 pm 
Newbie

Joined: Mon Aug 29, 2005 1:14 am
Posts: 10
Criterion.toSQLString is , but requires you to pass in instances of classes that are supposed to only be used by the API, not client programmers.

DetachedCriteria.toString() gives you a string that describes the query, but isn't actually sql.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 03, 2005 7:07 pm 
Newbie

Joined: Mon Aug 29, 2005 1:14 am
Posts: 10
Also, if your only concern is the size of the result set, DeteachedCriteria allows setting paging sizes, to bring back "pages" consisting of only part of a result set.


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.