Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Can ids in MyBatis' different mapping files be duplicated?


May 16, 2021 MyBatis



It can be repeated, but the namespace that needs to map files is different


Different Xml mapping files, id can be duplicated if namespace is configured, and namespace id not configured.

The reason namespace s id is used as the key of Map<String, MapperStatement> and if there is namespace there id left, then id to overwrite each other.

With namespace natural id be repeated, namespace different, namespace id naturally different.