users@glassfish.java.net

Re: Question on JPA _at_SqlResultSetMapping when using a native query

From: <glassfish_at_javadesktop.org>
Date: Wed, 19 Dec 2007 20:03:30 PST

This is what the spec says:

[i]3.6.6 SQL Queries
Queries may be expressed in native SQL. The result of a native SQL query may consist of entities, scalar values, or a combination of the two. [...] When multiple entities are returned by a SQL query, the entities must be specified and mapped to the
column results of the SQL statement in a SqlResultSetMapping metadata definition.[/i]

So no, if you return back only scalar values, you don't need SqlResultSetMapping.

Regards,
-marina
[Message sent by forum member 'mvatkina' (mvatkina)]

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