Skip to content

NH-3372: Enabled use of generated properties in combination with custom ... #186

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
Feb 22, 2015

Conversation

ggeurts
Copy link
Contributor

@ggeurts ggeurts commented Jan 10, 2013

...loader.

When a column is specified as generated, the AsbtractEntityPersister always generates SELECT statements to read the generated data. This does not work well when the entities are loaded with a named query by specifying a element in the entity mapping.

The solution is to fall back to reloading the entity using the named query if generated properties must be read.

@@ -3965,7 +3965,23 @@ public void ProcessInsertGeneratedProperties(object id, object entity, object[]
{
throw new AssertionFailure("no insert-generated properties");
}
ProcessGeneratedProperties(id, entity, state, session, sqlInsertGeneratedValuesSelectString, PropertyInsertGenerationInclusions);

session.Batcher.ExecuteBatch(); //force immediate execution of the insert
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need that?

it seems that it is from inlined code

@ggeurts
Copy link
Contributor Author

ggeurts commented Aug 18, 2014

Confirmed, the session.Batcher.ExecuteBatch() calls were already present in the original code.

@hazzik hazzik added this to the 4.1.0 milestone Nov 18, 2014
@hazzik
Copy link
Member

hazzik commented Nov 18, 2014

@ggeurts please rebase on top of master branch

@ggeurts ggeurts force-pushed the custom-generate branch 2 times, most recently from 295ea7b to 0644587 Compare November 18, 2014 12:36
Enables use of generated properties in combination with custom loader.
@ggeurts
Copy link
Contributor Author

ggeurts commented Nov 18, 2014

Rebase completed.

@hazzik hazzik merged commit ba21fbb into nhibernate:master Feb 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants