ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Butler" <jeffgbut...@gmail.com>
Subject Re: Properties not loaded after first null (sometimes)
Date Wed, 16 Aug 2006 20:03:13 GMT
This probably isn't the issue, but you should know that VARCHAR2 is not a
JDBC type - it is Oracle specific.  iBATIS will essentially ignore this
value.

I've got a test coded coded that is very similar to this, and have no issues
with it.  But I'm also using iBATIS 2.2.0 and HSQLDB.  Try upgrading to see
if the problem has been fixed - version 2.1.6 is now fairly old.

Jeff Butler




On 8/16/06, Juan Alvarez <jaferrando@yahoo.com> wrote:
>
>   Thanks for your tips. Here's some more information around my problem.
>
> This is one of the problematic maps, as you can see, I've placed
> "fechaNacimiento" as the last property, and that's because if it's not and a
> null value appears in it, the following properties are not loaded with their
> values, remaining all null.
>
>
> <sqlMap namespace="busquedaClienteDAO">
>
> <!-- Result map con todos los datos del cliente -->
>
> <resultMap class="es.business.vo.ClienteVO" id="busquedaClienteMap">
>
> <result property="datosPersonales.idClient" javaType="java.lang.Integer"
> jdbcType="NUMERIC"
>
> column="IDCLIENT"/>
>
> <result property="datosPersonales.tipoIdent" javaType="java.lang.String"
> jdbcType="VARCHAR2"
>
> column="ID_TIP"/>
>
> <result property="datosPersonales.nombre" javaType="java.lang.String"
> jdbcType="VARCHAR2"
>
> column="NOMBRE"/>
>
> <result property="datosPersonales.apellido1" javaType="java.lang.String"
> jdbcType="VARCHAR2"
>
> column="APE1"/>
>
> <result property="datosPersonales.apellido2" javaType="java.lang.String"
> jdbcType="VARCHAR2"
>
> column="APE2"/>
>
> <result property="datosPersonales.nacionalidad" javaType="
> java.lang.Integer" jdbcType="NUMERIC"
>
> column="PAIS_NAC"/>
>
> <result property="datosPersonales.telefono" javaType="java.lang.String"
> jdbcType="VARCHAR2"
>
> column="TELEFONO"/>
>
> <result property="datosPersonales.movil" javaType="java.lang.String"
> jdbcType="VARCHAR2"
>
> column="TELMOVIL"/>
>
> <result property="datosPersonales.fax" javaType="java.lang.String"
> jdbcType="VARCHAR2"
>
> column="FAX"/>
>
> <result property="numSocio" javaType="java.lang.Integer"
> jdbcType="NUMERIC"
>
> column="SOCIO"/>
>
> <result property="datosPersonales.email" javaType="java.lang.String"
> jdbcType="VARCHAR2"
>
> column="EMAIL"/>
>
> <result property="localidadB" javaType="java.lang.Integer"
> jdbcType="NUMERIC"
>
> column="LOCAL"/>
>
> <result property="provinciaB" javaType="java.lang.Integer"
> jdbcType="NUMERIC"
>
> column="PROVIN"/>
>
> <result property="datosPersonales.fechaNacimiento" javaType="
> java.util.Date" jdbcType="DATE" column="FE_NACIMIEN"/>
>
> </resultMap>
>
>
>
> The database is Oracle 10g (also tested against 8.1.7) and the driver is
> the Orace JDBC thin driver that comes in OC4J 10.1.2.
>
>
>
> I'm doubtful about the involvement of the JDBC driver, as I've not seen
> this kind of behaviour when not using IBatis, and my network traffic
> sniffings show that the correct data is returned from the database. Anyway,
> please point me to any possible driver problem with Oracle.
>
>
>
> Regards
>
>
>  ----- Original Message ----
> From: Nathan Maves < nathan.maves@gmail.com>
> To: user-java@ibatis.apache.org; Juan Alvarez < jaferrando@yahoo.com>
> Sent: Tuesday, August 15, 2006 11:16:42 PM
> Subject: Re: Properties not loaded after first null (sometimes)
>
> Are you by any chance using a Custom Type Handler?  If so please post the
> CTH code.
>
> On 8/15/06, Juan Alvarez <jaferrando@yahoo.com > wrote:
> >
> >   Hi,
> >
> > I'm suffering some really strange phenomenon with Ibatis (2.1.6.589). In
> > some of my maps I discovered that when a particular field came with a null
> > valued from the database, all the properties that where defined after that
> > one in the map, where not feeded with the values retrieved from the
> > database. I checked not only in the database itself but also with a network
> > sniffer that the values where really coming. Magically if I place the
> > conflicting property as the last in the map, the rest took values properly.
> > This begun with some date typed fields and the workaround served me, but now
> > I've come across the same behaviour with other data types and I'm fearing I
> > cannot trust what I get from the database through Ibatis.
> >
> > Please help me as I'm forced into Ibatis by customer requirement and.
> >
> > Regards
> >
>
>
>
>
>

Mime
View raw message