java - How to set some values of list as optional in Spring mapping? -
i want make values of following list optional, following mapping done read columns excel sheet , store them db. columns may not come every time in excel sheet, want make columns remark12
, remarks13
optional:
<property name="remarkcolumns"> <list> <value>remarks1</value> <value>remarks2</value> <value>remarks3</value> <value>remarks4</value> <value>remarks5</value> <value>remarks6</value> </list> </property>
please solution.
either
use map rather list, key: string column name, value: boolean optional.
use sort of holder object 2 values (tuple2 or pair) - string , boolean. 1 should column name , other whether or not optional.
(worst option, imho). use prefix on column name indicate optionality , parse name string in own code.
Comments
Post a Comment