createNativeQuery with generics does not work with classes like Integer or String. This works fine with createQuery. Illustrated in the attached testcase. createNativeQuery without generics works.