Skip to content
Advertisement

while sending parameters to @Query function if i give like ?1 it is trying to excute like ? only

when i try send:-

@Query(value = "SELECT * FROM  labels where personal_ic_id=?1 and content like '%2%'",nativeQuery = true)
List<Labels> searchByLabels(String personalIcId, String key);

it has been executing like:-

SELECT * FROM  labels where personal_ic_id=? and content like '%?2%'

Advertisement

Answer

remove single inverted comma from like option

Use below

@Query(value = "SELECT * FROM  labels where personal_ic_id=?1 and content like %?2%",nativeQuery = true)
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement