Use a type handler. Better even, do not use nullValue at all and handle
this case in your domain logic. 1900 sounds like a magic value to me.

 

Niels

________________________________

From: Bhaarat Sharma [mailto:bhaara...@gmail.com] 
Sent: Thursday, February 11, 2010 9:24 PM
To: user-java@ibatis.apache.org
Subject: what to put in nullValue when date value is null

 

I have following in my result mapping:

 

<result property="updateDate" column="update_date"
javaType="java.sql.Date" jdbcType="DATE" nullValue="01/01/1900"/>

 

setUpdateDate is accepting parameter of type Date

update_date column can sometimes be null. In this case I want the date
to be 01/01/1900. 

 

It is giving me an error: java.lang.RuntimeException: Error setting
property 'setUpdateDate'

 

What is the way to put nullValue for a date field?

Reply via email to