Skip to content
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

Support formula on one-to-many map-key #1760

Merged

Conversation

fredericDelaporte
Copy link
Member

Fix a null reference exception in OneToManyPersister

Spotted while testing #1759

Fix a null reference exception in OneToManyPersister

Spotted while testing nhibernate#1759
@@ -76,7 +76,7 @@ protected override SqlCommandInfo GenerateDeleteString()
update.SetJoin(ownerPersister.TableName, KeyColumnNames, KeyType, JoinColumnNames, ownerPersister.GetPropertyColumnNames(CollectionType.LHSPropertyName));
}

if (HasIndex)
if (HasIndex && !indexContainsFormula)
Copy link
Member Author

@fredericDelaporte fredericDelaporte Jun 19, 2018

Choose a reason for hiding this comment

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

This is from GenerateDeleteRowString own logic. It seems the GenerateDeleteString case was just forgotten.
By the way nullifying the index columns makes surely sense for an one-to-many list mapping, but for an one-to-many map mapping, this looks as a bad thing to me...
Anyway with this PR we will have a workaround if the nullifying of a map-key causes troubles: mapping it as a formula instead.

This comment was marked as off-topic.

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants