Search code examples
spring-dataspring-data-jdbc

Lock annotation in Spring-data-jdbc


This reference documentation from spring.io states claims that Spring Data JDBC supports a @Lock annotation.

Spring Data JDBC supports locking on derived query methods. To enable locking on a given derived query method inside a repository, you annotate it with @Lock.

However, I am unable to find such an annotation in the spring-data-jdbc library. There is one in the spring-data-jpa, but we use data-jdbc.

Is there a mistake in the documentation or am I missing something?


Solution

  • It's org.springframework.data.relational.repository.Lock. As you can see it is in Spring Data Relational which is the basis for both Spring Data R2DBC and Spring Data JDBC.