cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nikita Timofeev (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (CAY-2411) Wrong resolution of ExtendedType with ValueObjectType for inherited class
Date Wed, 21 Mar 2018 13:36:00 GMT

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

Nikita Timofeev closed CAY-2411.
--------------------------------
    Resolution: Fixed

*4.0*: https://github.com/apache/cayenne/commit/a16d7c435f86cb25c987d054704d8210ff855ae6
*4.1*: https://github.com/apache/cayenne/commit/fd0d06ec99713d1cd48e9e3367d3f8faf8066a4d

> Wrong resolution of ExtendedType with ValueObjectType for inherited class
> -------------------------------------------------------------------------
>
>                 Key: CAY-2411
>                 URL: https://issues.apache.org/jira/browse/CAY-2411
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Core Library
>    Affects Versions: 4.0.B2, 4.1.M1
>            Reporter: Nikita Timofeev
>            Assignee: Nikita Timofeev
>            Priority: Major
>             Fix For: 4.0.B3, 4.1.M2
>
>
> Real world problem: we have class {{Money}} that extends {{BigDecimal}} and {{ValueObjectType}}
that maps {{Money.class}} to {{BigDecimal.class}}.
>  But still {{BigDecimalType}} is used for attributes of type {{Money}}.
> The reason for this is that every registration of {{ExtendedType}} also creates factory
that maps all subclasses to that type. I.e. in our case this factory returns {{BigDecimalType}}
before we can get registered {{ValueObjectType}}.
> After some thoughts this subclass usage is a faulty behavior, as we can't assume anything
about compatibility of this two classes. E.g. in our case there is no chance that we can
interchange {{Money}} and {{BigDecimal}}. Moreover since *4.1* this behavior leads to immediate
{{ClassCastException}} when trying to write such property into an object.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message