-->
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.  [ 1 post ] 
Author Message
 Post subject: Using a different Entity for same Criteria to get rowCount()
PostPosted: Fri Oct 27, 2006 11:51 am 
Newbie

Joined: Fri Oct 27, 2006 11:39 am
Posts: 10
I have an Entity based on a view that has several outer joins of large tables. In addition, it has several other relationships, so the queries generated from the Criteria can be complex, and time-consuming.

The DetachedCriteria is built dynamically from user input, so generating the Criteria itself is complex.

I'm using Projections.rowCount() to determine whether to execute the actually query or not. The problem is, the rowCount() even takes too long if the user-entered Criterion is not specific enough.

It would be great if I could get the rowCount from another entity(different view) that eliminates joins that won't effect the count. Is there another option other than just creating two Criteria objects from the start, and applying the same restrictions to each as the user's input is processed?

There doesn't appear to be a way to change the Entity on an existing DetachedCriteria...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 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.