-
Notifications
You must be signed in to change notification settings - Fork 933
NH-3931 - Invalid order of child inserts #582
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
NH-3931 - Invalid order of child inserts #582
Conversation
9937f7b
to
f7adbc4
Compare
var propertyValues = action.State; | ||
var propertyTypes = action.Persister.ClassMetadata.PropertyTypes; | ||
var propertyTypes = action.Persister.EntityMetamodel?.PropertyTypes; |
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.
ClassMetadata
current NHibernate implementation is reaching the underlying EntityMetamodel.PropertyTypes
. As ClassMetadata
seems "more optional" than EntityMetamodel
, better use EntityMetamodel
directly. (CustomPersister
on NHibernate side does not provide any of them, but on Hibernate side, it does provide EntityMetamodel
while still not providing ClassMetadata
.)
200daa3
to
2d3d185
Compare
2d3d185
to
c2afa14
Compare
c2afa14
to
155f2f9
Compare
@fredericDelaporte next time, if you want to preserve multiple commits on a PR, please make a merge commit. So:
|
Ok, understood. |
Test cases and fix for NH-3931.
Test cases ported from HHH-9864, HHH-11216 and HHH-11585, relaxed in terms of batching expectations, and completed with some missing cases.
Fix not ported but elaborated from current NHibernate implementation.
This PR will hopefully replace the previous one, which was attempting a new sorting algorithm. This new algorithm was better at batching some cases, but was failing on many previously supported cases. And it was having an O(n^3) complexity over batched entities classes count, where current algorithm, even fixed, has an O(n) complexity over batched entities count.