出现错误的场景是我之前用mybatis自动生成工具生成了一遍,现在我因为业务需求需要在数据库里新增3张表,就需要生成这3张表的domain、dao、mapper,然后我再generatorConfig.xml里添加了这3个表的数据:
<table schema="" tableName="role" domainObjectName="Role"
enableCountByExample="true" enableUpdateByExample="true"
enableDeleteByExample="true" enableSelectByExample="true"
selectByExampleQueryId="true">
<property name="useActualColumnNames" value="false" />
<generatedKey column="id" sqlStatement="JDBC" identity="true" />
</table>
<table schema="" tableName="auth" domainObjectName="Auth"
enableCountByExample="true" enableUpdateByExample="true"
enableDeleteByExample="true" enableSelectByExample="true"
selectByExampleQueryId="true">
<property name="useActualColumnNames" value="false" />
<generatedKey column="id" sqlStatement="JDBC" identity="true" />
</table>
<table schema="" tableName="role_auth" domainObjectName="RoleAuth"
enableCountByExample="true" enableUpdateByExample="true"
enableDeleteByExample="true" enableSelectByExample="true"
selectByExampleQueryId="true">
<property name="useActualColumnNames" value="false" />
<generatedKey column="id" sqlStatement="JDBC" identity="true" />
</table>
然后一运行项目就报:nested exception is org.apache.ibatis.builder.BuilderException: Error parsin
还说什么xxx.xml格式错误啊,位于哪个目录下的xml不对啊,或者什么的
搞不懂为什么,然后我把它自动生成的和这3张表相关的东西给删了又能成功运行了。
然后我尝试了以下组合:
一次只生成一张表 :可以运行
生成两张表:不能
先生成一张表,再生成一张表都可以运行,到生成关联表的时候:不能运行
那我就想肯定是我上面的那个配置表的东西写得不对:但我什么也没改,又突然可以生成了。。。
mybatis真是奇怪的东西。。。