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: boolean type handler
Date Wed, 03 May 2006 16:35:01 GMT

Could you post the actual typehandler code and the piece of SQLMap where
you use it?

-----Original Message-----
From: Paul Allen [mailto:pea1@cornell.edu] 
Sent: woensdag 3 mei 2006 18:32
To: user-java@ibatis.apache.org
Subject: boolean type handler 

I've seen some threads that describe how to make a custom type handler
map from a Boolean bean property to a CHAR SQL type and I've implemented

one version of them. What I am trying to get is this mapping:

object property value --> DB value
Boolean.TRUE --> "1"
Boolean.FALSE --> "0"
null --> null

However I keep coming up with the same problem, by the time the 
setParameter(ParameterSetter setter, Object parameter) method of my
is called, the parameter is always a Boolean object, even when I think
should be null because the Boolean the property from my bean is null.

Is there anyway around this?

View raw message