Finding a JSON key in PostgreSQL using Hibernate

I have a JSON field datathat contains the following data -

{"name":"xx"}

I want to do a full text search in this field using Hibernate. Is there any way to achieve this? I followed suit, but nothing worked for me.

+4
source share
1 answer

Ideally, Hibernate will have built-in support for queries inside JSON objects using JPQL / HQL and / or Criteria queries. This is currently not the case (5.0.1).

It looks like you will currently need to use your own queries using one of the following methods:

Hibernate, JPA, Hibernate , Session Session a java.sql.Connection.

, PostgreSQL, ? ->> json SQL, JPQL/HQL. . postgresql json operator. , JSON 9.3 9.4, 9.5, , .

, myjsoncolumn ? 'key' jsonb 9.4+. json (myjsoncolumn -> 'key') IS NULL. -> not ->>, -> json {"a":null}, NULL, {"a":null} {}.

+3

Source: https://habr.com/ru/post/1607228/