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

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


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


解决方法:将config改为Mapper:

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

改后错误提示消失


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

新的改正方法:

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

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

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

相关文章:

  • 2021-11-28
  • 2022-12-23
  • 2022-12-23
  • 2021-10-01
  • 2022-12-23
  • 2021-05-21
  • 2021-06-28
  • 2021-04-11
猜你喜欢
  • 2021-12-14
  • 2021-05-31
  • 2021-11-25
  • 2021-08-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-14
相关资源
相似解决方案