How to handle JSON value from Native Query in hibernate?

604 Views Asked by At

I have a query that returns a JSON column from PostgreSQL but I'm not able to handle it in JSON. It is giving me an error "No Dialect mapping for JDBC type: 1111;"

I'm using Native Query to get the details in my spring data JPA project the query is as below

SELECT map_details_id,row_id,json_object_agg(key, value) AS data FROM field_details_tbl where map_details_id=:mapId GROUP BY row_id,map_details_id ORDER BY row_id

One of the answers that I found was to cast the json_object_agg() to text but I'm trying to get it as JSON.

Your suggestions are much appreciated! Thanks.

1

There are 1 best solutions below

0
Edgar Domingues On

Your Entity property must be annotated with @Type(type = "json")