You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by "Varathan, Gunaselan" <Gu...@umassmed.edu> on 2005/08/01 15:43:26 UTC

Result set map to multiple object

Hi,
I am new to ibatis, I am trying to map a result of a query to multiple
java objects.

Can any one give me an example of how to do this.

Example,
Select id, name, address from person;

And I want to map to 

Id and name to Person object 
Address to address object.

Also pls provide an equivalent way of accessing to multiple objects once
query has returned its results. either to use queryForObject or
queryForList


Thanks
Guna


Re: Result set map to multiple object

Posted by Daniel Henrique Ferreira e Silva <dh...@gmail.com>.
Hi Guna,

Have you read iBATIS DevGuide? It has all the info you need to solve
your issue. Point your browser to http://ibatis.apache.org and get it.
It's been way useful for me ;-)

Cheers,
Daniel Silva.

On 8/2/05, Meindert <me...@pastelebusiness.com> wrote:
> Did you have a look at the jpetstore as an example?
> http://sourceforge.net/projects/ibatisjpetstore/
> 
> -----Original Message-----
> From: Varathan, Gunaselan [mailto:Gunaselan.Varathan@umassmed.edu]
> Sent: 01 August 2005 03:43 PM
> To: user-java@ibatis.apache.org
> Subject: Result set map to multiple object
> 
> Hi,
> I am new to ibatis, I am trying to map a result of a query to multiple
> java objects.
> 
> Can any one give me an example of how to do this.
> 
> Example,
> Select id, name, address from person;
> 
> And I want to map to
> 
> Id and name to Person object
> Address to address object.
> 
> Also pls provide an equivalent way of accessing to multiple objects once
> query has returned its results. either to use queryForObject or
> queryForList
> 
> 
> Thanks
> Guna
> 
> --
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.338 / Virus Database: 267.9.8/61 - Release Date: 01/08/2005
> 
> 
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.338 / Virus Database: 267.9.8/61 - Release Date: 01/08/2005
> 
> 
>

RE: Result set map to multiple object

Posted by Meindert <me...@pastelebusiness.com>.
Did you have a look at the jpetstore as an example?
http://sourceforge.net/projects/ibatisjpetstore/

-----Original Message-----
From: Varathan, Gunaselan [mailto:Gunaselan.Varathan@umassmed.edu] 
Sent: 01 August 2005 03:43 PM
To: user-java@ibatis.apache.org
Subject: Result set map to multiple object

Hi,
I am new to ibatis, I am trying to map a result of a query to multiple
java objects.

Can any one give me an example of how to do this.

Example,
Select id, name, address from person;

And I want to map to 

Id and name to Person object 
Address to address object.

Also pls provide an equivalent way of accessing to multiple objects once
query has returned its results. either to use queryForObject or
queryForList


Thanks
Guna

-- 
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.9.8/61 - Release Date: 01/08/2005
 

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.9.8/61 - Release Date: 01/08/2005