In current openjpa implementation, version field in the embeddable is not supported. The rationale is embeddable is not an identifiable object, it can not be modified independently of its owning entity, so there is no need for the version field in the embeddable to keep track of its change. Also, unlike inheritance, the version field in the embeddable is not propogated to its owning entity. Think of an example of an entity which has many embeddable fields or a collection of embeddables, if every embeddable has its own version field, and if they are all propagated to the owning entity, the owning entity may end up with multiple version fields. which is not allowed.
----- Original Message ----
From: "
[hidden email]" <
[hidden email]>
To:
[hidden email]
Sent: Thu, November 5, 2009 12:06:45 AM
Subject: version field dont work when used in the embeddable class
Hi
In my application I have an embeddable class that contain some common fields
including version field .when I put version field in the main class
everything is good and OpenJPA increment the version field value and throw
optimistic exception when concurrent write occur .But when I put the version
field on the embeddable class openJPA don’t do anything. Is this is a bug
in the OpenJPA ? or I am misusing the embeddable class?
Please help me
Thanks
Ahad Javadi
--
View this message in context:
http://n2.nabble.com/version-field-dont-work-when-used-in-the-embeddable-class-tp3950794p3950794.htmlSent from the OpenJPA Developers mailing list archive at Nabble.com.