jparepository需要指定的泛型參數,一、JpaRepository 命名規范(摘)

 2023-11-18 阅读 30 评论 0

摘要:摘自https://blog.csdn.net/thousa_ho/article/details/74355752 KeywordSampleJPQLAndfindByLastnameAndFirstnamewhere x.lastname=?1 and x.firstname=?2OrfindByLastnameOrFirstnamewhere x.lastname=?1 or x.firstname=?2BetweenfindByStartDateBetweenw

摘自https://blog.csdn.net/thousa_ho/article/details/74355752

KeywordSampleJPQL
AndfindByLastnameAndFirstnamewhere x.lastname=?1 and x.firstname=?2
OrfindByLastnameOrFirstnamewhere x.lastname=?1 or x.firstname=?2
BetweenfindByStartDateBetweenwhere x.startDate between ?1 and ?2
LessThanfindByAgeLessThanwhere x.startDate < ?1
GreaterThanfindByAgeGreaterThanwhere x.startDate >?1
AfterfindByStartDateAfterwhere x.startDate >n ?1
BeforefindByStartDateBeforewhere x.startDate < ?1
IsNullfindByAgeIsNullwhere x.age is null
IsNotNull,NotNullfindByAge(Is)NotNullwhere x.age not null
LikefindByFirstnameLikewhere x.firstname like ?1
notLikefindByFirstnameNotLikewhere x.firstname not like ?1
StartingWithfindByFirstnameStartingWithXXXwhere x.firstname like ?1(parameter bound with appended %)
EndingWithfindByFirstnameEndingWithXXXwhere x.firstname like ?1(parameter bound with appended %)
ContainingfindByFirstnameContainingwhere x.firstname like ?1(parameter bound wrapped in %)
OrderByfindByAgeOrderByLastnamewhere x.age = ?1 order by x.lastname desc
NotfindByLastnameNotwhere x.lastname <> ?1
NotInfindByAgeNotIn(Collection age )where x.age not in ?1
TruefindByActiveTrue()where x.active = true
FalsefindByActiveFalse()where x.active = false

轉載于:https://www.cnblogs.com/black-/p/8969263.html

版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。

原文链接:https://hbdhgg.com/5/174045.html

发表评论:

本站为非赢利网站,部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们删除!

Copyright © 2022 匯編語言學習筆記 Inc. 保留所有权利。

底部版权信息