KeyWords | 方法命名举例 | 对应的SQL |
And | findByNameAndAge | where name = ? and age = ? |
Or | findByNameOrAge | where name = ? or age = ? |
Is | findByAgeIs | where age = ? |
Equals | findByIdEquals | where id = ? |
Between | findByAgeBetween | where age between ? and ? |
LessThan | findByAgeLessThan | where age < ? |
LessThanEquals | findByAgeLessThanEquals | where age <= ? |
GreaterThan | findByAgeGreaterThan | where age > ? |
GreaterThanEquals | findByGreaterThanEquals | where age >= ? |
After | findByAgeAfter | where age > ? |
Before | findByAgeBefore | where age < ? |
IsNull | findByNameIsNull | where name is null |
isNotNull,NotNull | findByNameNotNull | where name is not null |
Not | findByGenderNot | where gender <> ? |
In | findByAgeIn | where age in (?) |
NotIn | findByAgeNotIn | where age not in (?) |
NotLike | findByNameNotLike | where name like ? |
Like | findByNameLike | where name like ? |
StartingWith | findByNameStartingWith | where name like '?%' |
EndingWith | findByNameEndingWith | where name like '%?' |
Containing,Contains | findByNameContaining | where name like '%?%' |
OrderBy | findByAgeGreaterThanOrderByIdDesc | where age > ? order by id desc |
True | findByEnabledTue | where enabled = true |
False | findByEnabledFalse | where enabled = false |
IgnoreCase | findByNameIgnoreCase | where UPPER(name) = UPPER(?) |