Have a look at:
resultClass - The Java type to map results to
If you are going to create e.g. a NativeQuery which maps to a Long.class or String.class this does for sure map to a Java type BUT actually looking at the implementation used resultClass is expected to be a Entity class which is known to the persistence unit.
So please correct the javadoc here to something like: