When using dynamic instantiation, does each property in the data-transfer have to equate to a column?
Goal: Count an item's bids by bidder
HQL: select new BidSummary ( item.bidder , count(*) ) from Item item where ...
BidSummary class has contructor BidSummary(Bidder bidder, int bids)
With this I get an error "unable to locate appropriate constructor on class [BidSummary]
As a test, I changed the count(*) to an integer column and that works, though not the results I wanted. ;-)
So far none of the examples (Hibernate in Action book, this forum, google) I've come across use an aggregate function. :-(
Thanks!
|