You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Nikita Timofeev (JIRA)" <ji...@apache.org> on 2017/03/09 15:37:38 UTC

[jira] [Reopened] (CAY-2146) Vertical inheritance: record still inserted into parent db table when child validation fails

     [ https://issues.apache.org/jira/browse/CAY-2146?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nikita Timofeev reopened CAY-2146:
----------------------------------

Fix for this issue was wrong unfortunately, see CAY-2256.

And it turns out that we can't fix it now as we can't distinguish by any means flattened relationships' semantics (e.g. flattened relationship in vertical inheritance and in a join table).

Chain of toOne relationships can be optional even if all fields in that chain is mandatory (current fix was based on opposite assumption).

Until we will be able to fix this in a proper way custom validation should be used.

> Vertical inheritance: record still inserted into parent db table when child validation fails
> --------------------------------------------------------------------------------------------
>
>                 Key: CAY-2146
>                 URL: https://issues.apache.org/jira/browse/CAY-2146
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Core Library
>    Affects Versions: 4.0.M3, 4.0.M6
>            Reporter: Dzmitry Kazimirchyk
>            Assignee: Nikita Timofeev
>             Fix For: Undefined future
>
>         Attachments: vertical_inheritance_missing_child_test.patch
>
>
> When using vertical inheritance, if a child record has a mandatory relationship which is not set, commit will still go through without any errors. However, in database it will create only a record in the parent table without a corresponding child record.
> Attaching patch with a unit test demonstrating the issue.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)