Entity class instance as identifier instead of HashMap

I've implemented a Feature 'SERIALIZE_IDENTIFIER_USE_PERSISTENT_CLASS' that allows to configure if HibernateProxySerializer should instantiate the actual Entity class and set the Id value in case SERIALIZE_IDENTIFIER_FOR_LAZY_NOT_LOADED_OBJECTS is set to true. 
This is especially useful in cases where Type inheritance is used with Jackson (@JsonTypeInfo). 
This feature defaults to false and can optionally be enabled in case SERIALIZE_IDENTIFIER_FOR_LAZY_NOT_LOADED_OBJECTS is enabled.

Without this feature the type information is lost for the client i.e. HashMap is returned as type info.
Shouldn't this be non-static, given that factories are tied to proxy serializers (or perhaps should be created by module, passed along)? Using unbounded static map could lead to unintended memory retention (although granted in most cases it is bounded by relatively low number of classes probably)?