ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Sonke <...@tigrou.nl>
Subject Re: custom type handler w/ database-specific type
Date Sun, 08 Feb 2009 09:22:40 GMT
DO you need access to the DataSource or the Connection?

Rob


John Cartwright wrote:
> I think I've worked around this problem by explicitly specifying the 
> handler class w/in the in-line parameter map.
> Now I seem to have the problem of TypeHandler class needing access to 
> the DataSource...
>
> --john
>
>
> John Cartwright wrote:
>> Hello All,
>>
>> I'm trying to implement a custom type handler to support Oracle's
>> SDO_GEOMETRY type.  I've got it (apparently) working for retrieval of
>> data, but am having trouble w/ inserts into the database. Error says:
>>
>> org.springframework.jdbc.UncategorizedSQLException: SqlMapClient
>> operation; uncategorized SQLException for SQL []; SQL state [null];
>> error code [0];   --- The error occurred in 
>> gov/noaa/ngdc/mgg/ufn/Feature.xml.  --- The error occurred while 
>> applying a parameter map.  --- Check the 
>> Feature.insertShape-InlineParameterMap.  --- Check the parameter 
>> mapping for the 'geometry' property.  --- Cause: 
>> java.lang.NullPointerException; nested exception is
>> com.ibatis.common.jdbc.exception.NestedSQLException:   --- The error 
>> occurred in gov/noaa/ngdc/mgg/ufn/Feature.xml.  --- The error 
>> occurred while applying a parameter map.  --- Check the 
>> Feature.insertShape-InlineParameterMap.  --- Check the parameter 
>> mapping for the 'geometry' property.  --- Cause: 
>> java.lang.NullPointerException
>>
>> I'm registering a global type handler w/:
>>
>> <typeHandler
>> callback="gov.noaa.ngdc.mgg.ufn.dao.ibatis.SdoGeometryHandler"
>> javaType="com.vividsolutions.jts.geom.Geometry" 
>> jdbcType="SDO_GEOMETRY" />
>>
>>
>> and the inline parameter map for the "geometry" column uses:
>>
>> #geometry:SDO_GEOMETRY#
>>
>>
>> I've tried various other values for JDBC types: STRUCT, OTHER
>> w/o success.
>>
>> Can someone please help me understand a little better about the
>> connections between the the types in the parameter map and the
>> typehandler registration?
>>
>> Thanks!
>>
>> --john
>>

Mime
View raw message