0
@Insert("insert into TABLE(c1, c2, c3) " +
        "values ( #{col1}, #{col2}, #{col3})")
Boolean save(Integer x, Integer y);

返回的布尔值将是 True 或 False,确定是否所有内容都已正确插入

4

1 回答 1

1

无论如何,你不能那样做。您需要使用int( 或Integer) 并将其与0.
如果result == 0,然后没有插入行。

@Insert("insert into TABLE(c1, c2, c3) values (#{col1}, #{col2}, #{col3})")
int save(final Integer x, final Integer y);

使用MyBatis,您可以定义一个自定义ResultHandler<T>

于 2019-02-20T18:04:33.413 回答