You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "Reina Ehrenbogen, Alejandro" <a....@ibermatica.com> on 2006/11/02 13:52:59 UTC

Complex collection properties w/ stored procedures

Hello,

I'm trying to do just as in page 36 of the dev manual:
<sqlMap namespace="SQL.procedimientos">

	<resultMap class="com.ibermatica.nia.db.ProcedimientoAlmacenado"
id="get-procedimientos">
		<result property="nombre" column="ROUTINE_NAME"/>
		<result property="listaDeParametros"
column="ROUTINE_NAME"
select="spObtenerListaDeParametrosDelProcedimiento"/>
	</resultMap>

	<resultMap
class="com.ibermatica.nia.db.ParametroDeProcedimientoAlmacenado"
id="get-parametros">
		<result property="nombre" column="PARAMETER_NAME"/>
		<result property="modo" column="PARAMETER_MODE"/>
		<result property="tipo" column="DATA_TYPE"/>
	</resultMap>

	<procedure id="spObtenerListaDeProcedimientos"
		parameterClass="java.lang.String"
		resultMap="get-procedimientos">
		<![CDATA[
{call spObtenerListaDeProcedimientos ()}
]]>
	</procedure>
	<procedure id="spObtenerListaDeParametrosDelProcedimiento"
		parameterClass="java.lang.String"
		resultMap="get-parametros">
		<![CDATA[
{call spObtenerListaDeParametrosDelProcedimiento (
#@NombreProcedimiento,jdbcType=VARCHAR,javaType=java.lang.String,mode=IN
#
)}
]]>
	</procedure>
</sqlMap>


The problem is it doesn't seem to like the reference to the procedure in
the first resultMap:
"There is no statement named spObtenerListaDeParametrosDelProcedimiento
in this SqlMap."

Which is a weird error, because if I reference a select with that name
(i.e. I substiture the procedure for a select) I get the same error.

So,
A) what is the problem?
B) can this be achieved w/ stored procedures only?

Thank you so much,
Alex