JPA Annotation Attribute
in javax.persistence.NamedQuery

LockModeType lockMode default 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