Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.