Skip to content

Commit e8d7df4

Browse files
committed
Small refactoring to simplify 6.0 migration and adjust comments
1 parent ea69189 commit e8d7df4

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

src/NHibernate/Loader/OuterJoinableAssociation.cs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ internal string GetSelectFragment(string entitySuffix, string collectionSuffix,
203203
{
204204
case SelectMode.Undefined:
205205
case SelectMode.Fetch:
206+
//TODO 6.0: Just drop obsolete parts making all 3 cases handled by the same code
206207
#pragma warning disable 618
207208
return Joinable.SelectFragment(
208209
next?.Joinable,
@@ -228,16 +229,17 @@ internal string GetSelectFragment(string entitySuffix, string collectionSuffix,
228229

229230
case SelectMode.FetchLazyPropertyGroup:
230231
return ReflectHelper.CastOrThrow<ISupportLazyPropsJoinable>(Joinable, "fetch lazy property")
231-
.SelectFragment(
232-
next?.Joinable,
233-
next?.RHSAlias,
234-
RHSAlias,
235-
collectionSuffix,
236-
ShouldFetchCollectionPersister(),
237-
new EntityLoadInfo(entitySuffix)
238-
{
239-
LazyProperties = EntityFetchLazyProperties
240-
});
232+
.SelectFragment(
233+
next?.Joinable,
234+
next?.RHSAlias,
235+
RHSAlias,
236+
collectionSuffix,
237+
ShouldFetchCollectionPersister(),
238+
new EntityLoadInfo(entitySuffix)
239+
{
240+
LazyProperties = EntityFetchLazyProperties,
241+
IncludeLazyProps = SelectMode == SelectMode.FetchLazyProperties,
242+
});
241243
case SelectMode.ChildFetch:
242244
return ReflectHelper.CastOrThrow<ISupportSelectModeJoinable>(Joinable, "child fetch select mode")
243245
.IdentifierSelectFragment(RHSAlias, entitySuffix);

src/NHibernate/SelectMode.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ public enum SelectMode
3333
JoinOnly,
3434

3535
/// <summary>
36-
/// Skips fetching for eagerly mapped association (no-op for lazy association).
36+
/// Skips fetching for fetch="join" association (no-op for lazy association).
3737
/// </summary>
3838
Skip,
3939

4040
/// <summary>
41-
/// Fetch lazy property group
41+
/// Fetch lazy property group (provide path to lazy property to be fetched)
4242
/// Note: To fetch single property it must be mapped with unique fetch group (lazy-group)
4343
/// </summary>
4444
FetchLazyPropertyGroup,

0 commit comments

Comments
 (0)