I created a query which suppose to return a number of counted rows. I tested my query using mysql query browser and it worked absolutely fine(it returns the correct result). However, when I used the same query in hibernate with addScalar method, it returned a rediciously large random number. For example, first time it may return 5390, the second time may return 9380 and the third time may be a different one for the expecting result which 1.I created a query which suppose to return a num