-->
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: using criteria result in a query
PostPosted: Sat Nov 27, 2004 12:41 am 
Beginner
Beginner

Joined: Fri Jan 23, 2004 10:26 am
Posts: 21
Hello, i create a dynamic query by using criteria. But query has some things criteria cannot provide (like count, group by etc). Question is, is it possible to use criteria result list in a normal hibernate Query?
Something like this:

List cats = sess.createCriteria(Cat.class)
.add( Expression.like("name", "F%")
.addOrder( Order.asc("name") )
.setMaxResults(50)
.list();

Then using the results like this:

Collection counts = s.filter( cats, "select this.type, count(this) group by this.type" );


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 03, 2004 11:50 am 
Beginner
Beginner

Joined: Fri Mar 26, 2004 8:19 am
Posts: 49
i think it'll be just fine if your session is still open.


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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.