Start here. This is the direct spoken answer to practice first.
Overview
A version field works only when the client's original version participates in the eventual update decision.
I add a @Version field to the entity and return its current value with the representation. The client sends the version it edited, either in the command body or an HTTP precondition such as If-Match. Inside a transaction I load and authorize the current entity, compare its version with the client's original version, and only then apply allowed changes. Hibernate includes the managed version in the update, so a writer that commits after that check still causes an optimistic-lock failure that the API maps to a conflict response.