Do you have this working with straight JDBC? From the error message, I'd
say that iBATIS doesn't know how to map a JDBC column type of CURSOR
into Java. As it is requesting, try supplying a TypeHandler for that
JDBC type.
--
Guy Rouillier
Well, I took this as one of those oft-spoken-about learning experiences
:). I finally got an example working, starting with your stored
function. I changed it to a stored procedure and altered for the data I
had available.
My mapper function:
Object findById(ServicePlaneRef servicePlaneRef);
I tried making this void, but iBATIS is passing *something* back; it's
always null for me.
mapper.xml:
<resultMap id="servicePlaneMap"
type="com.ibatisdemo.db.ServicePlaneRef" >
... column definitions
</resultMap>
<select statementType="CALLABLE" id="findById"
parameterType="com.ibatisdemo.db.ServicePlaneRef"
resultMap="servicePlaneMap">
{ call
get_service_plane_by_id(
#{servicePlaneId},
#{resultSet, jdbcType=CURSOR, mode=OUT,
javaType=java.sql.ResultSet, resultMap=servicePlaneMap}
)}
</select>
And the definition of ServicePlaneRef.resultSet:
private List<ServicePlaneRef> resultSet;
So, iBATIS appears to take the returned cursor, convert it to a
java.sql.ResultSet, and then via the ResultMap convert that ResultSet to
an ArrayList of the type identified by the ResultMap.
The documentation or the wiki would benefit from a complete example.
--
Guy Rouillier