4 Replies Latest reply on Sep 12, 2010 3:03 AM by vipavel

    ManyToMany lazy loading

    vipavel

      Hi,

      I have a hierarchy of objects that I want to audit. This hierarchy can have up to 7 levels.

      Each relation from parent to child is MTM LAZY. I would like to get the parent including all the children inside.

      How can I tell envers to do that without changing the existing code?

       

      Thanks,

      Pavel

        • 1. Re: ManyToMany lazy loading
          adamw

          Unforutnately now all relations are lazy-loaded.

           

          Adam

          • 2. Re: ManyToMany lazy loading
            vipavel

            So does that mean that by performing "getChildren()" on the retrieved entity I will get the children related to the original entity and not the audited one?

            I saw somewhere inside the object the audited query for the child object loading. is it possible to invoke it somehow?

            • 3. Re: ManyToMany lazy loading
              adamw

              Hello,

              no, you'll get the children of the entity as they were at the given point of time (given revision). However, the children are loaded lazily, that is using a separate query on first invocation.

              Why would you need direct access to the query?

               

              Adam

              • 4. Re: ManyToMany lazy loading
                vipavel

                Hi,

                Thank you for your answer.

                I don't need the access to this query, but I was wondering if this is the query that is used by "getChildren()".

                As I see from your answer and by some tests I've ran it was successful guess.

                 

                Pavel