Skip to content

Commit 5e00be6

Browse files
fixup! Fix shortcomings of QueryBatcher initial implementation
Fix SQL query for broader compatibility
1 parent 8883f6c commit 5e00be6

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/NHibernate.Test/Async/Futures/QueryBatchFixture.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,11 @@ public async Task AutoDiscoverWorksWithFutureAsync()
286286
{
287287
var future =
288288
s
289-
.CreateSQLQuery("select count(*) as count from EntitySimpleChild where Name like :pattern")
290-
.AddScalar("count", NHibernateUtil.Int64)
289+
.CreateSQLQuery("select count(*) as childCount from EntitySimpleChild where Name like :pattern")
290+
.AddScalar("childCount", NHibernateUtil.Int64)
291291
.SetString("pattern", "Chi%")
292292
.SetCacheable(true)
293-
.FutureValue<long>();
293+
.FutureValue<long>();
294294

295295
Assert.That(await (future.GetValueAsync()), Is.EqualTo(2L), "From DB");
296296
await (t.CommitAsync());
@@ -301,8 +301,8 @@ public async Task AutoDiscoverWorksWithFutureAsync()
301301
{
302302
var future =
303303
s
304-
.CreateSQLQuery("select count(*) as count from EntitySimpleChild where Name like :pattern")
305-
.AddScalar("count", NHibernateUtil.Int64)
304+
.CreateSQLQuery("select count(*) as childCount from EntitySimpleChild where Name like :pattern")
305+
.AddScalar("childCount", NHibernateUtil.Int64)
306306
.SetString("pattern", "Chi%")
307307
.SetCacheable(true)
308308
.FutureValue<long>();

src/NHibernate.Test/Futures/QueryBatchFixture.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,11 +274,11 @@ public void AutoDiscoverWorksWithFuture()
274274
{
275275
var future =
276276
s
277-
.CreateSQLQuery("select count(*) as count from EntitySimpleChild where Name like :pattern")
278-
.AddScalar("count", NHibernateUtil.Int64)
277+
.CreateSQLQuery("select count(*) as childCount from EntitySimpleChild where Name like :pattern")
278+
.AddScalar("childCount", NHibernateUtil.Int64)
279279
.SetString("pattern", "Chi%")
280280
.SetCacheable(true)
281-
.FutureValue<long>();
281+
.FutureValue<long>();
282282

283283
Assert.That(future.Value, Is.EqualTo(2L), "From DB");
284284
t.Commit();
@@ -289,8 +289,8 @@ public void AutoDiscoverWorksWithFuture()
289289
{
290290
var future =
291291
s
292-
.CreateSQLQuery("select count(*) as count from EntitySimpleChild where Name like :pattern")
293-
.AddScalar("count", NHibernateUtil.Int64)
292+
.CreateSQLQuery("select count(*) as childCount from EntitySimpleChild where Name like :pattern")
293+
.AddScalar("childCount", NHibernateUtil.Int64)
294294
.SetString("pattern", "Chi%")
295295
.SetCacheable(true)
296296
.FutureValue<long>();

0 commit comments

Comments
 (0)