Annotation Interface Query


@Retention(CLASS) @Target(METHOD) public @interface Query
Русский: Аннотация указывает SQL/CQL запрос для метода репозитория.
English: The annotation specifies the SQL/CQL query for the repository method.

Пример / Example:
 
 @Repository
 public interface MyRepository extends JdbcRepository {

     @Query("INSERT INTO users(fullname) VALUES (:fullName)")
     void addUser(String fullName);
 }
 
 
See Also:
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
     
  • Element Details

    • value

      @Language("SQL") String value
      Returns:
      Русский: SQL/CQL запрос.
      English: SQL/CQL query.