如何使用hql查询从jsonb获取数据

6 postgresql json hibernate hql jsonb

我在我的数据库中有一个从一种类型的jsonb调用"info"的列,如下所示:

info={'duration','metrics'}
Run Code Online (Sandbox Code Playgroud)

我想使用hql查询来获取'duration'的数据

这是我正在尝试的查询:

    @Query(value = "select new com.hyginex.service.statistic.dto.NewWristbandRecordByUser(wrp.user.id, wrp.recordTimestamp, wrp.id, wrp.device.id, wrp.rssi, wrp.beacon.id, wrp.beacon.locatableType) " +
        "from WristbandRecordProcessed wrp where wrp.user.id = :userId and wrp.rssi is null and wrp.recordTimestamp > :lastTimestamp and wrp.recordType = 'HANDWASH' and (wrp.info->'duration')*(wrp.avgCrossing)>100 order by wrp.recordTimestamp ")
Run Code Online (Sandbox Code Playgroud)

但是当我这样做时我会收到错误:

 (wrp.info->'duration')
Run Code Online (Sandbox Code Playgroud)

即使没有'',我也试过了,但仍然没有奏效.