ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Allen <p...@cornell.edu>
Subject boolean type handler
Date Wed, 03 May 2006 16:31:33 GMT
I've seen some threads that describe how to make a custom type handler to 
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 handler 
is called, the parameter is always a Boolean object, even when I think it 
should be null because the Boolean the property from my bean is null.

Is there anyway around this?



Mime
View raw message