Sorry, no additional documentation is available.
First pass is mapping the simple properties plus ids.
Second pass is mapping relations, which must be done after all ids are mapped and known (so after the first pass).
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.
Hmm the collection id would require some special handling I suppose ... hard to tell without looking at the code.
As for filling in the data for persisting, you should probably create a specialized Mapper, like ComponentPropertyMapper combined with BasicCollectionMapper
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?
Very good news, Kristoffer!
We made a few tests, and it seems it´s working. But, of course, more people testing is always better! Do you wanna join us testing, Farid?
I agree, a code review by Adam would be great, to see if we didn't break something (I hope not )
yes, I can test
I have no experience with git :
please is it possible to download somewhere jars to test
or may be there is a maven (snapshot) repository ?
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.
thank you for the informations :
I will test on monday
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?
I will take a look on master revision.
I agree, more scenarios would be a good improval.
I am compiling the Kristoffers's master using gradle
I hope to give you a result of my user tests tomorrow.
If the branch is complete, can you create a pull request?