mybatis jpa repository 方法关键词对应关系表

    xiaoxiao2022-07-02  88

    注意:jpa的sql是面向对象的,因此from后的表名可以使用相应的实体类,占位符用?1代表参数里的第几个参数,相当于mybatis参数中的@param。

    KeywordSampleJPQL snippetIsNotNullfindByAgeNotNull… where x.age not nullLikefindByNameLike… where x.name like ?1NotLikefindByNameNotLike… where x.name not like ?1StartingWithfindByNameStartingWith… where x.name like ?1(parameter bound with appended %)EndingWithfindByNameEndingWith… where x.name like ?1(parameter bound with prepended %)ContainingfindByNameContaining… where x.name like ?1(parameter bound wrapped in %)OrderByfindByAgeOrderByName… where x.age = ?1 order by x.name descNotfindByNameNot… where x.name <> ?1InfindByAgeIn… where x.age in ?1NotInfindByAgeNotIn… where x.age not in ?1TruefindByActiveTrue… where x.avtive = trueFlasefindByActiveFalse… where x.active = falseAndfindByNameAndAge… where x.name = ?1 and x.age = ?2OrfindByNameOrAge… where x.name = ?1 or x.age = ?2BetweenfindBtAgeBetween… where x.age between ?1 and ?2LessThanfindByAgeLessThan… where x.age < ?1GreaterThanfindByAgeGreaterThan… where x.age > ?1After/Before……IsNullfindByAgeIsNull… where x.age is null
    最新回复(0)