Is it possible to save the general field?
I have this property in class Entity
...
private T payload;
...
T extends EventMessagePayload
and
public interface StringPayload extends EventMessagePayload{
String getPayload();
}
In my application, I save the field only when it is of type String, and during the save operation everything works fine.
When I read an object instead of a JPA, try creating an object String, but instead StringPaylod. Is there a way to intercept the creation and handle the marshalling of the object?
source
share