Hi, we are trying to implement https://hibernate.onjira.com/browse/HHH-6613
Is there a more comprehensive source code documentation?
We choose CollectionMetadataGenerator.addComponentAuditingData() as a starting point, but for now we only got simple elements collections mapped in the _AUD tables. And a bunch of Exceptions.
By the way, what are FirstPass / SecondPass?
We tried to implement both strategies for collections of components (Reference Documentation suggestions):
1. use an indexed collection, with the @IndexColumn annotation, or
2. provide a unique id for your elements with the @CollectionId annotation
The audit tables were created, but we couldn´t bind the collectionId in the _AUD table to the original one. The problem is that this id is not a property, and we couldn´t figure out how to deal with it. Any tips?
Another problem we faced: Nevertheless we can create the columns in the component audit table, we are not persisting anything.
In fact we don´t know the row of important objects like *MappingData, *Mapper, etc.
according to a comment at https://hibernate.onjira.com/browse/HHH-6613
Kristoffer Lundberg forked and branched based on the 3.6.7 tag, adding the requested support:
It would be nice to have this feature in an official release to have a complete entity audit
thank you for your work
Adriano, Thiago and me are collaborating and it feels like we're getting closer, or what do you say, Adriano?
I've fetched their changes and pushed them to the 3.6.7 branch:
I'm currently looking at porting that fix to master when I have the time.
It would be great if we could get some kind of code review from e.g. Adam, just to check that we haven't missed anything.
Would that be possible, Adam? Should the changes be ported to master before proceeding or would it be possible to look at code referenced above?
Unfortunally, there's no maven repository.
But using git is not that hard. You only haver to intall EGit, an eclipse plugin for Git.
After installing, go to Import > Git > Projects from Git
Type https://github.com/kristofferlundberg/hibernate-core.git in the text box, click Clone, Next, Select 3.6.7.Final_HHH-6613, Next, Next, Finish. Wait a lot. Ignore error messages.
Repeat the process, go to Import > Git > Projects from Git, but now, choose the project hibernate-core in the list instead of typing the repository name. Click Next, select "Import as general project", select hibernate-envers, Next, Finish.
Now you map your project to use this release instead envers jar, and adjust the hibernate-envers pom.xml file to find your local repositories.
I see work is progressing - fantastic!
Firstly, if the test suite is passing, then you didn't break anything (Unless you disabled half of the tests, that is).
Is the code ready for review? I don't think I'll be able to do it this year (between xmas and new year I'm having a long-overdue vacation), but maybe I'll ask Łukasz, who is also very familiar with Envers code, to take a look.
All tests are passing in both master and the 3.6.7 branch.
I just committed the ports from the 3.6.7 branch to my master: https://github.com/kristofferlundberg/hibernate-core/commits/master
Would be great with some additional feedback, e.g. if the tests cover enough scenarios etc
Adriano, could you have a quick look as well?