Cannot get entity type for Envers entities

Description

In 5.2 it was possibile to get the EntityType of an Envers entity, which is useful to inspect its attributes or pass it to other tools such as Blaze Persistence and create complex queries not provided by Envers. For example:

In 5.3. the same code returns a null EntityType.

Activity

Show:

Chris Cranford September 4, 2018 at 3:32 PM

This was originally reported as regression in HHH-12871.

The main problem was any entity-type that was based on a dynamic-map configuration (which all Envers types are) were being treated differently in 5.2+ than they had in 5.1 which created an issue for spring-data and other integrations. What exacerbated the problem was the fact that embeddables owned by the dynamic-map entity-types were not being excluded, so you were effectively getting the metamodel returning part of the dynamic-map model rather than none of it or all of it as you would typically expect.

I'll need to double check but I'm fairly certain enabled was needed as ignoreUnsupported is the default which excluded the dynamic-map types entirely (which I believe are considered non-spec compliant).

Christian Beikov September 4, 2018 at 1:18 PM

IMO the surprising part is that it wasn't mentioned in the migration guide.

Guillaume Smet September 4, 2018 at 1:17 PM

wondering if we should at least warn the user about this behavior (or document it?). Or even throw an exception if the model is not populated. Don't know if it's feasible but the current behavior is a bit surprising.

Giovanni Lovato September 4, 2018 at 9:28 AM

Thanks to Christian Beikov and Jan-Willem Gmelig Meyling I was able to get Envers entity types adding this to my persistence descriptor:

Out of Date

Details

Assignee

Reporter

Worked in

Components

Affects versions

Priority

Created September 1, 2018 at 2:24 PM
Updated September 4, 2018 at 3:32 PM
Resolved September 4, 2018 at 11:26 AM