mybatis异常:org.apache.ibatis.binding.BindingException: Parameter 'param' not found. Available param

org.apache.ibatis.binding.BindingException: Parameter 'param' not found. Available parameters are [param1, form]


原因:一般都是配置文件写错了,比如从Dao层传给Mapper层的参数是一个对象如下

	//根据条件查询hero
	public List getHeroInformation(@Param("hero") Hero hero);

传到Mapper层的是一个对象而我Mapper.xml   where的写法错误示例如下




	
		
		
		
		
		
		
		
		
   	
	
	
		t.id,t.hero_name,t.hero_skills,t.skill_plus_point,t.hero_out_of_the_pack,t.hero_legend_story,t.hero_orientation,t.hero_attribute
	
	
	
	
正确的写法如下

mybatis异常:org.apache.ibatis.binding.BindingException: Parameter 'param' not found. Available param_第1张图片

注意要用对象。属性   取值

参看:
http://mybatis-user.963551.n3.nabble.com/Parameters-in-resultType-map-td4026012.html

你可能感兴趣的:(开发中一些常见问题)