类 JpaCriteriaBuilder<T>
java.lang.Object
com.cdkjframework.datasource.jpa.builder.JpaCriteriaBuilder<T>
-
方法概要
修饰符和类型方法说明add(Function<jakarta.persistence.criteria.Root<T>, jakarta.persistence.criteria.Predicate> condition) 添加自定义查询条件<V> JpaCriteriaBuilder<T>autoBuilder(JpaCriteriaBuilder<T> builder, V entity, @NotNull Class<T> clazz) 自动构建规范<V> JpaCriteriaBuilder<T>autoBuilder(JpaCriteriaBuilder<T> builder, V entity, @NotNull Class<T> clazz, List<String> ignoreFields) 自动构建规范<V> JpaCriteriaBuilder<T>autoBuilder(JpaCriteriaBuilder<T> builder, V entity, @NotNull Class<T> clazz, List<String> ignoreFields, List<String>... groupFields) 自动构建规范final <V> JpaCriteriaBuilder<T>autoBuilder(JpaCriteriaBuilder builder, V entity, @NotNull Class<T> clazz, List<String>... groupFields) 自动构建规范<V extends Comparable<? super V>>
JpaCriteriaBuilder<T>添加区间查询条件org.springframework.data.jpa.domain.Specification<T>build()构建查询条件static <T> JpaCriteriaBuilder<T>Builder()创建JapCriteriaBuilder实例<V> JpaCriteriaBuilder<T>添加等值查询条件<V extends Comparable<? super V>>
JpaCriteriaBuilder<T>greaterThan(@NotNull String field, V value) 添加大于查询条件<V extends Comparable<? super V>>
JpaCriteriaBuilder<T>greaterThanOrEqualTo(@NotNull String field, V value) 添加大于等于查询条件<V> JpaCriteriaBuilder<T>添加in查询条件添加非空查询条件添加空查询条件<X> JpaCriteriaBuilder<T>joinEqual(String joinField, @NotNull String field, @NotNull Object value, jakarta.persistence.criteria.JoinType joinType) 添加关联查询条件<V extends Comparable<? super V>>
JpaCriteriaBuilder<T>添加小于查询条件<V> JpaCriteriaBuilder<T>添加模糊查询条件or(JpaCriteriaBuilder<T>... otherBuilder) 或查询排序page(int page) 页码size(int size) 每页大小org.springframework.data.domain.Pageable构建分页查询条件
-
方法详细资料
-
Builder
创建JapCriteriaBuilder实例- 返回:
- JapCriteriaBuilder
-
autoBuilder
public <V> JpaCriteriaBuilder<T> autoBuilder(JpaCriteriaBuilder<T> builder, @NotNull V entity, @NotNull @NotNull Class<T> clazz) 自动构建规范- 类型参数:
V- 实体类型- 参数:
builder- JapCriteriaBuilderentity- 实体- 返回:
- Specification
-
autoBuilder
public <V> JpaCriteriaBuilder<T> autoBuilder(JpaCriteriaBuilder<T> builder, @NotNull V entity, @NotNull @NotNull Class<T> clazz, List<String> ignoreFields) 自动构建规范- 类型参数:
V- 实体类型- 参数:
builder- JapCriteriaBuilderentity- 实体ignoreFields- 对应字段- 返回:
- Specification
-
autoBuilder
@SafeVarargs public final <V> JpaCriteriaBuilder<T> autoBuilder(JpaCriteriaBuilder builder, @NotNull V entity, @NotNull @NotNull Class<T> clazz, List<String>... groupFields) 自动构建规范- 类型参数:
V- 实体类型- 参数:
builder- JapCriteriaBuilderentity- 实体groupFields- 分组字段- 返回:
- Specification
-
autoBuilder
public <V> JpaCriteriaBuilder<T> autoBuilder(JpaCriteriaBuilder<T> builder, @NotNull V entity, @NotNull @NotNull Class<T> clazz, List<String> ignoreFields, List<String>... groupFields) 自动构建规范- 类型参数:
V- 实体类型- 参数:
builder- JapCriteriaBuilderentity- 实体ignoreFields- 对应字段groupFields- 分组字段- 返回:
- Specification
-
equal
添加等值查询条件- 类型参数:
V- 泛型- 参数:
field- 字段value- 值- 返回:
- JapCriteriaBuilder
-
like
添加模糊查询条件- 类型参数:
V- 泛型- 参数:
field- 字段value- 值- 返回:
- JapCriteriaBuilder
-
in
public <V> JpaCriteriaBuilder<T> in(@NotNull @NotNull String field, @NotNull @NotNull List<V> values) 添加in查询条件- 类型参数:
V- 泛型- 参数:
field- 字段values- 值- 返回:
- JapCriteriaBuilder
-
greaterThan
public <V extends Comparable<? super V>> JpaCriteriaBuilder<T> greaterThan(@NotNull @NotNull String field, @NotNull V value) 添加大于查询条件- 类型参数:
V- 泛型- 参数:
field- 字段value- 值- 返回:
- JapCriteriaBuilder
-
greaterThanOrEqualTo
public <V extends Comparable<? super V>> JpaCriteriaBuilder<T> greaterThanOrEqualTo(@NotNull @NotNull String field, @NotNull V value) 添加大于等于查询条件- 类型参数:
V- 泛型- 参数:
field- 字段value- 值- 返回:
- JapCriteriaBuilder
-
lessThan
public <V extends Comparable<? super V>> JpaCriteriaBuilder<T> lessThan(@NotNull @NotNull String field, @NotNull V value) 添加小于查询条件- 类型参数:
V- 泛型- 参数:
field- 字段value- 值- 返回:
- JapCriteriaBuilder
-
between
public <V extends Comparable<? super V>> JpaCriteriaBuilder<T> between(@NotNull @NotNull String field, @NotNull V from, V to) 添加区间查询条件- 类型参数:
V- 泛型- 参数:
field- 字段from- 区间起始值to- 区间结束值- 返回:
- JapCriteriaBuilder
-
isNull
添加空查询条件- 参数:
field- 字段- 返回:
- JapCriteriaBuilder
-
isNotNull
添加非空查询条件- 参数:
field- 字段- 返回:
- JapCriteriaBuilder
-
joinEqual
public <X> JpaCriteriaBuilder<T> joinEqual(String joinField, @NotNull @NotNull String field, @NotNull @NotNull Object value, jakarta.persistence.criteria.JoinType joinType) 添加关联查询条件- 类型参数:
X- 关联实体类型- 参数:
joinField- 关联字段field- 字段value- 值joinType- 关联类型- 返回:
- JapCriteriaBuilder
-
add
public JpaCriteriaBuilder<T> add(Function<jakarta.persistence.criteria.Root<T>, jakarta.persistence.criteria.Predicate> condition) 添加自定义查询条件- 参数:
condition- 自定义查询条件- 返回:
- JapCriteriaBuilder
-
or
或查询- 参数:
otherBuilder- 其他查询条件- 返回:
- JapCriteriaBuilder
-
page
页码- 参数:
page- 页码- 返回:
- JapCriteriaBuilder
-
size
每页大小- 参数:
size- 每页大小- 返回:
- JapCriteriaBuilder
-
orderBy
public JpaCriteriaBuilder<T> orderBy(@NotNull @NotNull String field, @NotNull org.springframework.data.domain.Sort.Direction direction) 排序- 参数:
field- 字段direction- 排序方向- 返回:
- JapCriteriaBuilder
-
toPageable
public org.springframework.data.domain.Pageable toPageable()构建分页查询条件- 返回:
- Pageable
-
build
构建查询条件- 返回:
- Specification
-