| keywords | sample | JPQL snippet |
|---|---|---|
| And | findByLastnameAndFirstname |
… where x.lastname = ?1 and x.firstname = ?2 |
| Or | findByLastnameOrFirstname |
… where x.lastname = ?1 or x.firstname = ?2 |
| Is,Equals | findByFirstname , findByFirstnameIs , findByFirstnameEquals |
… where x.firstname = ?1 |
| Between | findByStartDateBetween |
… where x.startDate between ?1 and ?2 |
| LessThan | findByAgeLessThan |
… where x.age < ?1 |
| LessThanEqual | findByAgeLessThanEqual |
… where x.age <= ?1 |
| GreaterThan | findByAgeGreaterThan |
… where x.age > ?1 |
| GreaterThanEqual | findByAgeGreaterThanEqual |
… 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> ages) |
… where x.age not in ?1 |
| True | findByActiveTrue() |
… where x.active = true |
| False | findByActiveFalse() |
… where x.active = false |
| IgnoreCase | findByFirstnameIgnoreCase |
… where UPPER(x.firstame) = UPPER(?1) |
SpringDataJpa方法名支持的關(guān)鍵字
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。
相關(guān)閱讀更多精彩內(nèi)容
- 今天,2018年6月9日,齊悅夢想大型社群開營啦,而我有幸成為了夢想社群中一營三班的一名學(xué)生。 ...