As I am implementing Optimistic locking using version number. I added the <version> element in my hbm.xml.
But the problem is when i package everything and deploy in JBoss, a new column for the version number is created in the table concerned which is holds a null value for every row.
Hence when i edit a particular row, instead of updating the row, a new row is created.
So is there anyway i can update the schema with the version column set to Not Null and Default value = 0? I mean through Hibernate.
If not, anyway I can avoid creating a new row?
|