ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bing Lu <mfcp...@yahoo.com>
Subject Re: result map property as hashmap
Date Thu, 13 Jul 2006 18:54:58 GMT
also I'm trying to do just one query 

in DAO I have queryForMap("getNames",
null,"role","name");

and the xml is <select id="getNames"
resultClass="java.util.HashMap" >
		select ROLE, NAME
		FROM TABLE1
		WHERE SEQNO=34567
	</select>
but in my resultclass I'm getting null, if I run the
query on the database itself it gives couple rows

can anyone point out what I'm doing wrong?

thanks
--- Bing Lu <mfcplus@yahoo.com> wrote:

> so what does column="EMP_ID" do in here, does it
> pass
> onto the next query as parameter? 
> 
> --- Debasish Dutta Roy <debasish.duttaroy@gmail.com>
> wrote:
> 
> > Yes you can do that.
> > In your first resultmap, you are going to provide
> > the
> > 
> > --- First resultmap ---
> > <result property="empId" column="EMP_ID"
> > select="getEmployeeDetails"/>
> > 
> > The select id "getEmployeeDetails" has a
> > corresponding resultClass is a
> > HashMap.
> > 
> > So this way you will only call one query the first
> > one and one of the result
> > will be a hash map.
> > 
> > On 7/13/06, Bing Lu <mfcplus@yahoo.com> wrote:
> > >
> > > Hi, I have a resultmap that's matching to a
> class,
> > one
> > > of the result property is going to be a hashmap
> > > populated from the database using another query,
> > I'm
> > > so sure about how to write this out in the xml
> > file.
> > > Can anyone help me out here?
> > >
> > > thanks a bunch
> > >
> > >
> __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam
> > protection around
> > > http://mail.yahoo.com
> > >
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Mime
View raw message