ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niels Beekman" <n.beek...@wis.nl>
Subject RE: Issue in dynamic select
Date Wed, 18 Jul 2007 21:45:33 GMT
The ideal solution would be to either remove the null-option on the column or to use a wrapper
class (i.e. Integer instead of int). If you do not want to make either modifications, you
could use the nullValue-attribute which puts a "magic" value into your bean.


-----Original Message-----
From: Francisco Exposito Aguilera [mailto:fcoexposito@hotmail.com] 
Sent: woensdag 18 juli 2007 22:29
To: user-java@ibatis.apache.org
Subject: RE: Issue in dynamic select

Yes, I know that the value, in this case, is a null. Sometimes the value is 
null and sometimes the value is not null, it depends and it is right. Then, 
what I want is obtain and set this value when it is not null and avoid it 
when it is null. Is there any way to do it? Is it possible?

>From: "Niels Beekman" <n.beekman@wis.nl>
>Reply-To: user-java@ibatis.apache.org
>To: <user-java@ibatis.apache.org>
>Subject: RE: Issue in dynamic select
>Date: Wed, 18 Jul 2007 20:52:57 +0200
>Either you are throwing the exception yourselves from the setter, or you 
>are trying to map a null value into a primitive field...
>Hope this helps,
>-----Original Message-----
>From: Francisco Exposito Aguilera [mailto:fcoexposito@hotmail.com]
>Sent: woensdag 18 juli 2007 17:42
>To: user-java@ibatis.apache.org
>Subject: Issue in dynamic select
>I have a table where the attribute OET_Padre is a FK which sometimes is
>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"
>	<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"/>
>and the select:
><select id="getElementosTransaccion" resultMap="mapElementosTransaccion"
>		OET_ID,
>		OET_ItemID,
>		OET_Clase,
>		OET_Version,
>	WHERE OTR_ID=#oetOrqId_#
>but when the OET_PADRE is null I receive the error
>--- Cause: java.lang.RuntimeException: Error setting property 
>of 'ads.orquestador.modelo.Elemento@e7b3f2'.  Cause:
>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.

Grandes éxitos, superhéroes, imitaciones, cine y TV... 
http://es.msn.kiwee.com/ Lo mejor para tu móvil.

View raw message