MongDB

2020-06-08  本文已影响0人  建国同学

一、简介

二、 MongoDB范式化与反范式化

三、Spring Data

Spring Data方法命名规范

关键字 例子 JPQL
And findByNameAndAge(String name, Integer age) where name = ? and age = ?
Or findByNameOrAge(String name, Integer age) where name = ? or age = ?
Is findByName(String name) where name = ?
Between findByAgeBetween(Integer min, Integer max) where age between ? and ?
LessThan findByAgeLessThan(Integer age) where age < ?
LessThanEqual findByAgeLessThanEqual(Integer age) where age <= ?
GreaterThan findByAgeGreaterThan(Integer age) where age > ?
GreaterThanEqual findByAgeGreaterThanEqual(Integer age) where age >= ?
After 等同于GreaterThan
Before 等同于LessThan
IsNull findByNameIsNull() where name is null
IsNotNull findByNameIsNotNull() where name is not null
Like findByNameLike(String name) where name like ?
NotLike findByNameNotLike(String name) where name not like ?
StartingWith findByNameStartingWith(String name) where name like '?%'
EndingWith findByNameEndingWith(String name) where name like '%?'
Containing findByNameContaining(String name) where name like '%?%'
OrderByXx[desc] findByIdOrderByXx[Desc] (Long id) where id = ? order by Xx [desc]
Not findByNameNot(String name) where name != ?
In findByIdIn(List<Long> ids) where id in ( ... )
NotIn findByIdNotIn(List<Long> ids) where id not in ( ... )
True findByXxTrue() where Xx = true
False findByXxFalse() where Xx = false
IgnoreCase findByNameIgnoreCase(String name) where name = ? (忽略大小写)

四、spring data jpa

https://www.cnblogs.com/chenglc/p/11226693.html

上一篇下一篇

猜你喜欢

热点阅读