我所遇到的报错发生在多表查询时 主要错误是由于下面的
<resultMap id="get" type="teacher"> <result property="name" column="tname"/> <result property="teacher.tid" column="tid"/> 就是这个语句造成的错误 这样写的话编译器会将teacher.tid作为一个形参去处理然而我们这个 domain并没有这个东西 实际这里应该写的是我们domain里面的形参 <result property="tid" column="tid"/>这样就对了
<collection property="student" ofType="student"> <result property="id" column="sid"/> <result property="name" column="sname"/> </collection> </resultMap>