-->
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: Filter aggregates count but not sum
PostPosted: Thu Mar 29, 2007 12:40 am 
Newbie

Joined: Thu Aug 10, 2006 10:08 pm
Posts: 12
I have an issue trying to get a session to return an aggregate function.

I can do this exact thing with count(*) and it returns fine. When i change to Sum(TransactionAmount) the query will actually return the filtered list, it seems to ignore the SELECT statement.

should this work or should i look at alternate possibilities

Code between sessionFactory.openSession() and session.close():

IList sucessfulRejects = (IList)Persistor.getSession().Filter(
this.EFTRejects, "SELECT Sum(this.TransactionAmount) where this.errorCode = ?",0, NHibernateUtil.Int32);

return (Decimal)sucessfulRejects[0];

thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 02, 2007 9:19 pm 
Newbie

Joined: Thu Aug 10, 2006 10:08 pm
Posts: 12
Is there anyone who can help me with this. From reading the documentation this should work. But dosnt, is it a bug or have i made a mistake in my code :S


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.