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?
|