Question d’entretien chez Revolut

How to lock object with ORM in Java? How does it work under the hood?