Using Mybatis today, after configuring the XML file, an error is reported at startup, and the error message is as follows :
Caused by: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 9; columnNumber: 22; Property "order" with value "before" must have a list" BEFORE AFTER ". at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:253) at org.apache.ibatis.parsing.XPathParser.<init>(XPathParser.java:122) at org.apache.ibatis.builder.xml.XMLMapperBuilder.<init>(XMLMapperBuilder.java:75) at org.apache.ibatis.builder.xml.XMLConfigBuilder.mapperElement(XMLConfigBuilder.java:318) at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:104) ... 26 more
The insert configuration in xml is as follows :
<selectKey keyProperty="rptqueryId" order="before" resultType="long"> select rpt_seq$seq.nextval from dual </selectKey>
Error reason :
The order value must be one of BEFORE AFTER, case sensitive .
Correction: Change before to BEFORE .