Hello,
I would like to have a JPA Entity that has a GSon Object as a field/attribute. For instance:
@Entity
public class MyEntity {
private JsonObject myObject;
public JsonObject getObject() {
return myObject;
}
public void setObject(JsonObject obj) {
myObject = obj;
}
}
I'm not familiar with how the persistence manager will persist these. Ideally it would be as a JSON string, but essentially what I want to do is hide how things are persisted from the public API. I could do this potentially with an inner class that has methods like String getObject()
that my outer class delegates to and does the JSON parse to return a JsonObject, but I'm wondering if there's another way.