1. Points to note in configuration file Sqlmap.xml
Like what:
<?xml version= "1.0" encoding= "UTF-8"? ><! DOCTYPE sqlmap Public "-//ibatis.apache.org//dtd SQL Map 2.0//en" "Http://ibatis.apache.org/dtd/sql-map-2.dtd" > <sqlmap namespace= "Dbo_hishop_oren" > <resultmap id= "orderretuenresult" class= " Com.temp.model.OrderRetuenModel "> <result column=" retuid "property="Retuid"Jdbctype=" VARCHAR "/> <result column=" OrderId "property="OrderID"Jdbctype=" VARCHAR "/> <result column=" UserId "property="userid"Jdbctype=" INTEGER "/> <result column=" Linkman "property="Linkman"Jdbctype=" VARCHAR "/> </resultMap> <sql id=" Where_clause "> <isnotempty prepend=" and "property="Retuid"> Retuid = #retuid: varchar# </isNotEmpty> <isnotempty prepend=" and "property="OrderID"> OrderId = #orderid: varchar# </isNotEmpty> <isnotempty prepend=" and "property="userid> UserId = #userid: integer# </isNotEmpty> <isnotempty prepend= "and" property= "Linkman"> Linkman = #linkman: varchar# </isNotEmpty> <isnotempty property=" Criteria "> <iterate P roperty= "Criteria" conjunction= "and" prepend= "and" open= "(" close= ")" > $criteria [].paramname$ $criteria [].arith metictype$ #criteria [].paramvalue# </iterate> </isNotEmpty> </sql>
Where the value of property= is the name of the attribute field in the JavaBean , be sure to match the name of the property in the Java bean, otherwise there will be an error exception, it is not easy to find errors, so remember
A summary of the attention points of the configuration file of Ibatis framework