Skip to content

Commit a87a23b

Browse files
Fix #750 - AliasToBean failure with criteria grouping
1 parent 64cfc3b commit a87a23b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/NHibernate/Transform/AliasToBeanResultTransformer.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ public override IList TransformList(IList collection)
121121
/// same visibility and inheritance depth.</exception>
122122
private void SetProperty(string alias, object value, object resultObj)
123123
{
124+
if (alias == null)
125+
// Grouping properties in criteria are selected without alias, just ignore them.
126+
return;
127+
124128
if (TrySet(alias, value, resultObj, _propertiesByNameCaseSensitive))
125129
return;
126130
if (TrySet(alias, value, resultObj, _fieldsByNameCaseSensitive))
@@ -299,4 +303,4 @@ public override int GetHashCode()
299303

300304
#endregion
301305
}
302-
}
306+
}

0 commit comments

Comments
 (0)