How to use the Hibernate optimistic locking version property on the front end?
问题 Optimistic locking using the version attribute for an entity works fine and is easy to implement: <version property="VERSION" type="int" column="EX_VERSION" /> The entity has a property of the following type: private int VERSION; public int getVERSION() { return VERSION; } public void setVERSION(int VERSION) { this.VERSION = VERSION; } So far, so good. Now service methods return a data transfer object (DTO) for the entity above, which the views display in HTML. For update pages, the VERSION