在 Mapper 接口上使用 @Mapper 注解,并指定 namespace 属性,即可为 Mapper 接口添加命名空间。

示例代码如下:

@Mapper(namespace = 'com.example.mapper')
public interface UserMapper {
    // Mapper方法...
}

在上述示例中,UserMapper 接口的命名空间被设置为 com.example.mapper

Mapper 接口如何添加命名空间?

原文地址: https://www.cveoy.top/t/topic/pZUC 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录