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

Test for incorrect audit table insert on tables with tree structure #19

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

wojtek-abakus
Copy link
Contributor

As requested in Issue #18 I have made a test for this example.

@RogerKratz
Copy link
Collaborator

RogerKratz commented Jul 26, 2019

Isn't the mapping a bit strange? Which side of the relationship should be responsible for the parentKey, Parent or Children? In your example it's both of them...

Either let Children be responsible for the relationship by setting update="false" insert="false" on Parent mapping, or map Children with inverse="true" (then you have to map index property as well).

One could say that because nhib supports this "both side mapping", envers should as well. Doesn't feel like normal mapping though.

@wojtek-abakus
Copy link
Contributor Author

Yes you are right, in my original example using fluentnhibernate the collection was mapped as "inverse". I forgot to add this in the xml mapping file.

This doesn't change the test result though

@RogerKratz
Copy link
Collaborator

I didn't even know this mapping was allowed in NH Core? In your test, you have a bidirectional ref where "many-side" is marked with inverse=true - still that side is responsible for keeping track of the index position of the element? I was expecting to see a index mapped as a property on "one-side" to keep track of the index position if "many-side" was mapped with inverse=true (that would have worked in envers, I'm pretty sure without have tried it in your case).

@wojtek-abakus
Copy link
Contributor Author

Hello, any chance for a fix of this issue ? Or could you be so kind and point me some workaround ?

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