【发布时间】:2020-07-24 01:55:11
【问题描述】:
我的查询如下所示,
@Query(value="SELECT * FROM Retention_Record retention where retention.entity=:entity and retention.category=:category and retention.record_type=:recordType and json_exists(retention.reference_data_id, '$?(@==$referenceDataId)' passing :referenceDataId as \"referenceDataId\")" , nativeQuery=true)
当我在执行此查询时遇到错误时
2020-07-23 16:12:11 [eventsTaskExecutor-5] [] WARN o.h.e.jdbc.spi.SqlExceptionHelper - SQL Error: 29902, SQLState: 99
999
2020-07-23 16:12:11 [eventsTaskExecutor-5] [] ERROR o.h.e.jdbc.spi.SqlExceptionHelper - ORA-29902: error in executing
ODCIIndexStart() routine
ORA-20000: Oracle Text error:
DRG-50900: text query parser error on line 1, column 10
DRG-50917: escape on at end of text query string
谁能帮忙。
【问题讨论】:
-
在Oracle数据库中能用吗?
-
是的...在 oracle db 上它可以工作。
-
你也可以分享那个查询吗?
-
嗨@MuhammadWaqasDilawar,SELECT * FROM Retention_Record 保留 whereretention.entity=?和retention.category=?和retention.record_type=?和 json_exists(retention.reference_data_id, '$?(@==$referenceDataId)' 传递 ? 作为 "referenceDataId" )
-
另外,这有效,但有问题的查询无效。
@Query(value="SELECT * FROM Retention_Record retention where retention.entity=:entity and retention.category=:category and retention.record_type=:recordType and json_exists(retention.reference_data_id, '$?(@==50000021)' )" , nativeQuery=true)
标签: java spring spring-boot jpa spring-data-jpa