org.springframework.data.jdbc.repository.query

## Annotation Type Query

    @Retention(value=RUNTIME)
     @Target(value=METHOD)
     @Documented
    public @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 Elements
`String` `name` The named query to be used.
`Class<? extends ResultSetExtractor>` `resultSetExtractorClass` Optional `ResultSetExtractor` to use to convert the result of the query to domain class instances.
`String` `resultSetExtractorRef` Optional name of a bean of type `ResultSetExtractor` to use to convert the result of the query to domain class instances.
`Class<? extends RowMapper>` `rowMapperClass` Optional `RowMapper` to use to convert the result of the query to domain class instances.
`String` `rowMapperRef` Optional name of a bean of type `RowMapper` to use to convert the result of the query to domain class instances.
`String` `value` The SQL statement to execute when the annotated method gets invoked.

### Element Detail

#### value

    public abstract String value

The SQL statement to execute when the annotated method gets invoked.

Default:
  ""

#### name

    public abstract String name

The named query to be used. If not defined, the name of `${domainClass}.${queryMethodName}` will be used.

Default:
  ""

#### rowMapperClass

    public abstract Class<? extends RowMapper> rowMapperClass

Optional `RowMapper` to use to convert the result of the query to domain class instances. Cannot be used along with `resultSetExtractorClass()` only one of the two can be set.

Default:
  org.springframework.jdbc.core.RowMapper.class

#### rowMapperRef

    public abstract String rowMapperRef

Optional name of a bean of type `RowMapper` to use to convert the result of the query to domain class instances. Cannot be used along with `resultSetExtractorClass()` only one of the two can be set.

Since:
  2.1

Default:
  ""

#### resultSetExtractorClass

    public abstract Class<? extends ResultSetExtractor> resultSetExtractorClass

Optional `ResultSetExtractor` to use to convert the result of the query to domain class instances. Cannot be used along with `rowMapperClass()` only one of the two can be set.

Default:
  org.springframework.jdbc.core.ResultSetExtractor.class

#### resultSetExtractorRef

    public abstract String resultSetExtractorRef

Optional name of a bean of type `ResultSetExtractor` to use to convert the result of the query to domain class instances. Cannot be used along with `rowMapperClass()` only one of the two can be set.

Since:
  2.1

Default:
  ""