count in hibernate defaults to long. Although there are ways to get an integer/int from count, it would either make the query a bit more complex or involve some tinkering with the setter methods.