Author: gbayon
Date: Sat Dec 23 02:25:05 2006
New Revision: 489875
URL: http://svn.apache.org/viewvc?view=rev&rev=489875
Log:
Fix for IBATISNET-199 Add support for QueryForObject and GroupBy
Updated change log
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/GroupByTest.cs
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/ChangeLog.txt
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/MappedStatement.cs
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/GroupByTest.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/GroupByTest.cs?view=diff&rev=489875&r1=489874&r2=489875
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/GroupByTest.cs
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/GroupByTest.cs
Sat Dec 23 02:25:05 2006
@@ -70,6 +70,21 @@
Assert.AreEqual(2, product.Items.Count);
}
+ [Test]
+ public void TestForQueryForObject()
+ {
+ Domain.Petshop.Category cat =
(Domain.Petshop.Category)sqlMap.QueryForObject("GetFish", null);
+ Assert.IsNotNull(cat);
+
+ Assert.AreEqual("FISH", cat.Id);
+ Assert.AreEqual("Fish", cat.Name);
+ Assert.IsNotNull(cat.Products, "Expected product list.");
+ Assert.AreEqual(4, cat.Products.Count);
+
+ Domain.Petshop.Product product =
(Domain.Petshop.Product)cat.Products[0];
+ Assert.AreEqual(2, product.Items.Count);
+ }
+
#if dotnet2
[Test]
@@ -79,6 +94,21 @@
Assert.AreEqual(1, list.Count);
Domain.Petshop.Category cat = (Domain.Petshop.Category)list[0];
+ Assert.AreEqual("FISH", cat.Id);
+ Assert.AreEqual("Fish", cat.Name);
+ Assert.IsNotNull(cat.GenericProducts, "Expected product list.");
+ Assert.AreEqual(4, cat.GenericProducts.Count);
+
+ Domain.Petshop.Product product = cat.GenericProducts[0];
+ Assert.AreEqual(2, product.GenericItems.Count);
+ }
+
+ [Test]
+ public void TestForQueryForObjectGeneric()
+ {
+ Domain.Petshop.Category cat =
sqlMap.QueryForObject<Domain.Petshop.Category>("GetFishGeneric", null);
+ Assert.IsNotNull(cat);
+
Assert.AreEqual("FISH", cat.Id);
Assert.AreEqual("Fish", cat.Name);
Assert.IsNotNull(cat.GenericProducts, "Expected product list.");
Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper/ChangeLog.txt
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/ChangeLog.txt?view=diff&rev=489875&r1=489874&r2=489875
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper/ChangeLog.txt (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper/ChangeLog.txt Sat Dec 23
02:25:05 2006
@@ -4,15 +4,26 @@
1.6.0 - BETA
------------------------------
Issues
+- IBATISNET-198 : Cache key for accessors can be ambiguous and can cause cast
exceptions
+- IBATISNET-193 : Implement N+1 Select resolution with groupBy attribute
- IBATISNET-191 : Allows Cache for Procedure / Statement tag
-- IBATISNET-179 : Allow procedure statement without parameterMap
+- IBATISNET-189 : Missing Typehandler for nullable timespan
+- IBATISNET-188 : MethodAccessException in emitted code
+- IBATISNET-186 : Fix select on argument property on constructor tag
- IBATISNET-184 : Invalid support for public/protected field in result property
-
+- IBATISNET-179 : Allow procedure statement without parameterMap
+- IBATISNET-178 : ConfigWatcherHandler does not wok with the changes of
DataMaps files
+- IBATISNET-116 : Add support for iBATIS for Java's <include> tag in sql map
files.
+- IBATISNET-104 : QueryForXXX do not check cache before opening/closing
connection
+
Improvements/Changes
+- IBATISNET-199 : Add support for QueryForObject and GroupBy
+- IBATISNET-196 : Improved stored procedure parameters analysis
- IBATISNET-192 : Add support for IDictionary<K, V> QueryForDictionary<K,
V>(...)
- IBATISNET-185 : Allow custom ISessionStore
-- IBATISNET-181 : Allow mapping of multiple result sets
+- IBATISNET-181 : Allow mapping of multiple resulSet
- IBATISNET-180 : Extends use of ISqlMapper in DataMapper + allow use of a
custom ISqlMapper
+
- Remove obsoletes methods on SqlMapper : Configure(XmlDocument document),
Configure(), Configure(string resource),
ConfigureAndWatch(ConfigureHandler configureDelegate),
ConfigureAndWatch(string resource, ConfigureHandler configureDelegate)
- Mark QueryForPaginatedList as Obsolete on SqlMapper
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/MappedStatement.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/MappedStatement.cs?view=diff&rev=489875&r1=489874&r2=489875
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/MappedStatement.cs
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/MappedStatement.cs
Sat Dec 23 02:25:05 2006
@@ -237,7 +237,11 @@
{
while (reader.Read())
{
- result = _resultStrategy.Process(request, ref reader,
resultObject);
+ object obj = _resultStrategy.Process(request, ref
reader, resultObject);
+ if (obj != BaseStrategy.SKIP)
+ {
+ result = obj;
+ }
}
}
catch
@@ -323,7 +327,11 @@
{
while (reader.Read())
{
- result = (T)_resultStrategy.Process(request, ref
reader, resultObject);
+ object obj = _resultStrategy.Process(request, ref
reader, resultObject);
+ if (obj != BaseStrategy.SKIP)
+ {
+ result = (T)obj;
+ }
}
}
catch