JPA Annotation Attribute
in jakarta.persistence.NamedQuery

LockModeType lockMode default LockModeType.NONE


(Optional) The lock mode type to use in query execution. If a lockMode other than LockModeType.NONE is specified, the query must be executed in a transaction and the persistence context joined to the transaction.
Since:
JPA 2.0