ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Härtel, Eric <E.Haer...@d-trust.net>
Subject TypehandlerCallback
Date Fri, 14 Sep 2007 14:22:29 GMT
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