ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diran Ayandele <Adediran.Ayand...@Sun.COM>
Subject Re: Populating existing beans...
Date Tue, 12 Sep 2006 20:24:11 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000099">
Daniel, there is queryForMap functionality in iBatis.&nbsp; It looks like
this: SqlMapExecutor.queryForMap(statementName, parameterObject, key).&nbsp;
The key will be a column in your result map which could be your bean.id
property after the result map populates the bean.&nbsp; I am not sure what
you mean by populating existing beans, but I hope this helps.<br>
<br>
Diran<br>
<br>
Daniel Pitts wrote:
<blockquote
 cite="mid7E4302A18925394BAC32C7AD1ABE75D4E2FB08@CNET6.cnet.cnwk"
 type="cite">
  <pre wrap="">I have a 
Map&lt;Integer, MyBean&gt; byId;
Which was built by "byId.put(myBean.getId(), myBean);"
MyBean is the base class, there are many types of "MyBean" objects.

Is there a away to tell iBATIS to use the bean in "byId" map as the
result object? Or do I have to get the result, and copy the values over
myself?

I know it can be done with queryForObject(String, Object, Object); but I
need it for something like queryForList or queryForMap

Thanks,
Daniel.
  </pre>
</blockquote>
</body>
</html>

Mime
View raw message