New Features
Enhanced Features
O/R Mapping
Tips and Tricks
UML Diagrams
VP Suite

Generate Hibernate version tag for optimistic concurrency control

For Hibernate’s optimistic concurrency control to work, you need to add the version tag to mapping files. Here you will learn how to specify the version column in ERD entity so that concurrency control can be implemented in the generated ORM libraries.

Specifying Version Column

  1. Create a version column in the entity that you want to generate version tag.
  2. Right-click on the entity and select Open Specification... from the popup menu. In the Entity Specification dialog box, select the column in Version column.
  3. Right-click on the ERD, select Synchronize to Class Diagram from the popup menu to update the class models.
  4. You can see the version attribute appears in the associated class.
  5. Generate code by selecting menu Tools > Object-Relational Mapping (ORM) > Generate Code....
  6. If you selected to generate mapping as annotation, the version tag will appear in the corresponding source file as annotation.
  7. If you selected to generate mapping as XML, the version tag will appear in the corresponding mapping XML as a node.


Last modified: 2007/04/24 12:47
Home | Recent Topics | Highlights | UML Diagrams | Tips and Tricks | Object-Relational Mapping Home | Training Center | UML Center | VP Gallery | Discussion Forum | UML Open Directory