title: How to get object values from @ManyToOne relation in @Audited table
body: <p>There were probably similar questions, but I couldn't find the answer I need.</p>
  <p>I have 2 entities, lets call them <code>EntityA</code> and <code>EntityB</code>. <code>EntityA</code> would look something like this:</p>
  <pre><code>@Entity
  @Table(name = &quot;entity_a&quot;)
  @Audited
  public class EntityA implements Serializable {
    @Id
    private Long id;
  
    @ManyToOne(cascade = CascadeType.ALL)
    @JoinColumn(name = &quot;entity_a_id&quot;)
    @Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED)
    private EntityB entityB;
  
    public EntityA() {
    }
  
    public Long getId() {
      return this.id;
    }
  
    public void setId(final Long id) {
      this.id = id;
    }
    public EntityB getEntityB() {
      return this.entityB;
    }
  
    public void setEntityB(final EntityB entityB) {
      this.entityB = entityB;
    }
  }
  </code></pre>
  <p>and <code>EntityB</code> would look something like this:</p>
  <pre><code>@Entity
  @Table(name = &quot;entity_b&quot;)
  @Audited
  public class EntityB implements Serializable {
    @Id
    private String id;
  
    public EntityB() {
    }
  
    public String getId() {
      return this.id;
    }
  
    public void setId(final String id) {
      this.id= id;
    }
  </code></pre>
  <p>}</p>
  <p>I am getting revisions using this code:</p>
  <pre><code>final AuditQuery query = reader.createQuery().forRevisionsOfEntity(EntityA.class, true, true)
              .add(AuditEntity.id().eq(id));
  </code></pre>
  <p>But I have an issue where I get object for entityB with all values as <code>null</code>, and another object inside called <code>$$_hibernate_interceptor</code> that actually contains entityB id.</p>
  <p>How can I receive values for entityB also, so they are not null but actual values?</p>