I have a requirement which may be little complicated. Think about I have bean class like:
public class A {
private String column1;
private String column2;
private Map<String,String> dynamicColumns = Maps.newHashMap();
....
getter&setter of column1 and column2
....
public void addExtraColumnValue(String column, String value) {
dynamicColumns.put(column, value);
}
}
The dynamicColumns is determined by the mapper sql like this:
<select id="queryDynamicColumns" parameterType="java.util.Map"
resultMap="aResultMap">
select colum1,colum2, ${dynamicColumns} from table_1
</select>
How do I write this resultMap?
I wonder do the mybatis can support this mapping in mapper configuration?( the dynamic columns value will put into the map. ) I do not get a good answer from the official website, and also I try the plugin which intercept the resultSetHandler and it seems it do not give a help for my case by looking the source code of DefaultResultSetHandler.