Skip to content

Support storeNullValue and storeEmptyValue for property that is annotated with @MultiField annotation #2952

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
donghuantang opened this issue Aug 4, 2024 · 0 comments · Fixed by #2960
Labels
type: enhancement A general enhancement

Comments

@donghuantang
Copy link

Currently storeNullValue and storeEmptyValue are supported for property that is annotated with the @field annotation. Need to also add support for property that is annotated with @MultiField annotation. Suggesting the following code change in the SimpleElasticsearchPersistentProperty class:

In the SimpleElasticsearchPersistentProperty constructer, update the assignment of storeNullValue and storeEmptyValue to also check the mainField parameters in the @MultiField annotation:

storeNullValue = (isField && getRequiredAnnotation(Field.class).storeNullValue()) || (isAnnotationPresent(MultiField.class) && getRequiredAnnotation(MultiField.class).mainField().storeNullValue()); storeEmptyValue = isField ? getRequiredAnnotation(Field.class).storeEmptyValue() : isAnnotationPresent(MultiField.class) ? getRequiredAnnotation(MultiField.class).mainField().storeEmptyValue() : true;

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 4, 2024
@sothawo sothawo added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
3 participants