Annotation Interface NativeQuery


Annotation to declare native queries directly on repository query methods.

Specifically @NativeQuery is a composed annotation that acts as a shortcut for @Query(nativeQuery = true) for most attributes.

This annotation defines sqlResultSetMapping to apply JPA SQL ResultSet mapping for native queries. Make sure to use the corresponding return type as defined in @SqlResultSetMapping. When using named native queries, define SQL result set mapping through @NamedNativeQuery(resultSetMapping=…) as named queries do not accept sqlResultSetMapping.

Since:
3.4
Author:
Danny van den Elshout, Mark Paluch
See Also: