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: TypehandlerCallback
Date Fri, 14 Sep 2007 14:44:13 GMT
You're probably not posting the full exception stacktrace. Does iBATIS query your type handler?
You should handle the null case yourself...


-----Original Message-----
From: Härtel, Eric [mailto:E.Haertel@d-trust.net] 
Sent: vrijdag 14 september 2007 16:22
To: user-java@ibatis.apache.org
Subject: TypehandlerCallback

Another newbe question

I did generate some classes by JAXB, so I have a class Application with member time of XMLGregorianCalendar.
In the MS SQLServer database I want to store this object in is column of type 'datetime'.

I did implement the TypeHandlerCallback and put the following in the config files

in SqlMapConfig.xml
	callback="de.my.package.database.TimeTypeHandlerCallback" />

in SqlMap_Application.xml
<insert id="insertApplication" parameterClass="Application" >
	insert into APPLICATION (  
	values ( 
		#time# )  

The typehandler is loaded/constructed but not used during execution. I get the following error:

2007-09-14 16:05:41,530 ERROR - de.my.package.database.DatabaseTest.<init>(DatabaseTest.java:89)
[main]: com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred in SqlMap_Application.xml.  
--- The error occurred while applying a parameter map.  
--- Check the insertApplication-InlineParameterMap.  
--- Check the parameter mapping for the 'time' property.  
--- Cause: java.lang.NullPointerException

Trying different JDBC types (DATE, TIME) leads to the same result.

Can anybody give me a clue, where to look for the problem.

greetings, eric

View raw message