You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Roland Szabó (Jira)" <ji...@apache.org> on 2021/03/20 12:21:00 UTC

[jira] [Updated] (CAY-2704) Vertical inheritance with Embeddedables looses ObjAttribute information

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

Roland Szabó updated CAY-2704:
------------------------------
    Description: 
I tried to implement a simple vertical inheritance with two object entities. The super entity has an Embeddable as one of its object attribute with no attribute overrides.

I noticed the problem when trying to #validateForSave in the child entity. The ObjEntity#getAttributes call collect all the attributes, and also consults the super entity, but in ObjEntity#appendAttributes it creates a copy of the attribute descriptor. When doing this, it creates a uniform ObjAttribute, independent of the original type (eg. EmbeddedAttribute).

Later, the validation method makes an exception for embedded attributes, but in my case, this exception does not get triggered and results in a CayenneRuntimeException thrown because the "ObjAttribute does not have a corresponding DbAttribute".

I also get this error in the Modeler, and this seems to me a bug.

Also, I'm using 4.2.M2, but there is no such version here in Jira... :)

  was:
I tried to implement a simple vertical inheritance with two object entities. The super entity has an Embeddable as one of its object attribute with no attribute overrides.

I noticed the problem when trying to #validateForSave in the child entity. The ObjEntity#getAttributes call collect all the attributes, and also consults the super entity, but in ObjEntity#appendAttributes it creates a copy of the attribute descriptor. When doing this, it creates a uniform ObjAttribute, independent of the original type (eg. EmbeddedAttribute).

Later, the validation method makes an exception for embedded attributes, but in my case, this exception does not get triggered and results in a CayenneRuntimeException thrown because the "ObjAttribute does not have a corresponding DbAttribute".

I also get this error in the Modeler, and this seems for me a bug.

Also, I'm using 4.2.M2, but there is no such version here in Jira... :)


> Vertical inheritance with Embeddedables looses ObjAttribute information
> -----------------------------------------------------------------------
>
>                 Key: CAY-2704
>                 URL: https://issues.apache.org/jira/browse/CAY-2704
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Core Library
>    Affects Versions: 4.2.M3
>            Reporter: Roland Szabó
>            Priority: Major
>
> I tried to implement a simple vertical inheritance with two object entities. The super entity has an Embeddable as one of its object attribute with no attribute overrides.
> I noticed the problem when trying to #validateForSave in the child entity. The ObjEntity#getAttributes call collect all the attributes, and also consults the super entity, but in ObjEntity#appendAttributes it creates a copy of the attribute descriptor. When doing this, it creates a uniform ObjAttribute, independent of the original type (eg. EmbeddedAttribute).
> Later, the validation method makes an exception for embedded attributes, but in my case, this exception does not get triggered and results in a CayenneRuntimeException thrown because the "ObjAttribute does not have a corresponding DbAttribute".
> I also get this error in the Modeler, and this seems to me a bug.
> Also, I'm using 4.2.M2, but there is no such version here in Jira... :)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)