I am working on what could be classified as a an auditing report. I need to show a list Orders where the quantity, price, or ship date has changed as well as the old and new values. I’ve constructed a JPQL query that can pull up all the EntityLog instances for my Order entity but I’m running into a wall in how to access the attributes to find current and old values for the above three fields. I’ve tried a join on the attributes property by that did not work (I assume because it is a @MetaProperty). I’m not sure which direction to move now.
I suspect a Groovy script would work but I’m not sure how to merge the JPQL query I have to get the EntityLog instances and then the Groovy script to access the attributes.