ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Francisco Exposito Aguilera" <fcoexpos...@hotmail.com>
Subject Issue in dynamic select
Date Wed, 18 Jul 2007 15:41:30 GMT
Hello,

I have a table where the attribute OET_Padre is a FK which sometimes is 
null.

I want to create a dynamic select which show all fields when OET_Padre is 
not null and all fields but this one when is null.

I´ve created a result map:

<resultMap id="mapElementosTransaccion" 
class="ads.orquestador.modelo.Elemento">
	<result property="oetID_" column="OET_ID"/>
	<result property="oetItemId_" column="OET_ITEMID"/>
	<result property="oetClase_" column="OET_CLASE"/>
	<result property="oetVersion_" column="OET_VERSION"/>
	<result property="oetOrqId_" column="OET_ORQ_ID"/>
	<result property="oetPadre_" column="OET_PADRE"/>
</resultMap>

and the select:

<select id="getElementosTransaccion" resultMap="mapElementosTransaccion" 
remapResults="true">
	SELECT
		OET_ID,
		OET_ItemID,
		OET_Clase,
		OET_Version,
		OET_ORQ_ID,
		OET_PADRE
	FROM ORQ_TRANS, ORQ_ELEM_TMP
	WHERE OTR_ID=#oetOrqId_#

but when the OET_PADRE is null I receive the error

--- Cause: java.lang.RuntimeException: Error setting property 'setOetPadre_' 
of 'ads.orquestador.modelo.Elemento@e7b3f2'.  Cause: 
java.lang.IllegalArgumentException

Can anybody help me? Thanks a lot.

_________________________________________________________________
Acepta el reto MSN Premium: Protección para tus hijos en internet. 
Descárgalo y pruébalo 2 meses gratis. 
http://join.msn.com?XAPID=1697&DI=1055&HL=Footer_mailsenviados_proteccioninfantil


Mime
View raw message