I have a column like json type in my postgres.I am trying to send data and to retrive data by using Gson and taken in entity like below
JsonObject metadata;
for retriving the code like below (I am just metioning Gson code only remaining things getting correctly)
JsonObject metadata = new JsonParser().parse(map.get("metadata")).getAsJsonObject();
But, getting response like below
"metadata" : "{\"name\":\"user\"}" insted of getting "metadata" : {"name": "user"}
If use JSONObject i am getting correctly.But,my requirement is changed i need to use Gson
While inserting also i am getting response like "metadata" : "{\"name\":\"user\"}".To get rasponse i am using Rest-api