mybatis中:元素类型为 "when" 的内容必须匹配 "=(include|trim|where|set|foreach|choose|if)"。
这个错误是什么意思,元素类型为"when"的内容?我的mapper.xml只有3个sql:selectid,user_name,passwordfromuserinser...
这个错误是什么意思,元素类型为"when" 的内容?
我的mapper.xml只有3个sql:
select id ,user_name ,password from user
insert into user(id,username,password,phone)VALUES (#{id} , #{username} ,#{password} ,#{phone})
select id ,user_name ,password from user where id = #{id}
这3个语句也会报这个错误吗? 展开
我的mapper.xml只有3个sql:
select id ,user_name ,password from user
insert into user(id,username,password,phone)VALUES (#{id} , #{username} ,#{password} ,#{phone})
select id ,user_name ,password from user where id = #{id}
这3个语句也会报这个错误吗? 展开
1个回答
展开全部
错误代码
[html] view plain copy
org.apache.ibatis.exceptions.PersistenceException:
### Error building SqlSession.
### Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 45; columnNumber: 17; 元素类型为没尘亮 "configuration" 的内容必须匹配 "(properties?,settings?,typeAliases?,typeHandlers?,objectFactory?,objectWrapperFactory?,plugins?,environments?,databaseIdProvider?,mappers?)"
原因:在配置mybatis-config.xml时,其中的节点是有顺序的,配置顺序依次为:
[html] view plain copy
properties/settings/typeAliases/枯宽typeHandlers/objectFactory/objectWrapperFactory/plugins/environments/兄帆databaseIdProvider/mappers
[html] view plain copy
org.apache.ibatis.exceptions.PersistenceException:
### Error building SqlSession.
### Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 45; columnNumber: 17; 元素类型为没尘亮 "configuration" 的内容必须匹配 "(properties?,settings?,typeAliases?,typeHandlers?,objectFactory?,objectWrapperFactory?,plugins?,environments?,databaseIdProvider?,mappers?)"
原因:在配置mybatis-config.xml时,其中的节点是有顺序的,配置顺序依次为:
[html] view plain copy
properties/settings/typeAliases/枯宽typeHandlers/objectFactory/objectWrapperFactory/plugins/environments/兄帆databaseIdProvider/mappers
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询