cancel
Showing results for 
Search instead for 
Did you mean: 

CAP Java Draft: Read-Only Field Not Persisted to Active Entity on Activation

11-30-2025 2:52 AM
MioYasutake SAP Champion
409 views 0 comments
Subscribe

Hi community,

I’m working with CAP Java and trying to implement soft deletion for items removed from the Object Page table.
When a user deletes an item (Composition Child) in edit mode, I mark the item as logically deleted by setting isDeleted = true.
I achieved this by setting the flag in the @On DraftService.EVENT_DRAFT_CANCEL event handler.

However, when the isDeleted field is annotated with @readonly, @Core.Immutable, or @Common.FieldControl: #ReadOnly, the flag is not transferred to the active entity when the draft is activated.
This issue occurs only in CAP Java — the same logic works correctly in CAP Node.js.

I’ve created a minimal reproducible example on GitHub:

https://github.com/miyasuta/cap-java-draft-composition-delete

Has anyone experienced similar behavior or knows whether this is a known limitation of CAP Java drafts?

Accepted Solutions (0)

Answers (0)