Skip to content

Full control of entities fetching in Criteria #1599

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
May 23, 2018
8 changes: 4 additions & 4 deletions src/NHibernate.Test/Async/Criteria/CriteriaQueryTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,7 @@ public async Task ProjectionsTestAsync()

object g = await (s.CreateCriteria(typeof(Student))
.Add(Expression.IdEq(667L))
.SetFetchMode("enrolments", FetchMode.Join)
.Fetch("enrolments")
//.setFetchMode("enrolments.course", FetchMode.JOIN) //TODO: would love to make that work...
.UniqueResultAsync());
Assert.AreSame(gavin, g);
Expand Down Expand Up @@ -1279,7 +1279,7 @@ public async Task CloningProjectionsTestAsync()

ICriteria criteriaToClone6 = s.CreateCriteria(typeof(Student))
.Add(Expression.IdEq(667L))
.SetFetchMode("enrolments", FetchMode.Join);
.Fetch("enrolments");
object g = await (CriteriaTransformer.Clone(criteriaToClone6)
.UniqueResultAsync());
Assert.AreSame(gavin, g);
Expand Down Expand Up @@ -2426,7 +2426,7 @@ public async Task SubcriteriaJoinTypesAsync()
}

result = await (session.CreateCriteria(typeof(Student))
.SetFetchMode("PreferredCourse", FetchMode.Join)
.Fetch("PreferredCourse")
.CreateCriteria("PreferredCourse", JoinType.LeftOuterJoin)
.AddOrder(Order.Asc("CourseCode"))
.ListAsync());
Expand All @@ -2436,7 +2436,7 @@ public async Task SubcriteriaJoinTypesAsync()
Assert.IsNotNull(result[2]);

result = await (session.CreateCriteria(typeof(Student))
.SetFetchMode("PreferredCourse", FetchMode.Join)
.Fetch("PreferredCourse")
.CreateAlias("PreferredCourse", "pc", JoinType.LeftOuterJoin)
.AddOrder(Order.Asc("pc.CourseCode"))
.ListAsync());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ public async Task OverrideEagerJoinAsync()
{
var persons =
await (s.QueryOver<Parent>()
.Fetch(p => p.Children).Lazy
.Fetch(SelectMode.SkipJoin, p => p.Children)
.ListAsync());

Assert.That(persons.Count, Is.EqualTo(1));
Expand Down
Loading