spring data jpa方法命名规则

spring data jpa方法命名规则关键字 方法命名 sqlwhere 字句 And findByNameAn wherename andpwd Or findByNameOr wherename orsex Is Equals findById findByIdEqua whereid Between fi

关键字 方法命名 sql where字句
And findByNameAndPwd where name= ? and pwd =?
Or findByNameOrSex where name= ? or sex=?
Is,Equals findById,findByIdEquals where id= ?
Between findByIdBetween where id between ? and ?
LessThan findByIdLessThan where id < ?
LessThanEqual findByIdLessThanEqual where id <= ?
GreaterThan findByIdGreaterThan where id > ?
GreaterThanEqual findByIdGreaterThanEqual where id > = ?
After findByIdAfter where id > ?
Before findByIdBefore where id < ?
IsNull findByNameIsNull where name is null
isNotNull,NotNull findByNameNotNull where name is not null
Like findByNameLike where name like ?
NotLike findByNameNotLike where name not like ?

StartingWith

findByNameStartingWith where name like ‘?%’
EndingWith findByNameEndingWith where name like ‘%?’
Containing findByNameContaining where name like ‘%?%’
OrderBy findByIdOrderByXDesc where id=? order by x desc
Not findByNameNot where name <> ?
In findByIdIn(Collection
c)
where id in (?)
NotIn findByIdNotIn(Collection
c)
where id not  in (?)
True

findByAaaTue

where aaa = true
False findByAaaFalse where aaa = false
IgnoreCase findByNameIgnoreCase where UPPER(name)=UPPER(?)
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/223472.html原文链接:https://javaforall.net

(0)
上一篇 2026年3月17日 下午2:07
下一篇 2026年3月17日 下午2:08


相关推荐

  • java如何获取随机数(两种方式)

    java如何获取随机数(两种方式)在小的知识,都有深挖之价值。很久没有生产随机数,竟然忘了!我明明记得我做过关于随机数产生的总结,but,我翻遍了整个笔记本,就是没找到。即便我知道笔记就在某一个角落;我还是放弃了查找笔记,跑去Google了,所以我决定建立电子笔记,记录那些小知识点。//获取100以内的随机数packagecom.isea.java;importjava.util.Random;public……

    2022年7月26日
    42
  • 埃隆·马斯克宣布xAI开源Grok 2.5

    埃隆·马斯克宣布xAI开源Grok 2.5

    2026年3月15日
    2
  • 解决linux下sudo更改文件权限报错xxxis not in the sudoers file. This incident will be reported.

    解决linux下sudo更改文件权限报错xxxis not in the sudoers file. This incident will be reported.本文转自Linux社区作者为z-sm的文章原文链接http://www.linuxidc.com/Linux/2016-07/133066.htmLinux中普通用户用sudo执行命令时报”xxxisnotinthesudoersfile.Thisincidentwillbereported”错误,解决方法就是在/etc/sudoers文件里给该用户添加权限。如下:1.切换到

    2022年6月20日
    34
  • PS2021神经滤镜Neural Filters离线安装包 亲测可用

    PS2021神经滤镜Neural Filters离线安装包 亲测可用大家好,我北方的狼,哥们儿称我狼大,其实不论啥狼只要不是白眼狼这事就好办,靠谱。好吧,有了PS神经滤镜,哥们你是不是马上也精神了!言归正传。PS2021软件自面试以来,强大的NeuralFilters神经滤镜被诸多用户所期待,官方也加强了对于软件的管控,导致我们的和谐软件往往无法使用这些在线滤镜,刚开始的2021版本还可以在线使用,随着版本的更新,后面就基本不让用了。很多小伙伴更新了软件后,给我留言反馈NeuralFilters神经滤镜无法使用的问题,现在终于找到了解决方法,那就是使用对应…

    2022年5月11日
    31
  • Cesium 结合Echarts绘制航线图

    Cesium 结合Echarts绘制航线图template divid cesiumContai divid cesiumContai template script exportdefaul data return components computed created mounted TS ready gt w script

    2026年3月17日
    1
  • pycharm命令行快捷启动

    pycharm命令行快捷启动打开本用户目录下的 bashrc 文件 vim bashrc 在末尾添加一行 aliaspycharm the path to pycharm sh 最后保存退出然后更新设置 source bashrc 此方法应该适用于其他任意软件的命令行终端启动方式转载于 https www cnblogs com zdj8023 p

    2026年3月18日
    2

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号