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

Pavel Tupitsyn updated IGNITE-20524:
------------------------------------
    Description: 
*KeyValueView.put* behavior with null value is inconsistent:
* Interface method does not have *@Nullable* annotation on *val*
* *KeyValueBinaryViewImpl* throws an exception when *val* is null
* *KeyValueViewImpl* does not throw exception right away; null is allowed for 
simple mapping (e.g. *<Long, String>*), but not allowed with POJOs (<PersonKey, 
PersonVal>)

This affects embedded and thin APIs equally.

It is understood that single-column mapping allows nulls to set nullable column 
values; however, overall situation is confusing. We can improve it in 3 ways:
# Keep existing behavior, improve javadoc
# Always disallow null value (NOTE: makes it impossible to work with nulls in 
2-column simple type mapping scenario)
# Always allow null value (set all mapped columns to null for POJO use case)

  was:
*KeyValueView.put* behavior with null value is inconsistent:
* Interface method does not have *@Nullable* annotation on *val*
* *KeyValueBinaryViewImpl* throws an exception when *val* is null
* *KeyValueViewImpl* does not throw exception right away; null is allowed for 
simple mapping (e.g. *<Long, String>*), but not allowed with POJOs (<PersonKey, 
PersonVal>)

This affects embedded and thin APIs equally.

It is understood that single-column mapping allows nulls to set nullable column 
values; however, overall situation is confusing. We can improve it in 3 ways:
# Keep existing behavior, improve javadoc
# Always disallow null value
# Always allow null value (set all mapped columns to null for POJO use case)


> Inconsistent behavior of KeyValueView.put with null value
> ---------------------------------------------------------
>
>                 Key: IGNITE-20524
>                 URL: https://issues.apache.org/jira/browse/IGNITE-20524
>             Project: Ignite
>          Issue Type: Improvement
>          Components: thin client
>    Affects Versions: 3.0.0-beta1
>            Reporter: Pavel Tupitsyn
>            Assignee: Pavel Tupitsyn
>            Priority: Critical
>              Labels: ignite-3
>             Fix For: 3.0.0-beta2
>
>
> *KeyValueView.put* behavior with null value is inconsistent:
> * Interface method does not have *@Nullable* annotation on *val*
> * *KeyValueBinaryViewImpl* throws an exception when *val* is null
> * *KeyValueViewImpl* does not throw exception right away; null is allowed for 
> simple mapping (e.g. *<Long, String>*), but not allowed with POJOs 
> (<PersonKey, PersonVal>)
> This affects embedded and thin APIs equally.
> It is understood that single-column mapping allows nulls to set nullable 
> column values; however, overall situation is confusing. We can improve it in 
> 3 ways:
> # Keep existing behavior, improve javadoc
> # Always disallow null value (NOTE: makes it impossible to work with nulls in 
> 2-column simple type mapping scenario)
> # Always allow null value (set all mapped columns to null for POJO use case)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to