ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benoit, Ryan" <rben...@obsglobal.com>
Subject Error using <generate> for select
Date Thu, 16 Mar 2006 15:40:15 GMT
Hello,
I'm using Ibatis .NET v1.2.1 on a project and I am having some difficulty with the <generate>
for a select statement (in this case a select all). It seems that it is using the parameterMap
as the resultMap for some reason. I looked at the test under Oracle\StatementGenerate.cs and
found
 
public void TestSelectAll()
{
...
 
IList categorieList = sqlMap.QueryForList("SelectAllCategoryGenerate", null) as IList;
Assert.AreEqual(2, categorieList.Count);
}
 
This test of course runs fine, but I noticed that it is not testing the actual result coming
back, just the right number of categories that come back. So I changed the test a bit:
 
public void TestSelectAll()
{
...
 
IList categorieList = sqlMap.QueryForList("SelectAllCategoryGenerate", null) as IList;
Assert.AreEqual(2, categorieList.Count);
Assert.AreEqual("toto", ((Category)categorieList[0]).Name);
}
 
When I added the extra line it fails as the name is not copied back. Stepping through the
code I noticed that the sql that is actually generated only requests the columns that are
setup in the parameterMap instead of the columns that are specified in the resultMap. Therefore
the only value that is returned is the Id. 
 
I searched through the issue list and couldn't find an issue matching this so I thought I
would fire off an email to see if there is a fix already or if this is actually an issue.
 
Regards,
Ryan

Mime
View raw message