79144825

Date: 2024-10-31 13:03:11
Score: 1.5
Natty:
Report link

You can do

@Lock(LockMode.PESSIMISTIC_WRITE)
Optional<MyStuff> findForUpdateByFooAndBar(Foo foo, Bar bar);

As per https://docs.spring.io/spring-data/commons/reference/repositories/query-methods-details.html#repositories.query-methods.query-creation, (almost) anything between find and By is meant for descriptive purposes.

Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: David Kubecka