I would like to display the contents of my _aud table in a JSON array like this:
[
{
"id":1,
"rev":1,
"revtype":0,
"created_date":xxxx,
"modified_date":yyyy
}
]
How do I write my controller GET method?
I had written something like this:
@GetMapping("/audit/{id}")
public List<Revisions<Long, Person>> getRevisions(@PathVariable("id") long id) {
return personRepository.findRevisions(id);
}
Unfortunately Spring Boot/Jackson cannot convert Revisions to JSON.
How do I view the records from the _aud table as a JSON array?
I am using Spring Data Envers and my repository class implements RevisionRepository<Person, Long, Long>.