spring boot jpa 使用<S extends T> List<S> findAll(Example<S> example)查询数据

 

直接上代码

//查询条件对象
TinventivePrinciple time = new TinventivePrinciple();
//设置需要查询的条件(赋值)
time.setIsTime(Short.parseShort("1"));
//定义example1
Example<TinventivePrinciple> example1 = Example.of(time);
//查询数据
List<TinventivePrinciple> timeList = tinventivePrincipleDao.findAll(example1);

 

posted @ 2019-05-29 21:01  代码猫  阅读(7563)  评论(0编辑  收藏  举报