-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: version and legacy database
PostPosted: Tue Jul 13, 2004 5:38 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
I have use hibernate version features without change legacy database

Is it possible set version in another table.For instance :

Table A

ID - primary key
properties

Version table A_version
ID (primary key same table A)
version long

Tables A and A_version have one-to-one mapping and ID can be composite ID.

When load object from table A, hibernate load version from table A_version
(if row in A_version doesn't exists, hibernate create one with version=1)
When user update table A hibernate do first
update A_version
where ID=... and version=_version
If update version success, then continue update A - else return 'another user update this row' or like message

regards


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.