去为空默认NUL的值时报错  加了resultMap后 设置了  Nullvalue后还是不行 上码  大虾们先看看
<?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="ApplyGroup"> <typeAlias alias="applygroup" type="com.ceno.smile.domain.ApplyGroup" /> <resultMap id="applygroup" class="com.ceno.smile.domain.ApplyGroup">
<result column="id" property="id" jdbcType="Integer" nullValue=" "/>
<result column="APPLYID" property="applyId" jdbcType="Integer" nullValue=" "/>
<result column="MANGENAME" property="mangeName" jdbcType="String" nullValue=" "/>
<result column="APPLYCONTENT" property="applyContent" jdbcType="String"  nullValue=" "/>
<result column="APPLYTIME" property="applyTime" nullValue=" "/>
<result column="GROUPNAME" property="groupName" jdbcType="String"  nullValue=" " />

<result column="CREATETIME" property="createTime" nullValue=" "/>
<result column="PERMITMAN" property="permitMan" jdbcType="Integer" nullValue=" " />
<result column="REMARK1" property="re1" jdbcType="String" nullValue=" "/>
<result column="REMARK2" property="re2" jdbcType="String" nullValue=" "/>

<result column="ISPASS" property="isPass" nullValue=" "  />
</resultMap> <select id="getApplyGroupCount" resultClass="int">
    <![CDATA[
select count(*) from applygroup
]]>
</select>
<select id="getApplyGroupListForPage" resultClass="applygroup">
   <![CDATA[
select * from applygroup
]]>
</select> <delete id="delApplyGroupById" parameterClass="int">
 <![CDATA[
 delete from applygroup where id=#id#
 ]]>
</delete>
<!--批量删除  -->
<delete id="deleteApplyGroup" parameterClass="java.lang.String">
   <![CDATA[
delete from applygroup where id in
($ids:String$)
   ]]>
</delete>
</sqlMap>Model  对照看下 谢了public class ApplyGroup {
private int id;// id
private int applyId;// 申请人的id
private String mangeName;// 管理人群主名称
private String applyContent;// 申请内容 提交的申请
private String groupName;// 组名
private Date applyTime;// 申请时间
private Date createTime;// 创建时间
private int permitMan;// 审批同意人的id
private String re1;// 备注1
private String re2;// 备注2
private String isPass;// 审核是否通过 Y/Nerror:--- The error occurred in com/ceno/smile/persistence/sqlmapdao/sql/applygroup.xml.  
--- The error occurred while applying a result map.  
--- Check the getApplyGroupListForPage-AutoResultMap.  
--- The error happened while setting a property on the result object.  
Caused by: 
com.ibatis.common.exception.NestedRuntimeException: Error setting properties of '2愤怒的小鸟申请技术讨论null'.  Cause: java.lang.IllegalArgumentException
Caused by: java.lang.IllegalArgumentException
 数据库字段都为空 没有默认值 

解决方案 »

  1.   


     <resultMap id="applygroup" class="com.ceno.smile.domain.ApplyGroup">
    你这个定义都没用到。那定义了做什么?
      

  2.   

    类型不合法
    是不是你实体的int和Integer对不上导致的?改成对象试试
      

  3.   


    要用这个定义的话,<select id="getApplyGroupListForPage" resultClass="applygroup">
           <![CDATA[
            select * from applygroup
            ]]>
        </select>这里改为resultMap,如果还不行的话,你定义的 nullValue=" "这里Integer类型的加空串是不行的,要加0或者其他值试下
      

  4.   

    可以了  使用resultMap 把时间默认值去了  把int类型的nullvalue空字符去了 改成0就哦了
      

  5.   

    [Quote=引用 5 楼 richard_2010 的回复:]
    引用 4 楼 rightxiang 的回复:可以了 使用resultMap 把时间默认值去了 把int类型的nullvalue空字符去了 改成0就哦了
    记得结贴哈
    [/Qu可以加你qq吗