Annotation 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 -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionboolean
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 valueSpecifies the value of the query.- Returns:
- the value of the query
-
nativeQuery
boolean nativeQueryIndicates whether the query is a native SQL query.- Returns:
- true if the query is a native SQL query, false otherwise
- Default:
false
-
bql
boolean bqlIndicates whether the query is written in HQL (Bibernate Query Language).- Returns:
- true if the query is written in HQL, false otherwise
- Default:
true
-