Trying to retreive records through custom query on audit table. I have Hibernate entity structure like below..,
@Audited
@Entity
public class TableA {
@EmbeddedId
private PrimaryKeyID primaryKeyID;
private Double price;
private Date modifiedOn;
private String status;
}
@Embeddable
public class PrimaryKeyID implements Serializable {
private Integer Id;
}
The query I am trying to replicate through AuditFactory is
SELECT * FROM table_A_aud where id = ? and status=? order by modifiedOn desc limit 3;
Tried Hibernate document on the Envers but I didnt find much info on that. Can someone kindly help me with this?