-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Envers and many-to-many mapping
PostPosted: Thu Jun 16, 2016 11:25 am 
Newbie

Joined: Thu Jun 16, 2016 10:07 am
Posts: 2
Using envers 4.3.8.Final

Have a parent entity with a list of child entities that are mapped via @ManyToMany. Envers creates the appropriate join table (Parent_Child_AUD) and values are being populated with what I believe are the correct revision numbers, however when I retrieve the parent at that revision, the list of child entities is always empty. Is this not a supported mapping in Envers?


Thanks for the help


Top
 Profile  
 
 Post subject: Re: Envers and many-to-many mapping
PostPosted: Fri Jun 17, 2016 1:41 pm 
Hibernate Team
Hibernate Team

Joined: Wed Jun 15, 2016 9:04 am
Posts: 24
Can you post your Parent/Child entities with the ManyToMany mapping and how you're triggering the revision?


Top
 Profile  
 
 Post subject: Re: Envers and many-to-many mapping
PostPosted: Mon Jun 20, 2016 11:44 am 
Newbie

Joined: Thu Jun 16, 2016 10:07 am
Posts: 2
Code:

@Entity
@Audited
public class Parent {

...

@ManyToMany(fetch = FetchType.EAGER)
   private List<Child> children;

...

}

@Entity
@Audited
public class Child {
...
}



Revisions are triggered via a @transactional method that calls:
Code:
parent.getChildren().addAll(childrenObjects);



Just to reiterate, a table Parent_Child_AUD is created and populated with data when the above action happens. However, say it creates a revision with revision number 47 (parent and children in the joining table all have the same number), upon retrieval of revision 47, the list of children is always empty.

Thank you for any assistance


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.