-
Hello, I would like to use blaze persistence to query envers revisions of my entities. Thank you ! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
I actually think I misunderstood the example, AuditedView.java is just a way to add the first revision info to the EntityView to get creation information, right ? Thanks |
Beta Was this translation helpful? Give feedback.
-
Would this be the beginning of a solution to my question ? EnversTest.java |
Beta Was this translation helpful? Give feedback.
For entity views to work correctly, there needs to be a Java class representation i.e. a mapping for the data/table. You can either map that explicitly like @jwgmeligmeyling suggested by creating dedicated
@Entity
to which you can refer to then, or you can write a@CTE @Entity
and produce these objects through a CTE. You can then model an entity view for that CTE entity. Here is an example on how you can inject the CTE query into the entity view mapping: https://persistence.blazebit.com/documentation/1.6/entity-view/manual/en_US/index.html#using-ctes-in-entity-views