com.dao.YonghuDao.getYonghu1 attempted to return null from a method with a primitive return type (in

Mapper method 'com.dao.YonghuDao.getYonghu1 attempted to return null from a method with a primitive return type (int).
一般是在xml文件里面返回的数据出现了错误,需要int类型的

<select id="getYonghu1" resultType="com.entity.Yonghu" parameterType="com.entity.Yonghu">
		SELECT COUNT(*)
		FROM Yonghu AS s
		WHERE s.yonghuming =#{
    
    yonghuming}
	</select>

上面的代码就出现了问题resultType=“com.entity.Yonghu”,需要将其修改成 parameterType=“com.entity.Yonghu” resultType=“java.lang.Integer”

猜你喜欢

转载自blog.csdn.net/qq_46199553/article/details/121376774