Version or Timestamp? Hibernate doesn't supply a specific timestamp mapping you can use to support optimistic locking. It does allow you to use a field with a timestamp data type for versioning. The hibernate documentation explains how to use the version element. To paraphrase what it says there, it's fairly simple to do: add a version element to your mapping, point it a a suitable attribute of your entity and that's it, Hibernate will do all the nuts and bolts work to implement optimistic locking.
The documentation also explains why using a numeric data type is better than a timestamp; specifically timestamps could very occasionally clash which means you may get lost updates. This is an edge case, becasue in the real world this is very unlikely but not imposible.