/**
* 方法名称规则查询:
* findBy:查询
* 对象中的属性名(首字母大写): 查询的条件
*
*findByName ==== 根据客户名称查询
*
* 在springdatajpa的运行阶段 会根据方法名称进行解析 findBy 翻译成 from xxx(实体类) 属性名称 --- where name =
*/
List<Student> findByName(String name);
@Test
public void findby(){
List<Student> list = studentDao.findByName("张喜");
for (Object object : list)
{
System.out.println(object);
}
}
List<Student> findByNameLike(String name); //模糊查询
多条件查询
List<Student> findByNameAndId(String name ,Integer id);