Question on JPA @SqlResultSetMapping when using a native query
I have a native query that I am creating using EntityManager.createNativeQuery. The query will only return scalar columns of various entities, but will not return any entities.
From the spec, I cannot tell if I need a SqlResultSetMapping annotation or not. On page 72 of the spec, it says "Scalar result types can be included in the query result by specifying the ColumnResult annotation in the metadata." In the annotation definition, the EntityResult property is optional and the ColumnResult property is optional.
So do I need to specify a SqlResultSetMapping with only ColumnResult annotations?