0
我的類別字段看起來像如何使用MyBatis的批註插入簡單數組表字段
private int[] points = new int[]{1,1,1,1};
我InnoDB表看起來像
CREATE TABLE `test` (
`points` VARCHAR(70) NULL DEFAULT '0'
)
我嘗試插入行表thith這個映射器(I」米使用註釋)
@Insert({
"REPLACE INTO test (points)",
"values (#points},javaType=java.util.Array,typeHandler=org.apache.ibatis.type.ArrayTypeHandler)"
})
和獲取java.lang.IllegalStateException: No typehandler found for property points
我如何正確地在一個字段中插入這個數組? 我可以將數組轉換爲字符串,但我想使用mybatis機會。