Why the default resultType of MyBatis countByExample is java.lang.Long

891 Views Asked by At

Using MyBatis Generator 1.3.5, found out the resultType of countByExample is Long.

However in previous version it was Integer (I don't remember the version exactly). Of course I can change it back to Integer. But wondering why it happens.. It doesn't make any senses to me. Because countByExampleRange is still Integer.

Do I miss anything?

1

There are 1 best solutions below

1
On

Refer this issue on Mybatis:- https://github.com/mybatis/generator/issues/125

It is possible that tables can have more than 2 Billion rows(Integer) and to tackle that issue they changed it to Long.