The @SqlResultSetMapping annotation defines a named mapping, which is useful when you're passing a SQL query as a string to EntityManager.createNativeQuery().
But when you have a @NamedNatiiveQuery it's just annoying and untypesafe.
I therefore propose adding the following members to @NamedNatiiveQuery:
public @interface NamedNativeQuery {
...
/** Specifies the result set mapping to entities. */
EntityResult[] entities() default {};
/**
* Specifies the result set mapping to constructors.
*/
ConstructorResult[] classes() default {};
/** Specifies the result set mapping to scalar values. */
ColumnResult[] columns() default {};
}
Naturally, this is just a copy/paste job of the members of @SqlResultSetMapping.
The
@SqlResultSetMapping
annotation defines a named mapping, which is useful when you're passing a SQL query as a string toEntityManager.createNativeQuery()
.But when you have a
@NamedNatiiveQuery
it's just annoying and untypesafe.I therefore propose adding the following members to
@NamedNatiiveQuery
:Naturally, this is just a copy/paste job of the members of
@SqlResultSetMapping
.