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

  1. use map rather list, key: string column name, value: boolean optional.

  2. use sort of holder object 2 values (tuple2 or pair) - string , boolean. 1 should column name , other whether or not optional.

  3. (worst option, imho). use prefix on column name indicate optionality , parse name string in own code.


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -