-->
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: SQL Exception with Projections.rowCount in Iformix
PostPosted: Sat Jun 16, 2007 9:04 am 
Beginner
Beginner

Joined: Wed Sep 17, 2003 10:43 am
Posts: 48
Hibernate version:
3.2.0.ga


Name and version of the database you are using:

Informix 10

The generated SQL (show_sql=true):

select count(*) as y0_ from table1 this_ order by this_.id asc


How the query occurs:

I have a Page object that receives a criteria object to perform a paged search. The Page object, before performing the actual search, tries to count the number of matched records as follows:

Code:
this.totalResultCount = ((Integer) criteria.setProjection(
                    Projections.rowCount()).uniqueResult()).intValue();


The problem is that the generated SQL breaks informix due to the ORDER BY clause; if that is removed the count() function works just fine.

Is this an Informix dialect bug? Can i bypass the issue API-wise?

Many thanks,

Manos


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 29, 2008 11:28 am 
Newbie

Joined: Mon Dec 29, 2008 11:21 am
Posts: 1
Hello,

I run into the same problem - as long as an "order by" is done, the projetciton is failing ( Hibernate 3.2.6GA and H2 Database).

I also switched Dialect (HSQLDB) - but problem is still existing.

Is there any solution known?

Thank you!
Marcus


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.