首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Exception >

ibatis调用存储过程报java.lang.NullPointerException异常解决方法!

2014-01-26 
xml: parameterMap id invoiceInsertMap class map parameter property invoicestart jdbc

xml:
<parameterMap id= "invoiceInsertMap " class= "map " >
<parameter property= "invoicestart " jdbcType= "NUMBER " javaType= "java.lang.Long " mode= "IN "/>
<parameter property= "totalnum " jdbcType= "NUMBER " javaType= "java.lang.Integer " mode= "IN "/>
<parameter property= "invoicebookid " jdbcType= "NUMBER " javaType= "java.lang.Integer " mode= "IN "/>
</parameterMap>
<procedure id= "invoiceInsert " parameterMap= "invoiceInsertMap " >
{call invoiceInsert (?,?,?)}
</procedure>
调用:
public int invoiceInsert(InvoiceBook invoicebook) {
HashMap paramMap = new HashMap();
paramMap.put( "invoicestart ", invoicebook.getInvoicestart());
paramMap.put( "totalnum ", invoicebook.getInvoicedicid());
paramMap.put( "invoicebookid ", invoicebook.getInvoicedicid());
return invoiceDao.invoiceInsert(paramMap);
}

ibatis调用存储过程报报java.lang.NullPointerException

------解决方法--------------------------------------------------------
<parameterMap id= invoiceInsertMap class= map >
把 map写完整 (java.util.map)看看行不行
或者 <alias>
<typeAlias alias= "map " type= "java.util.map " />
</alias>
 

        

热点排行