比如有个实体类对象,类名为Book,对应数据表的表名为book 1. 一个使用@Query注解的简单例子:占位符?1和?2 @Query(value = "select name,author,price from Book b where b.price>?1 and b.price<?2") List<Book> findByPriceRange(long price1, long price2); 2. Like表达式:指定参数 :name,下面要用@P…
/** * Specifies methods used to obtain and modify person related information * which is stored in the database. * @author Petri Kainulainen */ public interface PersonRepository extends JpaRepository<Person, Long> { /** * Finds a person by using the…