[
https://issues.apache.org/jira/browse/CAY-959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12797047#action_12797047
]
Andrus Adamchik commented on CAY-959:
-------------------------------------
yes, let's keep it. We'll implement it eventually.
> Optimistic locking: Implement auto-version attributes
> -----------------------------------------------------
>
> Key: CAY-959
> URL: https://issues.apache.org/jira/browse/CAY-959
> Project: Cayenne
> Issue Type: Task
> Components: Cayenne Core Library
> Affects Versions: 3.0
> Reporter: Andrus Adamchik
> Assignee: Andrus Adamchik
> Fix For: Short term future
>
>
> Per JPA spec , chapter 3.4, we need to support "Version" attribute for
> optimistic locking. Cayenne already supports optimistic locking, but leaves
> it up to the user to set the "version" columns. We need to implement
> auto-versioning on Cayenne end, and bridge it with Cayenne JPA provider.
> Cayenne API Tasks:
> 1. Define ObjAttribute locking type to be LOCK_NONE, LOCK_VERSION,
> LOCK_MANUAL (make this an enum?)
> 2. Replace ObjAttribute.usedForLocking property (with deprecation) with the
> new enum (call it "lockType" or something).
> 3. Add modeler support for #2.
> 4. Implement auto-versioning ... the easiest way is probably to use a
> PRE_PERSIST and PRE_UPDATE callback listener.
> JPA Tasks:
> 5. Bridge JPA @Version mapping with Cayenne mapping (see DataMapConverter).
> 6. Write integration tests under "jpa-chapter3" module and/or jpa-chpater9
> (where @Version annotation is defined).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.