Skip to content

Fixes for NH-3480 and NH-3453 #378

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 5 commits into from
Feb 22, 2015
Merged

Fixes for NH-3480 and NH-3453 #378

merged 5 commits into from
Feb 22, 2015

Conversation

JKeyser
Copy link
Contributor

@JKeyser JKeyser commented Nov 21, 2014

@hazzik, I have rebased the previous pull request (#211) for these issues.

@hazzik hazzik added this to the 4.1.0 milestone Dec 2, 2014
@hazzik hazzik merged commit ad206cf into nhibernate:master Feb 22, 2015
update.SetIdentityColumn(KeyColumnNames, KeyType);
}
else
{
Copy link
Member

Choose a reason for hiding this comment

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

@JKeyser Why do we need following join?

It fails on SQLite, because it does not support joins at the update statements.

Copy link
Member

Choose a reason for hiding this comment

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

Can it be just

.AddColumns(JoinColumnNames, "null");
.SetIdentityColumn(KeyColumnNames, KeyType);

??

@hazzik
Copy link
Member

hazzik commented Feb 25, 2015

Also, tests are failing on PostgreSQL and MySQL, and this is a regression.

@hazzik
Copy link
Member

hazzik commented Feb 25, 2015

@JKeyser can you please review #404?

fredericDelaporte added a commit to fredericDelaporte/nhibernate-core that referenced this pull request Oct 14, 2018
The NH-3453 part is not reverted. The NH-3480 part was wrecking the
many-to-many mapping with property ref.
fredericDelaporte added a commit to fredericDelaporte/nhibernate-core that referenced this pull request Oct 15, 2018
The NH-3453 part is not reverted. The NH-3480 part was wrecking the
many-to-many mapping with property ref.
fredericDelaporte added a commit to fredericDelaporte/nhibernate-core that referenced this pull request Oct 23, 2018
The NH-3453 part is not reverted. The NH-3480 part was wrecking the
many-to-many mapping with property ref.
fredericDelaporte added a commit to fredericDelaporte/nhibernate-core that referenced this pull request Oct 24, 2018
The NH-3453 part is not reverted. The NH-3480 part was wrecking the
many-to-many mapping with property ref.
fredericDelaporte added a commit that referenced this pull request Oct 24, 2018
Fix property ref handling

* Revert #378 - NH-3480
* Fix component equality failure
* Resolve collection owner correctly in case of property-ref
* Resolve owner's key correctly in case of property-ref
@@ -467,8 +467,7 @@ public override bool IsDirty(object old, object current, bool[] checkable, ISess
}

/// <summary>
/// Get the key value from the owning entity instance, usually the identifier, but might be some
/// other unique key, in the case of property-ref
/// Get the key value from the owning entity instance.
/// </summary>
public object GetKeyOfOwner(object owner, ISessionImplementor session)
Copy link
Member

Choose a reason for hiding this comment

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

Ceasing to return the referenced property value from this method causes bug in the many-to-many case, causing it to insert in the many-to-many table the identifier instead of the referenced property value.

This "fix" is now, in my opinion, clearly wrong. It should have at least renamed this method GetIdOfOwner (but do we really need such a method?) We need an actual GetKeyOfOwner accounting for property-ref in the case of many-to-many.

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.

3 participants