ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yamil Bracho <yamilbra...@hotmail.com>
Subject Problems with Dynamic SQL
Date Wed, 22 Oct 2008 16:19:03 GMT

Hi.
I have this mapping

    <select id="SolAfi.findAllByBancoRif" 
            parameterClass="java.util.HashMap" 
            resultMap="mapSolAfi">
            <![CDATA[
                SELECT co_afiliacion,
                        nu_rif,
                        nb_empresa,
                        cce.solicitud_afiliacion.co_sector,
                        cce.sector.nb_sector,
                        cce.solicitud_afiliacion.co_banco,
                        cce.banco.nb_banco,
                        ti_solicitud,
                        st_solicitud,
                        fe_registro,
                        co_usuario,
                        fe_respuesta,
                        co_funcionario,
                        nb_nota
               FROM cce.solicitud_afiliacion, cce.banco, cce.sector
               WHERE cce.solicitud_afiliacion.co_banco = #codigoBanco# AND
                     cce.solicitud_afiliacion.co_banco = cce.banco.co_banco AND
                     cce.solicitud_afiliacion.co_sector = cce.sector.co_sector AND
            <dynamic prepend=" nu_rif IN ">
            <iterate property="rifList" open="('" close="')" conjunction=",  ">
                 #rifList[]#
            </iterate>
            </dynamic>
            ]]> 
    </select>

Where nu_rif is a String field and rifList is an array o String.
In java I did:

        Map parameters = new HashMap();
        parameters.put("codigoBanco", codigoBanco);
        
        parameters.put("rifList",  rifList.split(","));
        
        return getSqlMapClientTemplate().queryForList("SolAfi.findAllByBancoRif", parameters);

However I am getting  Error getting ordinal list from JavaBean. Cause java.lang.NumberFormatException:
For input string: ""
nu_rif are string like 'E12345', 'J4567', etc

When I take out the dynamic part the code works OK but I need the dynamic part..

Any hint ?

TIA

Yamil


_________________________________________________________________
¬°Entra en el Club oficial de Messenger y te enterar√°s de todas las novedades! 
http://www.vivelive.com/ilovemessenger
Mime
View raw message