简体   繁体   English

通过mybatis进行映射

[英]Mapping through mybatis

I do mapping through mybatis. 我通过mybatis进行映射。 And I get the following error: 我得到以下错误:

The content of element type "resultMap" must match "(constructor ?, id *, result *, association *, collection *, discriminator?)"

Here is the contents of mapper.xml: 这是mapper.xml的内容:

<resultMap id="qMap" type="*.*.*.*.*.model.Q" >
    <result column="t" property="t"/>
    <result column="v" property="v"/>
    <result column="u" property="u"/>
</resultMap>

<resultMap id="itemsMap" type="*.*.*.*.*.model.Items">
    <result column="eName" property="eName"/>
    <result column="msM" property="msM"/>
    <result column="msMem" property="msMem"/>
    <result column="dTime" property="dTime"/>
    <result column="comm" property="comm"/>
    <result column="r" property="r"/>
    <result column="st" property="st"/>
    <collection property="q" javaType="*.*.*.*.*.model.Q" resultMap="qMap"/>
    <result column="co" property="co"/>
    <result column="ch" property="ch"/>
</resultMap>

Error indicates at the last line. 错误指示在最后一行。 Google did not help. Google没有帮助。 What ideas or suggestions are there for correcting such a mistake? 有什么想法或建议可以纠正这种错误? I'm sorry that I'm not uploading the full mapper.xml file, I also hidden the path to the model and do not post the code, because I can not show the code. 抱歉,我没有上载完整的mapper.xml文件,我也隐藏了模型的路径并且不发布代码,因为我无法显示代码。

Thanks in advance. 提前致谢。

This is a simple XML error. 这是一个简单的XML错误。 Move <collection... after the last <result... . <collection...移至最后一个<result...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM