How to dynamically set lock in JPA
I have below simple example. I want the JPA method findByName
to dynamically set lock. In the changeUserNames
method I want it set a lock. In getUsers
method I don’t want it to set lock. How can I achieve this?
Writing a repository for a class that has OneToOne primary key field
I have two model classes in a Spring web application: