-->
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: formula with count(distinct ...) ?
PostPosted: Tue Jun 22, 2004 12:06 am 
Newbie

Joined: Mon Jun 21, 2004 11:58 pm
Posts: 5
I'm pretty new at hibernate, so I'm sure I'm just doing something wrong. I'm using hibernate 2.1.4 with postgres 7.4.1, and I'm trying to define a property in an object like:

<property name="eventCount"
type="java.lang.Integer"
formula="count(distinct event)"
/>

but hibernate is "translating" the 'distinct' part of the clause so that what is being generated is:

select ... count(tablename.distinct tablename.event) ...

which of course doesn't work. What am I missing? Am I just misunderstanding how "formula" works? If so, how can I do the above where I want a "count(distinct)" as a property of my object?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 22, 2004 12:17 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
I've just added support for distinct in CVS.


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.