Is there a way to add an index to the annotation org.hibernate.envers.Audited ?
I have the following two entities:
@Audited @Table( name = "t_parent" ) @Entity public class Parent \ {
@OneToMany(mappedBy = "parent", cascade = CascadeType.ALL, orphanRemoval = true) private List<Child> children;
}
@Audited @Table( name = "t_child", indexes = \ { @Index(columnList = "parent_id") } ) @Entity public class Child \ {
@ManyToOne(optional = false) @JoinColumn(name = "parent_id") private Parent parent;
} When I query the log of a parant of data, it is very slow, because the child's log (more than one million data) has no index in the table. In addition to manually adding an index to the parent_id column in the child's log table, is there another way (like AuditIndexs or Audited#indexes())? |
|