ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pecelis, Sergio" <Pecel...@Toepfer.com>
Subject RE: Error getting another object in resultMap
Date Wed, 27 Sep 2006 21:11:51 GMT
Thanks for answer! 

I reorganize my packages and separate the resultMaps in two sqlMaps and then it Works!

 

 

<sqlMap namespace="Documento">

 

<typeAlias alias="documento" type="ar.com.toepfer.utils.model.Documento"/>

 

<resultMap id="documentoMap" class="documento">

      <result property="nroDocumento" column="NRODOC"/> 

</resultMap>

 

</sqlMap>

 

 

<sqlMap namespace="Proveedor">

 

<typeAlias alias="proveedor" type="ar.com.toepfer.utils.model.Proveedor"/>

 

<resultMap id="proveedorMap" class="proveedor">

      <result property="idProveedor" column="NROPRO"/> 

      <result property="descripcion" column="RAZSOC"/> 

      <result property="documento" resultMap="Documento.documentoMap"/>      

</resultMap>

<select id="getProveedorDoc" parameterClass="proveedor" resultMap="proveedorMap">

SELECT NROPRO, RAZSOC, NRODOC

      FROM QS36F."TG.6A1F1"

      WHERE NROPRO = #idProveedor#

</select>

 

 

-----Mensaje original-----
De: Jeff Butler [mailto:jeffgbutler@gmail.com] 
Enviado el: MiƩrcoles, 27 de Septiembre de 2006 01:50 p.m.
Para: user-java@ibatis.apache.org
Asunto: Re: Error getting another object in resultMap

 

Does Proveedor have getter/setter methods for documento that are of type Documento?  Like
this:

 

Documento getDocumento() {}

void setDocumento(Documento documento){}

 

iBATIS 2.2.0 will only try to make a Collection if getDocumento() returns some class that
implements java.util.Collection.

 

Jeff Butler

 

On 9/27/06, Pecelis, Sergio <PecelisS@toepfer.com> wrote: 

Error instantiating collection property for mapping 'documento'

I have ibatis 2.2.0

I am trying to retrieve and populate an object which itself contains 
another object.

The main object is 'Proveedor', the secondary object is 'Documento'.  I
refer to the secondary object in the main resultmap by its result map
name.

The resultMap is configured as:

<sqlMap namespace="Proveedor">

<typeAlias alias="proveedor"
type="ar.com.toepfer.utils.model.Proveedor"/>
<typeAlias alias="documento"
type=" ar.com.toepfer.utils.model.Documento"/>

<cacheModel id="proveedorCache" type="LRU">
   <flushInterval hours="24"/>
   <property name="size" value="100"/> 
</cacheModel>

<resultMap id="proveedorMap" class="proveedor">
       <result property="idProveedor" column="NROPRO"/>
       <result property="descripcion" column="RAZSOC"/> 
       <result property="documento"
resultMap="Proveedor.documentoMap"/>
</resultMap>

<resultMap id="documentoMap" class="documento">
       <result property="nroDocumento" column="NRODOC"/> 
</resultMap>

<select id="getProveedorDoc" parameterClass="proveedor"
resultMap="proveedorMap">
SELECT NROPRO, RAZSOC, NRODOC
       FROM QS36F."TG.6A1F1" 
       WHERE NROPRO = #idProveedor#
</select>

</sqlMap>

___________________________________________
CONFIDENTIALITY NOTICE
This e-mail and any files and/or attachments transmitted with it are strictly confidential
and intended solely for the use of the addressee. They may contain privileged and confidential
information and, if you are not the intended recipient, you are hereby notified that any dissemination
or copying and any use or disclosure of the information contained therein is strictly prohibited
and may be illegal. If you are not the intended recipient, please notify mail@toepfer.com
immediately and delete this message and any files and/or attachments thereto.

 


Mime
View raw message