Spring Data Jpa API

uniqueview發表於2018-04-28

零、環境

public class Customer {
    private Long id;
    private String name;
    private Integer age;
    private String type;
}複製程式碼
public interface CustomerRepository extends JpaRepository<Customer, Long>, JpaSpecificationExecutor<Customer>  {複製程式碼
    Customer findByPhone(String phone);
    Customer findAllByAge(String openId);
}複製程式碼

一、簡單查詢

二、分頁、排序查詢



相關文章