We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
书中内容如下:
好多人都认为“如果不存在,才应该抛出异常”。
MyBatis 这种策略是为了防止同一个命名空间(所在的接口或者XML)配置多次导致重复读取。所以如果存在,就说明已经读取过了,不能再次读取。这里的逻辑是没有问题的。
验证的方法很简单,就是将同一个mapper配置两次就能看到效果。
The text was updated successfully, but these errors were encountered:
我个人认为,这里之所以会有“很多人”抛出这个问题,原因是这里确实很容易让人产生歧义,“如果对应的命名空间已经存在”,应该是“对应的命名空间已经被配置过”,这样子会更加严谨。
Sorry, something went wrong.
No branches or pull requests
书中内容如下:
好多人都认为“如果不存在,才应该抛出异常”。
为什么是存在才会抛出异常?
MyBatis 这种策略是为了防止同一个命名空间(所在的接口或者XML)配置多次导致重复读取。所以如果存在,就说明已经读取过了,不能再次读取。这里的逻辑是没有问题的。
验证的方法很简单,就是将同一个mapper配置两次就能看到效果。
The text was updated successfully, but these errors were encountered: