users@glassfish.java.net

Question on JPA _at_SqlResultSetMapping when using a native query

From: <glassfish_at_javadesktop.org>
Date: Wed, 19 Dec 2007 09:57:51 PST

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?
[Message sent by forum member 'bbergquist' (bbergquist)]

http://forums.java.net/jive/thread.jspa?messageID=250807