Envers is looking for an extra "join" auditing table when @JoinColumn is used in EAP 6

Solution Verified - Updated -

Issue

  • The following entity association is defined
@Entity
@Audited
public class Product {
    ...
    private Set<Part> parts = new HashSet<Part>();
    ...
    @OneToMany
    @JoinColumn(name = "productId")
    public Set<Part> getParts() {
        return parts;
    }
    ...
}

@Entity
@Audited
public class Part {
    @Id
    private int partId;

    private String productId;
}
  • The @JoinColumn annotation imposes a requirement for the existence of a table named <one>_<many>_<auditing_suffix> (e.g. Product_Part_aud).
  • If the table does not exist (and automatic table creation is not used), the following exception may be raised:
HHH000262: Table not found: Product_Part_aud

Environment

  • JBoss Enterprise Application Platform (EAP) 6
  • Hibernate 4

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.