mybatis中执行insert语句时报空指针

分布式表在mybatis中执行insert语句时报空指针
<insert id="insertDfs" parameterType="com.example.dolphindb.dto.InsertDfs">
     insert into ces_test values (#{id},#{deviceId},#{value},#{isFin},#{test})
</insert>
发现是这段代码的extraInt为null,这是为什么
private void initColumnBindValues(String tableName) throws SQLException {
try {
this.columnBindValues = new ArrayList<>();
BasicDictionary schema = (BasicDictionary) connection.run(String.format("schema(%s)", tableName));
BasicTable colDefs = (BasicTable) schema.get(new BasicString("colDefs"));
AbstractVector names = (AbstractVector) colDefs.getColumn("name");
BasicIntVector colDefsTypeInt = (BasicIntVector) colDefs.getColumn("typeInt");
BasicIntVector extraInt = (BasicIntVector) colDefs.getColumn("extra");
for (int i = 0; i < names.rows(); i++) {
String colName = names.getString(i).toLowerCase();
int typeInt = colDefsTypeInt.getInt(i);
Entity.DATA_TYPE type = Entity.DATA_TYPE.valueOf(typeInt);
int extra = extraInt.getInt(i);
ColumnBindValue columnBindValue = new ColumnBindValue(i, colName, type, extra);
this.columnBindValues.add(columnBindValue);
}
} catch (IOException e) {
throw new SQLException(e);
}
}
请先 登录 后评论

2 个回答

wfHuang

能提供完整的报错堆栈和mytatis MVC调用debug截图么

请先 登录 后评论
peter

麻烦提供下建库建表的语句,我们复现下这个问题。

请先 登录 后评论
  • 2 关注
  • 0 收藏,177 浏览
  • zz 提出于 2024-03-19 14:20

相似问题