Incorrect JavaDoc on QueryProducer.createNativeQuery(.., Class)

Description

Reading

https://docs.jboss.org/hibernate/orm/5.2/javadocs/org/hibernate/query/QueryProducer.html#createNativeQuery-java.lang.String-java.lang.Class-

its written:

1 2 3 4 5 6 7 8 9 10 11 12 <R> NativeQuery<R> createNativeQuery(String sqlString, Class<R> resultClass) Create a NativeQuery instance for the given native (SQL) query using implicit mapping to the specified Java type. Parameters: sqlString - Native (SQL) query string resultClass - The Java type to map results to Returns: The NativeQuery instance for manipulation and execution See Also: EntityManager.createNativeQuery(String,Class)

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:

1 resultClass - The entity to map results to

Environment

JDK 8

Status

Assignee

Unassigned

Reporter

Torsten Krah

Fix versions

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

5.2.12

Priority

Minor
Configure