[ https://issues.apache.org/jira/browse/CAY-2882?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nikita Timofeev updated CAY-2882: --------------------------------- Fix Version/s: 4.2.3 (was: 4.2.2) > Dynamic cast of injected values in object initialization > -------------------------------------------------------- > > Key: CAY-2882 > URL: https://issues.apache.org/jira/browse/CAY-2882 > Project: Cayenne > Issue Type: Improvement > Components: Core Library > Reporter: Nikita Timofeev > Priority: Minor > Fix For: 4.2.3, 5.0-M2 > > > This improvement addresses the logic behind Cayenne injecting initial values > into created objects using expressions within the qualifier. Currently, this > logic is quite strict, as it simply passes scalar values as-is to the > "{{{}.writeProperty()"{}}} call. > This can result in issues such as a simple qualifier like {{"attr = 123"}} > throwing a {{ClassCastException}} if the {{"attr"}} type is not `int`, but > `long` or another numeric type. > The proposed change aims to simply allow for some basic widening conversions > for numeric types. Additionally, we might consider string to date/time value > conversions. > We have already laid some groundwork by allowing enum values as strings > (CAY-2399). -- This message was sent by Atlassian Jira (v8.20.10#820010)