JPA specification ask avg() should return Double.
In Reference Manual:
When you average (signed or unsigned) int, smallint, tinyint data, Adaptive Server returns the result as an int value.
But considering it as an ASE feature, it won't be fixed.
Hibernate 3.6.6, Sybase ASE15.5, JDK 1.6, Windows XP
Double avgValue = (Double)session.createQuery("select avg(t.value) from Table t").uniqueResult();
mysql : avgValue == 1.5
sybase : avgValue == 1
Bulk closing rejected tickets in "resolved" state.