-->
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: Projections.rowCount() behaviour
PostPosted: Sun May 30, 2010 11:03 am 
Newbie

Joined: Wed Jan 18, 2006 9:45 am
Posts: 1
HI,

I have an issue regarding the Projections.rowCount() function because this generates the following sql code in the back:
Code:
select count(*) from ...

How can I make the sql resulted to be something like:
Code:
select count(0) from ...


I'm referring to Criteria.example case, so I don't want to build manually the select count(0) by using hql, i'm simply using something like:
Code:
criteria.add(Example.create(filter)


I'm asking because select count(0) is much faster and uses way less memory than select count(*) on most of the databases.

Please be advised that I don't want to count by a specific property, e.g. I'm aware of
Code:
Projections.count(propertyName)
.

Is there any way so I can achive this behaviour?

Thank you.


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.