-
Notifications
You must be signed in to change notification settings - Fork 933
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
Conversation
update.SetIdentityColumn(KeyColumnNames, KeyType); | ||
} | ||
else | ||
{ |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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);
??
Also, tests are failing on PostgreSQL and MySQL, and this is a regression. |
The NH-3453 part is not reverted. The NH-3480 part was wrecking the many-to-many mapping with property ref.
The NH-3453 part is not reverted. The NH-3480 part was wrecking the many-to-many mapping with property ref.
The NH-3453 part is not reverted. The NH-3480 part was wrecking the many-to-many mapping with property ref.
The NH-3453 part is not reverted. The NH-3480 part was wrecking the many-to-many mapping with property ref.
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) |
There was a problem hiding this comment.
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.
@hazzik, I have rebased the previous pull request (#211) for these issues.