In mybatis, if you want a id, associated with the primary key of another table, you must add a reference to the entity classes, namely private instance of a bean, or can not carry out a joint inquiry
<resultMap type="cn.taotao.bean.ZhouyiYao" id="WithIndexResultMap"> <id column="id" jdbcType="INTEGER" property="id" /> <result column="yaoId" jdbcType="INTEGER" property="yaoId" /> <result column="yaoContent" jdbcType="VARCHAR" property="yaoContent" /> <result column="yaoPic" jdbcType="VARCHAR" property="yaoPic"/> < Result column = "the orderId" the jdbcType = "INTEGER" Property = "the orderId" > </ Result > <-! Specifies the combined package the query field 64 Gua -> < Association Property = "zhouyiIndex" the javaType = "cn.taotao.bean.ZhouyiIndex" > // lowercase zhouyiIndex. < ID column = "yaoIndex" Property = "ID" /> < Result column = "bname" Property = "name" /> <
Error prompt, ZhouyiIndex no getter and setter methods, but the bean already have. The actual problem lies in
in association, property attributes, lowercase zhouyiIndex, I mistakenly written as uppercase ZhouyiIndex, he went to the capital of the constructor.