Annotation Interface Query
Annotation to provide SQL statements that will get used for executing the method. The SQL statement may contain named
parameters as supported by
NamedParameterJdbcTemplate. Those
parameters will get bound to the arguments of the annotated method.- Author:
- Jens Schauder, Moises Cisneros, Hebert Coelho
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionThe named query to be used.Class<? extends org.springframework.jdbc.core.ResultSetExtractor>OptionalResultSetExtractorto use to convert the result of the query to domain class instances.Optional name of a bean of typeResultSetExtractorto use to convert the result of the query to domain class instances.Class<? extends org.springframework.jdbc.core.RowMapper>OptionalRowMapperto use to convert the result of the query to domain class instances.Optional name of a bean of typeRowMapperto use to convert the result of the query to domain class instances.The SQL statement to execute when the annotated method gets invoked.
-
Element Details
-
value
String valueThe SQL statement to execute when the annotated method gets invoked.- Default:
- ""
-
name
String nameThe named query to be used. If not defined, the name of${domainClass}.${queryMethodName}will be used.- Default:
- ""
-
rowMapperClass
Class<? extends org.springframework.jdbc.core.RowMapper> rowMapperClassOptionalRowMapperto use to convert the result of the query to domain class instances. Cannot be used along withresultSetExtractorClass()only one of the two can be set.- Default:
- org.springframework.jdbc.core.RowMapper.class
-
rowMapperRef
String rowMapperRefOptional name of a bean of typeRowMapperto use to convert the result of the query to domain class instances. Cannot be used along withresultSetExtractorClass()only one of the two can be set.- Since:
- 2.1
- Default:
- ""
-
resultSetExtractorClass
Class<? extends org.springframework.jdbc.core.ResultSetExtractor> resultSetExtractorClassOptionalResultSetExtractorto use to convert the result of the query to domain class instances. Cannot be used along withrowMapperClass()only one of the two can be set.- Default:
- org.springframework.jdbc.core.ResultSetExtractor.class
-
resultSetExtractorRef
String resultSetExtractorRefOptional name of a bean of typeResultSetExtractorto use to convert the result of the query to domain class instances. Cannot be used along withrowMapperClass()only one of the two can be set.- Since:
- 2.1
- Default:
- ""
-