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.

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 Dec 10 '13 at 9:56
1  
@CraigRinger where? i couldnt find this specific case. –  dave Dec 11 '13 at 7:37

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.