Skip to content

Avoid unnecessary persister lookup in Loader #1537

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 2 commits into from
Jan 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/NHibernate/Async/Loader/Loader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,9 @@ private async Task LoadFromResultSetAsync(DbDataReader rs, int i, object obj, st
object id = key.Identifier;

// Get the persister for the _subclass_
ILoadable persister = (ILoadable)Factory.GetEntityPersister(instanceClass);
ILoadable persister = instanceClass == rootPersister.EntityName
? rootPersister
: (ILoadable) Factory.GetEntityPersister(instanceClass);

if (Log.IsDebugEnabled())
{
Expand Down
4 changes: 3 additions & 1 deletion src/NHibernate/Loader/Loader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,9 @@ private void LoadFromResultSet(DbDataReader rs, int i, object obj, string instan
object id = key.Identifier;

// Get the persister for the _subclass_
ILoadable persister = (ILoadable)Factory.GetEntityPersister(instanceClass);
ILoadable persister = instanceClass == rootPersister.EntityName
? rootPersister
: (ILoadable) Factory.GetEntityPersister(instanceClass);

if (Log.IsDebugEnabled())
{
Expand Down