It‘s likely that neither a Result Type nor a Result Map was specified.
It's likely that neither a Result Type nor a Result Map was specified.很可能既没有指定结果类型,也没有指定结果映射。在编写mybatis的xml文件时 如编写查询语句一定要加resultType 或resultMap 。如下:加parameterType<select id="getSidStarDelayed" resu
·
It's likely that neither a Result Type nor a Result Map was specified.
很可能既没有指定结果类型,也没有指定结果映射。
在编写mybatis的xml文件时 如编写查询语句
一定要加resultType 或resultMap 。如下:
加parameterType
<select id="getName" resultType="com.wys.pojo.NameBean" parameterType="com.wys.pojo.NameBeanVo">
select now_time as nowTime, name_type as nameType from test_1
<where>
<if test="nameType!=null and nameType!=''">
name_type=#{nameType}
</if>
<if test="name !=null and name !=''">
and name =#{name}
</if>
</where>
</select>
加resultMap
<resultMap id="result" type="com.wys.pojo.NameBean">
<result column="now_time" property="nowTime"/>
<result column="name_type" property="nameType"/>
</resultMap>
<select id="getName" resultMap="result" parameterType="com.wys.pojo.NameBeanVo">
select * from test_1
<where>
<if test="nameType!=null and nameType!=''">
name_type=#{nameType}
</if>
<if test="name !=null and name !=''">
and name =#{name}
</if>
</where>
</select>
如果没有加,可能会出现 It’s likely that neither a Result Type nor a Result Map was specified.错误
更多推荐



所有评论(0)