一直提示java.lang.NullPointerException
public void queryAreaById(){ Area area = areaDao.queryAreaById(1); assertEquals("南平库",area.getArea_name()); }
尝试test这个queryAreaById函数时一直提示空指针异常
<select id="queryAreaById" resultType="com.cltj.cltj.entity.Area"> SELECT area_id,area_name,area_sum,create_time,last_edit_time FROM cltj_area where area_id = #{area_id} </select>
public interface AreaDao { List<Area> queryArea(); Area queryAreaById(int area_id); int insertArea(Area area); int updateArea(Area area); int deleteArea(int area_id); }