wang alex
wang alex

Reputation: 41

resultMap alway report "must match constructor, id, result, asssociation, collection, discriminator"

My mybatis mapper file always report the following error message:

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

and here is my resultMap config:

<resultMap type="com.sp.sysmanage.domain.UserInfoDO" id="user">
    <result column="USER_ID" property="userID"/>  
    <result column="USER_USERNAME" property="userName"/>
    <result column="USER_PASSWORD" property="password"/>
    <result column="USER_FIRST_LOGIN" property="firstLogin"/>
    <result column="USER_LAST_LOGIN_DATE" property="lastLoginDate"/>
    <reulst column="USER_STATUS" property="status"/>
</resultMap>

Anyone can help to see what detailed error in my resultMap config?

Upvotes: 2

Views: 4359

Answers (2)

HibaHasan
HibaHasan

Reputation: 1493

As the error is saying:

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

the order is important:

first constructor

then <id>

then <result>

then <association>

then <collection>

then discriminator

Upvotes: 5

MohamedSanaulla
MohamedSanaulla

Reputation: 6242

There is a typo: <reulst> at the end, it should be <result>

Upvotes: 2

Related Questions