diff --git a/src/NHibernate.Test/Async/Hql/EntityJoinHqlTest.cs b/src/NHibernate.Test/Async/Hql/EntityJoinHqlTest.cs
new file mode 100644
index 00000000000..c1bb4926d0d
--- /dev/null
+++ b/src/NHibernate.Test/Async/Hql/EntityJoinHqlTest.cs
@@ -0,0 +1,294 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by AsyncGenerator.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+
+using NHibernate.Cfg.MappingSchema;
+using NHibernate.Mapping.ByCode;
+using NHibernate.Test.Hql.EntityJoinHqlTestEntities;
+using NUnit.Framework;
+
+namespace NHibernate.Test.Hql
+{
+ using System.Threading.Tasks;
+ ///
+ /// Tests for explicit entity joins (not associated entities)
+ ///
+ [TestFixture]
+ public class EntityJoinHqlTestAsync : TestCaseMappingByCode
+ {
+ private const string _customEntityName = "CustomEntityName";
+ private EntityWithCompositeId _entityWithCompositeId;
+ private EntityWithNoAssociation _noAssociation;
+ private EntityCustomEntityName _entityWithCustomEntityName;
+
+ [Test]
+ public async Task CanJoinNotAssociatedEntityAsync()
+ {
+ using (var sqlLog = new SqlLogSpy())
+ using (var session = OpenSession())
+ {
+ EntityComplex entityComplex =
+ await (session
+ .CreateQuery("select ex " +
+ "from EntityWithNoAssociation root " +
+ "left join EntityComplex ex with root.Complex1Id = ex.Id")
+ .SetMaxResults(1)
+ .UniqueResultAsync());
+
+ Assert.That(entityComplex, Is.Not.Null);
+ Assert.That(NHibernateUtil.IsInitialized(entityComplex), Is.True);
+ Assert.That(sqlLog.Appender.GetEvents().Length, Is.EqualTo(1), "Only one SQL select is expected");
+ }
+ }
+
+ [Test]
+ public async Task EntityJoinForCompositeKeyAsync()
+ {
+ using (var sqlLog = new SqlLogSpy())
+ using (var session = OpenSession())
+ {
+ await (session.CreateQuery(
+ "select root, ejComposite from EntityWithNoAssociation root " +
+ "inner join EntityWithCompositeId ejComposite " +
+ " with (root.Composite1Key1 = ejComposite.Key.Id1 and root.Composite1Key2 = ejComposite.Key.Id2)")
+ .SetMaxResults(1).ListAsync());
+
+ var composite = await (session.LoadAsync(_entityWithCompositeId.Key));
+
+ Assert.That(composite, Is.Not.Null);
+ Assert.That(NHibernateUtil.IsInitialized(composite), Is.True, "Object must be initialized");
+ Assert.That(composite, Is.EqualTo(_entityWithCompositeId).Using((EntityWithCompositeId x, EntityWithCompositeId y) => (Equals(x.Key, y.Key) && Equals(x.Name, y.Name)) ? 0 : 1));
+ Assert.That(sqlLog.Appender.GetEvents().Length, Is.EqualTo(1), "Only one SQL select is expected");
+ }
+ }
+
+ [Test]
+ public async Task NullLeftEntityJoinAsync()
+ {
+ using (var sqlLog = new SqlLogSpy())
+ using (var session = OpenSession())
+ {
+ var objs =await (session.CreateQuery(
+ "select ejLeftNull, root " +
+ "from EntityWithNoAssociation root " +
+ "left join EntityComplex ejLeftNull with ejLeftNull.Id is null")
+ .SetMaxResults(1).UniqueResultAsync