索引参数与命名参数 • 如果是 @Query 中有 LIKE 关键字,后面的参数需要前 面或者后面加 %,这样在传递参数值的时候就可以不加 %: – @Query("select o from User. Model o where o. name like ? 1%") public List<User. Model> find. By. Uuid. Or. Age(String name); – @Query("select o from User. Model o where o. name like %? 1%") public List<User. Model> find. By. Uuid. Or. Age(String name);
用@Query来指定本地查询 • 还可以使用@Query来指定本地查询,只要 设置native. Query为true,比如: – @Query(value="select * from tbl_user where name like %? 1" , native. Query=true) public List<User. Model> find. By. Uuid. Or. Age(String name);