ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niels Beekman" <n.beek...@wis.nl>
Subject RE: what to put in nullValue when date value is null
Date Thu, 11 Feb 2010 22:24:46 GMT
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:bhaarat.s@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?


Mime
View raw message