[ 
https://issues.apache.org/jira/browse/CAY-2146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15903461#comment-15903461
 ] 

Nikita Timofeev commented on CAY-2146:
--------------------------------------

Yes indeed {{!relationship.isToDependentEntity}} is a proper fix, but not for 
all cases. I was able to create entity that is both have {{toDepPk}} and 
_logically_ not mandatory relationship, that where the problem is. {{toDepPk}} 
is not specific for inheritance, actually no flags combination is really 
identify cases where we should validate and where shouldn't.
AFAIKS the only acceptable solution for now is to not validate flattened 
relationships at all.
More distant solutions can be following:
# Add some information to relationships (not sure what is really missing there)
# Or add explicit information for validation (that is more preferable)

> 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)

Reply via email to