Annotation Interface PartiQL
The
PartiQL annotation is a custom annotation used to associate PartiQL query strings
with methods or elements in your code.
DynamoDB supports a limited subset of PartiQL.
When applied to a method, field, or other element, this annotation provides a convenient way to specify an PartiQL query that should be associated with that element.
For example, you can use this annotation to specify a PartiQL query for a method as follows:
@PartiQL("SELECT * FROM users WHERE status = 'active'")
public void getUserData() {
// Method implementation
}
In the context of an DynamoDBRepository, you can use the @PartiQL annotation
to define custom PartiQL queries for repository methods. Here's an example:
public interface UserRepository extends DynamoDBRepository<User, Long> {
// Find all active users using a custom SQL query
@PartiQL("SELECT * FROM users WHERE status = 'active'")
List<User> findActiveUsers();
}
In this example, the @PartiQL annotation is used to define a custom PartiQL query for the
findActiveUsers method in an DynamoDBRepository interface, allowing you
to execute the specified PartiQL query when calling the repository method.
-
Required Element Summary
Required Elements