Java MyBatis中单个映射器方法中的多个语句

Java MyBatis中单个映射器方法中的多个语句,java,mysql,mybatis,ibatis,Java,Mysql,Mybatis,Ibatis,我有一个映射器方法来删除表中的所有记录。但首先我需要从关联的连接表中删除所有记录。这就是我所尝试的: @Delete("delete from COC_BLOCK_FIELD; delete from COC_BLOCK;") void deleteBlocks(); 这似乎是合理的,但MyBatis在处理我的映射程序时抛出了一个异常: Caused by: org.apache.ibatis.exceptions.PersistenceException: ### Error updati

我有一个映射器方法来删除表中的所有记录。但首先我需要从关联的连接表中删除所有记录。这就是我所尝试的:

@Delete("delete from COC_BLOCK_FIELD; delete from COC_BLOCK;")
void deleteBlocks();
这似乎是合理的,但MyBatis在处理我的映射程序时抛出了一个异常:

Caused by: org.apache.ibatis.exceptions.PersistenceException: 
### Error updating database.  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delete from COC_BLOCK' at line 1
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: delete from COC_BLOCK_FIELD; delete from COC_BLOCK;
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delete from COC_BLOCK' at line 1

我正在使用MyBatis 3.2.6、MySQL 5.5.35-1ubuntu1和MySQL Connector 5.1.26。

问题是我没有在JDBC URL中设置标志
allowMultiQueries=true