Spring Data Jpa 规范接口表
2024-10-15 12:25:30
Keyword | Sample | JPQL snippet |
---|---|---|
And |
findByLastnameAndFirstname |
… where x.lastname = ?1 and x.firstname = ?2 |
Or |
findByLastnameOrFirstname |
… where x.lastname = ?1 or x.firstname = ?2 |
Between |
findByStartDateBetween |
… where x.startDate between 1? and ?2 |
LessThan |
findByAgeLessThan |
… where x.age < ?1 |
GreaterThan |
findByAgeGreaterThan |
… where x.age > ?1 |
After |
findByStartDateAfter |
… where x.startDate > ?1 |
Before |
findByStartDateBefore |
… where x.startDate < ?1 |
IsNull |
findByAgeIsNull |
… where x.age is null |
IsNotNull,NotNull |
findByAge(Is)NotNull |
… where x.age not null |
Like |
findByFirstnameLike |
… where x.firstname like ?1 |
NotLike |
findByFirstnameNotLike |
… where x.firstname not like ?1 |
StartingWith |
findByFirstnameStartingWith |
… where x.firstname like ?1 (parameter bound with appended % ) |
EndingWith |
findByFirstnameEndingWith |
… where x.firstname like ?1 (parameter bound with prepended % ) |
Containing |
findByFirstnameContaining |
… where x.firstname like ?1 (parameter bound wrapped in % ) |
OrderBy |
findByAgeOrderByLastnameDesc |
… where x.age = ?1 order by x.lastname desc |
Not |
findByLastnameNot |
… where x.lastname <> ?1 |
In |
findByAgeIn(Collection<Age> ages) |
… where x.age in ?1 |
NotIn |
findByAgeNotIn(Collection<Age> age) |
… where x.age not in ?1 |
True |
findByActiveTrue() |
… where x.active = true |
False |
findByActiveFalse() |
… where x.active = false |
最新文章
- SQL Server CheckPoint的几个误区
- ios隐藏键盘
- Entity Framework CodeFirst数据迁移
- Qt之镜像旋转
- dataTables表格分页排序等交互
- python处理ajax请求
- NSURLSession、NSURLConnection
- ADO.NET学习小结【1】正在更新...
- IIS支持APK/ISO文件下载的方法
- ExtJS4.2学习(三)——入门基础
- TF Multi-GPU single input queue
- Javabean介绍
- 关于sqlserver数据库max()方法的使用
- 【jira】java.lang.OutOfMemoryError: GC overhead limit exceeded
- Python学习笔记-数字类型
- grid和flex区别
- SpringBoot切换Tomcat容器,SpringBoot使用Jetty容器
- Android设计 - 图标设计概述(Iconography)
- BZOJ4144: [AMPPZ2014]Petrol(最短路 最小生成树)
- HDU 3853 LOOPS 期望dp