Attribute "alisa" must be declared for element type "typeAlias".

学习mybatis,刚开始写配置文件mybatis-config.xml的时候,,最上面直接复制粘贴



alisa 报错:Attribute "alisa" must be declared for element type "typeAlias"


解决方法:将config改为Mapper:


改后错误提示消失


更正一下:这么改错误提示是消失了,,但在接下来的测试代码不好用。。。

新的改正方法:

原有的config不改变,只修改标签里的内容,会自动扫描com.learn.ssm.chapter3.pojo下的类型,使得后续在配置文件RoleMapper.xml使用resultType的时候,可以直接使用Role,而不必写全com.learn.ssm.chapter3.pojo


猜你喜欢

转载自blog.csdn.net/qq_33378853/article/details/80816238
今日推荐