You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please do a quick search on Github issues first, the feature you are about to request might have already been requested.
Expected Behavior
Make FlatFileItemReaderBuilder detect whether the target type is Kotlin data class and sets proper FieldSetMapper which is not BeanWrapperFieldSetMapper.
RecordFieldSetMapper works with a Kotlin data class but we might be better to introduce a new dedicated FieldSetMapper.
Current Behavior
The FlatFileItemReaderBuilder only detects whether the target type is record or not. So it sets the BeanWrapperFieldSetMapper which instantiates the target type by the default constructor (no-args) and causes NotWritablePropertyException:
Please do a quick search on Github issues first, the feature you are about to request might have already been requested.
Expected Behavior
Make
FlatFileItemReaderBuilder
detect whether the target type is Kotlin data class and sets properFieldSetMapper
which is notBeanWrapperFieldSetMapper
.RecordFieldSetMapper
works with a Kotlin data class but we might be better to introduce a new dedicatedFieldSetMapper
.Current Behavior
The
FlatFileItemReaderBuilder
only detects whether the target type is record or not. So it sets theBeanWrapperFieldSetMapper
which instantiates the target type by the default constructor (no-args) and causesNotWritablePropertyException
:spring-batch/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/builder/FlatFileItemReaderBuilder.java
Lines 463 to 467 in d1bd771
Context
As a workaround, we might make the data class fields nullable and mutable like:
but as you know, it doesn't leverage the Kotlin's features.
The text was updated successfully, but these errors were encountered: