Annotation Interface Query


@Retention(RUNTIME) @Target(METHOD) public @interface Query
Indicates that the annotated method represents a query. Example usage: public interface ProductRepository { \@Query("SELECT p FROM Product p WHERE p.category = ?") List<Product> findByCategory(@Param("category") String category); } In this example, the 'findByCategory' method in the 'ProductRepository' interface is annotated with '@Query' to indicate that it represents a query. The value of the annotation specifies the BQL (Bibernate Query Language) query to be executed.
Since:
1.0
Author:
Blyzhnytsia Team
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Specifies the value of the query.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Indicates whether the query is written in HQL (Bibernate Query Language).
    boolean
    Indicates whether the query is a native SQL query.
  • Element Details

    • value

      String value
      Specifies the value of the query.
      Returns:
      the value of the query
    • nativeQuery

      boolean nativeQuery
      Indicates whether the query is a native SQL query.
      Returns:
      true if the query is a native SQL query, false otherwise
      Default:
      false
    • bql

      boolean bql
      Indicates whether the query is written in HQL (Bibernate Query Language).
      Returns:
      true if the query is written in HQL, false otherwise
      Default:
      true