The reason the NPE happens is we’re doing some reflection at runtime to instantiate TriggerPK inside the call of EmbeddedIdMapper#mapToEntityFromMap when we hydrate the dynamic-map data stored for the audit structure into the actual java class type. With how you’re using generics, the code presently sees the identifier’s return type as Serializable rather than TriggerPK since the super-type actually technically defines it as such. Since Serializable is abstract, this leads to the NPE. A quick workaround would be to actually override the getter in your model inside Trigger as such: {code} public Trigger.TriggerPK getPk() { return super.getPk(); } {code} That should suffice to trick the EmbeddedIdMapper to properly result the return-type of the identifier so that it actually returns TriggerPK rather than Serializable, avoiding the NPE. In the meantime, I’ll look at the code and see if I can find a resolution. |