cancel
Showing results for 
Search instead for 
Did you mean: 

Deep insert with assert.unique in header entity is creating child entities

marcmaurí
Participant
0 Kudos

Dear CAP Team,

I would like to inform you an unexpected behaviour we are getting with the deep insert.

In our data model there is a header entity with some child entities defined as compositions. The header unit has an assert.unique annotation for a non-key field.

When we execute a deep insert that violates the assert.unique constraint, the header is not inserted but the child entities are. I would expect child entities would not be created in this situation.

Best regards,

Marc

patricebender
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi and thanks for reporting. It would be beneficial if you'd provide the version numbers for which the unexpected behavior occurs. Just execute `cds --version` and add the output to your post. Moreover, it would be great if you'd create a small example application with detailed steps to reproduce your scenario. Thanks.

marcmaurí
Participant
0 Kudos

CAP versions:

@cap-js/cds-types: 0.2.0
@sap/cds: 7.3.0
@sap/cds-compiler: 4.3.0
@sap/cds-dk: 7.3.0
@sap/cds-dk (global): 7.6.1
@sap/cds-fiori: 1.2.2
@sap/cds-foss: 5.0.0
@sap/cds-mtxs: 1.12.1
@sap/eslint-plugin-cds: 2.6.3
Node.js: v20.11.1

Thanks @patricebender . 

patricebender
Product and Topic Expert
Product and Topic Expert
0 Kudos
please also provide a small, self-contained sample repository with detailed steps to reproduce. So that I can clone that and execute the steps until I run into the unexpected behavior.

Accepted Solutions (0)

Answers (0)