java - Aggregate function on composite user type -
i have composite user type represents monetary amount. type spans 2 columns.
-amount -currency
when creating hql query performs aggregate function "avg" on property using composite user type exception thrown. reason seems avgfunction cannot operate types have multiple columns.
is there way use compositeusertype in aggregate functions?
thanks in advance , best regards
stathis alexopoulos
your query doesn't make sense. average of these 3 rows?
amount currency 5 usd 10 eur 15 yen
you may average amounts , neglect currency:
select avg(bill.fullamount.amount) billbean bill
but can't average monetary amounts (i.e. tuple [amount, currency]).
Comments
Post a Comment