The way with the parameter map works fine. I stepped through the iBatis framework in debug manner. When the problem occurs it seems that the localSqlMapSession doesn´t have the right typeHandlerFactory/typeHandlerMap How erver, my problem is solved. Thanks a lot :-)
> -----Original Message----- > From: Lisa Jenkins [mailto:[EMAIL PROTECTED] > Sent: Friday, September 14, 2007 5:00 PM > To: [email protected] > Subject: Re: TypehandlerCallback > > Eric, > > You can define a parameter map where you can assign the > callbackhandler > to the parameter. This how I got mine to work on insert statements. > Other question is, is the time field a nullable field in your db? > > Example, > > listed in the order they are to be inserted. > > <parameterMap id="doExpandListParameterMap" > class="com.investoranalytics.web.db.doExpandList"> > <parameter property="nodes" > typeHandler="com.investoranalytics.util.ibatis.StringArrayType > Handler"/> > <parameter property="reportCode"/> > <parameter property="reportSubId"/> > <parameter property="userId"/> > </parameterMap> > > <insert id="insertExpandList" > parameterMap="doExpandListParameterMap"> > INSERT INTO report.expand_list > (NODES,REPORT_CODE,REPORT_SUB_ID,USER_ID) VALUES (?,?,?,?) > </insert> > > > Lisa > Niels Beekman wrote: > > You're probably not posting the full exception stacktrace. > Does iBATIS query your type handler? You should handle the > null case yourself... > > > > Niels > > > > -----Original Message----- > > From: Härtel, Eric [mailto:[EMAIL PROTECTED] > > Sent: vrijdag 14 september 2007 16:22 > > To: [email protected] > > 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 > > =================== > > <typeHandler > > javaType="javax.xml.datatype.XMLGregorianCalendar" > > jdbcType="TIMESTAMP" > > callback="de.my.package.database.TimeTypeHandlerCallback" /> > > > > in SqlMap_Application.xml > > ========================= > > <insert id="insertApplication" parameterClass="Application" > > > insert into APPLICATION ( > > APPLICATION_TIME ) > > values ( > > #time# ) > > </insert> > > > > > > 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:8 > 9) [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 > > > >
