1 2 Previous Next 20 Replies Latest reply on Jan 23, 2012 7:29 AM by kristoffer.lundberg

    Source code javadoc

    drsaturno

      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?

       

      Thanks.

        • 1. Re: Source code javadoc
          adamw

          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).

           

          Adam

          • 2. Re: Source code javadoc
            drsaturno

            Thanks Adam,

             

            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.

            • 3. Re: Source code javadoc
              adamw

              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

               

              Adam

              • 4. Re: Source code javadoc
                faridc

                Hello

                 

                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:

                https://github.com/kristofferlundberg/hibernate-core/commit/e88029194ad34f403e8f3fbe80f56e09678a34d4

                 

                It would be nice to have this feature in an official release to have a complete entity audit

                 

                thank you for your work

                • 5. Re: Source code javadoc
                  kristoffer.lundberg

                  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:

                   

                  https://github.com/kristofferlundberg/hibernate-core/commits/3.6.7.Final_HHH-6613

                   

                  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?

                  • 6. Re: Source code javadoc
                    drsaturno

                    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 )

                    • 7. Re: Source code javadoc
                      faridc

                      Hello Adriano

                       

                      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 ?

                       

                      good-bye

                      • 8. Re: Source code javadoc
                        drsaturno

                        Hi Farid,

                         

                        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.

                         

                        And voilà!

                         

                        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.

                        • 9. Re: Source code javadoc
                          faridc

                          Hello Adriano

                           

                          thank you for the informations :

                          I will test on monday

                           

                          good bye

                          • 10. Re: Source code javadoc
                            adamw

                            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.

                             

                            Adam

                            • 11. Re: Source code javadoc
                              kristoffer.lundberg

                              Great!

                               

                              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?

                              • 12. Re: Source code javadoc
                                drsaturno

                                Ok, Kristoffer,

                                 

                                I will take a look on master revision.

                                 

                                I agree, more scenarios would be a good improval.

                                 

                                Thanks!

                                • 13. Re: Source code javadoc
                                  faridc

                                  Hello

                                   

                                  I am compiling the Kristoffers's master using gradle

                                   

                                  I hope to give you a result of my user tests tomorrow.

                                   

                                  good-bye

                                  • 14. Re: Source code javadoc
                                    adamw

                                    If the branch is complete, can you create a pull request?

                                     

                                    Adam

                                    1 2 Previous Next