Nikita Timofeev created CAY-2882:
------------------------------------

             Summary: 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
             Fix For: 4.2.2, 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)

Reply via email to