• JPA中比较语句


    JPA中比较语句

    eq相等   ne、neq不相等,   gt大于, lt小于 gte、ge大于等于   lte、le 小于等于   not非   mod求模   is [not] div by是否能被某数整除   is [not] even是否为偶数   is [not] even by $b即($a / $b) % 2 == 0   is [not] odd是否为奇   is not odd by $b即($a / $b) % 2 != 0 示例:

    equal/ not equal/ greater than/ less than/ less than or equal/ great than or equal/后面的就不用说了

     

    JPA的基本操作语句

     1  //And --- 等价于 SQL 中的 and 关键字,比如 findByHeightAndSex(int height,char sex);  
     2  public List<User> findByHeightAndSex(int height,char sex);  
     3   
     4 // Or --- 等价于 SQL 中的 or 关键字,比如 findByHeightOrSex(int height,char sex);  
     5  public List<User> findByHeightOrSex(int height,char sex);  
     6   
     7  //Between --- 等价于 SQL 中的 between 关键字,比如 findByHeightBetween(int min, int max);  
     8  public List<User> findByHeightBetween(int min,int max);  
     9   
    10  //LessThan --- 等价于 SQL 中的 "<",比如 findByHeightLessThan(int max);  
    11  public List<User> findByHeightLessThan(int max);  
    12   
    13  //GreaterThan --- 等价于 SQL 中的">",比如 findByHeightGreaterThan(int min);  
    14  public List<User> findByHeightGreaterThan(int min);  
    15   
    16  //IsNull --- 等价于 SQL 中的 "is null",比如 findByNameIsNull();  
    17  public List<User> findByNameIsNull();  
    18   
    19  //IsNotNull --- 等价于 SQL 中的 "is not null",比如 findByNameIsNotNull();  
    20  public List<User> findByNameIsNotNull();  
    21   
    22  //NotNull --- 与 IsNotNull 等价;  
    23  public List<User> findByNameNotNull();  
    24   
    25  //Like --- 等价于 SQL 中的 "like",比如 findByNameLike(String name);  
    26  public List<User> findByNameLike(String name);  
    27   
    28  //NotLike --- 等价于 SQL 中的 "not like",比如 findByNameNotLike(String name);  
    29  public List<User> findByNameNotLike(String name);  
    30   
    31  //OrderBy --- 等价于 SQL 中的 "order by",比如 findByNameNotNullOrderByHeightAsc();  
    32  public List<User>findByNameNotNullOrderByHeightAsc();  
    33   
    34  //Not --- 等价于 SQL 中的 "! =",比如 findByNameNot(String name);  
    35  public List<User> findByNameNot(String name);  
    36   
    37  //In --- 等价于 SQL 中的 "in",比如 findByNameIN(String name);  
    38  public List<User> findByNameIn(String name);  
    39   
    40  //NotIn --- 等价于 SQL 中的 "not in",比如 findByNameNotIN(String name);  
    41  public List<User> findByNameNotIn(String name);  

     springboot jpa之复杂查询语句  https://blog.csdn.net/Maslii/article/details/81782670

    Spring系列:JPA 常用接口和方法 https://blog.csdn.net/VIP099/article/details/107576710?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param

    坚持每天进步,自律改变自己
  • 相关阅读:
    关于JAVA中的static方法、并发问题以及JAVA运行时内存模型
    【设计模式】抽象工厂模式
    spring mvc4.1.6 + spring4.1.6 + hibernate4.3.11 + mysql5.5.25 开发环境搭建及相关说明
    struts2.3.24 + spring4.1.6 + hibernate4.3.11+ mysql5.5.25开发环境搭建及相关说明
    git中Please enter a commit message to explain why this merge is necessary.
    扒一扒开源世界有哪些licenses?
    string.Format出现异常:输入字符串的格式不正确 Exception during StringFormat
    node-glob学习
    js中对URL进行转码与解码
    程序员如何修炼管理思维
  • 原文地址:https://www.cnblogs.com/seakyfly/p/13550658.html
Copyright © 2020-2023  润新知