Skip to content
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

Add check that all headers specified by @ExcelCellName are present. #152

Merged

Conversation

Brutus5000
Copy link
Contributor

Configurable by a new flag in the PoijiOptions, disabled by default.

Configurable by a new flag in the PoijiOptions, disabled by default.
Copy link
Owner

@ozlerhakan ozlerhakan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you elaborate more about the option? and please make an example on readme.adoc if necessary

src/main/java/com/poiji/bind/Poiji.java Show resolved Hide resolved
@Brutus5000
Copy link
Contributor Author

Brutus5000 commented Apr 30, 2020

The underlying problem: If you add a field to your model referenced by name via @ExcelCellName, all values will be set to null if the column is missing. If the value is allowed to be null, you can't distinguish between "the user forgot to add the column" and "the user wants to set the value to null".

This can lead to unintentional data loss if
a) the user accidentially deletes or renames a column
b) you add columns to your data model after go live.

In our case it's due to backwards compatibility:
We use Poiji to import bulk patches to master data. Now the user has an existing import file and prepared some changes. At some point in time we add a new nullable field that already exists in the api for a longer time. If the user now imports his "old" format without the new colum, Poiji will parse the old file without errors, but the import will set all values of the new field with null override all existing values of the new column.

I will add an example to the docs.

@Brutus5000 Brutus5000 force-pushed the feature/mandatory-headername-check branch from 70d0cc2 to f11e08c Compare April 30, 2020 19:02
@ozlerhakan
Copy link
Owner

ozlerhakan commented May 1, 2020

thanks @Brutus5000 , it will be ready on 2.7.0

@ozlerhakan ozlerhakan merged commit 17bcac7 into ozlerhakan:master May 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants