Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

How should I tell Hibernate to map a String containing a JSON value to PostgreSQL as PostgreSQL's JSON Type ? Assume I have an attribute like this:

private String foo_json_value;

I have used Gson to convert Foo object to a JSON String and now I want to store this attribute in PostgreSQL. I have learned that PostgreSQL has a JSON data type, so I want to use this datatype instead of string (varchar). What JPA annotation or mapping strategy should I use to be able to store this String as JSON directly?

share|improve this question
 
This has been discussed here before; recommend searching for related questions. –  Craig Ringer 18 hours ago
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

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.