(1) I have an object A, and there are components B, C that would be parts of A. So when I would want to use hibernate's component feature and define B, C as components of A I must put data for B, C in table of A.
The issue is - what happens with concurrent updates of B, C ?
I would want those updates to happen and if there is only one version column shared by A, B, C this can't be achieved. There may be a version required by A because A would have its own properties too.
So to be able to achieve concurrent updates I would now have to have 3 version columns ??? Do you think this is a good idea ?
(2) Instead I may just normalize the data model and put them in separate tables with one-to-one relationships from A. To be able to use 'foreign' type generator for B, C if I want the id of A to be automatically assigned to B, C objects I have to have bodirectional relationship from B and C towards A ??? I don't want this, and so I must go with 'assigned' type generator and do the assignement myself ?
Thanks in advance
|