Spring与Jpa整合(9)
发布时间:2021-06-11
发布时间:2021-06-11
Spring与Jpa整合
这样,在查询的时候,Spring Jpa就会自动为我们构建如下的jpql查询语句:
关
于这一点,可以查看
Spring Jpa
的参考手册,
在这里仅列出方法中可使用的关键字:
Keyword Sample
JPQL snippet where stname = ?1 and x.firstname = ?2 where stname = ?1 or x.firstname = ?2
And findByLastnameAndFirstname
Or findByLastnameOrFirstname
Is,Equals
where
findByFirstname,findByFirstnameIs,findByF
x.firstname =
irstnameEquals
1?
where x.startDate between 1? and ?2 where x.age < ?1
where x.age <= ?1 where
Between findByStartDateBetween
LessThan findByAgeLessThan
LessThanEqual findByAgeLessThanEqual GreaterThan
findByAgeGreaterThan
上一篇:五子棋游戏源代码