I have the following method:
Query q = getEntityManager().createNativeQuery("SELECT COUNT(1) FROM table1 WHERE column = :column_id " + "UNION " + "SELECT COUNT(1) FROM table2 WHERE column = :column_id"); q.setParameter("column_id", column_id);
When I want to get a list of counters (which will be 2 lines), I perform this action:
List<BigInteger> counts = (List<BigInteger>) q.getResultList();
This works fine in MySQL. But as soon as I connect to the MS SQL server, I get Integer objects with an integer:
List<Integer>
Any idea why there is a difference?
Jochen hebbrecht
source share