I would like to have a JPA object 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 am not familiar with how this manager is maintained. Ideally, it would be like a JSON string, but essentially I want to hide how things are stored from the public API. I could do this potentially using an inner class that has type methods String getObject()that my outer class passes and does JSON analysis to return a JsonObject, but I am wondering if there is another way.
source
share