| 程序包 | 说明 |
|---|---|
| io.polaris.core.jdbc.sql | |
| io.polaris.core.jdbc.sql.statement | |
| io.polaris.core.jdbc.sql.statement.segment |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
SqlStatements.buildCount(Predicate<String> varPropFilter,
Map<String,Object> bindings,
Class<?> entityClass,
String entityKey,
String whereKey,
ColumnPredicate columnPredicate)
构建COUNT查询语句
|
static String |
SqlStatements.buildCount(Predicate<String> varPropFilter,
Map<String,Object> bindings,
Class<?> entityClass,
String entityKey,
String whereKey,
ColumnPredicate columnPredicate,
boolean withLogicDeleted)
构建用于统计记录数量的 SQL COUNT 查询语句。
|
static SqlNodeBuilder |
EntityStatements.buildDelete(Map<String,Object> bindings,
Class<?> entityClass,
String tableAlias,
boolean byId,
String entityKey,
String whereKey,
ColumnPredicate columnPredicate,
boolean logicDeleted)
构建 DELETE 或 UPDATE(逻辑删除时)SQL 语句的 SqlNodeBuilder。
|
static String |
SqlStatements.buildDeleteByAny(Predicate<String> varPropFilter,
Map<String,Object> bindings,
Class<?> entityClass,
boolean withLogicDeleted,
String entityKey,
String whereKey,
ColumnPredicate whereColumnPredicate)
构建根据任意条件进行(逻辑)删除的 SQL 语句。
|
static String |
SqlStatements.buildDirectDeleteByAny(Predicate<String> varPropFilter,
Map<String,Object> bindings,
Class<?> entityClass,
String entityKey,
String whereKey,
ColumnPredicate columnPredicate)
构建直接删除SQL语句,支持通过实体对象或条件对象指定删除条件
|
static String |
SqlStatements.buildExistsByAny(Predicate<String> varPropFilter,
Map<String,Object> bindings,
Class<?> entityClass,
String entityKey,
String whereKey,
ColumnPredicate columnPredicate,
boolean queryByCount)
构建存在性查询SQL语句,用于检查是否存在满足条件的记录
|
static String |
SqlStatements.buildExistsByAny(Predicate<String> varPropFilter,
Map<String,Object> bindings,
Class<?> entityClass,
String entityKey,
String whereKey,
ColumnPredicate columnPredicate,
boolean queryByCount,
boolean withLogicDeleted)
构建一个用于判断记录是否存在的SQL语句,支持通过实体对象或条件对象(Criteria)指定查询条件。
|
static InsertStatement<?> |
EntityStatements.buildInsert(Map<String,Object> bindings,
Class<?> entityClass,
String entityKey,
boolean enableReplace,
boolean enableUpdateByDuplicateKey,
ColumnPredicate columnPredicate)
构建插入语句对象
|
static String |
SqlStatements.buildInsert(Predicate<String> varPropFilter,
Map<String,Object> bindings,
Class<?> entityClass,
String entityKey,
ColumnPredicate columnPredicate)
构建插入语句(INSERT)的 SQL 字符串。
|
static String |
SqlStatements.buildLogicDeleteByAny(Predicate<String> varPropFilter,
Map<String,Object> bindings,
Class<?> entityClass,
String entityKey,
String whereKey,
ColumnPredicate whereColumnPredicate)
构建逻辑删除SQL语句
|
static MergeStatement<?> |
EntityStatements.buildMerge(Map<String,Object> bindings,
Class<?> entityClass,
String tableAlias,
String entityKey,
boolean updateWhenMatched,
boolean insertWhenNotMatched,
ColumnPredicate columnPredicate)
构建MergeStatement对象的工厂方法
|
static SelectStatement<?> |
EntityStatements.buildSelect(Map<String,Object> bindings,
Class<?> entityClass,
String tableAlias,
boolean byId,
String entityKey,
String whereKey,
String orderByKey,
ColumnPredicate columnPredicate,
boolean exceptLogicDeleted)
构建一个 SelectStatement 对象,用于执行数据库查询操作。
|
static String |
SqlStatements.buildSelectByAny(Predicate<String> varPropFilter,
Map<String,Object> bindings,
Class<?> entityClass,
String entityKey,
String whereKey,
String orderByKey,
ColumnPredicate columnPredicate)
构建根据任意条件查询的SQL语句
|
static String |
SqlStatements.buildSelectByAny(Predicate<String> varPropFilter,
Map<String,Object> bindings,
Class<?> entityClass,
String entityKey,
String whereKey,
String orderByKey,
ColumnPredicate columnPredicate,
boolean withLogicDeleted)
构建一个 SELECT 查询语句,支持根据实体对象、条件对象(Criteria)、排序等动态生成 SQL。
|
static UpdateStatement<?> |
EntityStatements.buildUpdate(Map<String,Object> bindings,
Class<?> entityClass,
String tableAlias,
boolean byId,
String entityKey,
String whereKey,
ColumnPredicate columnPredicate,
ColumnPredicate whereColumnPredicate)
构建更新语句
|
static String |
SqlStatements.buildUpdateByAny(Predicate<String> varPropFilter,
Map<String,Object> bindings,
Class<?> entityClass,
String entityKey,
String whereKey,
ColumnPredicate columnPredicate,
ColumnPredicate whereColumnPredicate)
构建根据任意条件更新实体的 SQL 语句。
|
static String |
SqlStatements.buildUpdateById(Predicate<String> varPropFilter,
Map<String,Object> bindings,
Class<?> entityClass,
String entityKey,
String whereKey,
ColumnPredicate columnPredicate)
构建根据ID更新记录的SQL语句。
|
| 限定符和类型 | 类和说明 |
|---|---|
class |
ConfigurableColumnPredicate |
class |
DefaultColumnPredicate |
| 限定符和类型 | 字段和说明 |
|---|---|
static ColumnPredicate |
ColumnPredicate.ALL |
static ColumnPredicate |
ColumnPredicate.DEFAULT |
| 限定符和类型 | 方法和说明 |
|---|---|
static ColumnPredicate |
ConfigurableColumnPredicate.of(Map<String,Object> bindings,
ColumnPredicate predicate) |
static ColumnPredicate |
ConfigurableColumnPredicate.of(Map<String,Object> bindings,
String[] includeColumns,
String[] includeColumnsKey,
String[] excludeColumns,
String[] excludeColumnsKey,
String[] includeEmptyColumns,
String[] includeEmptyColumnsKey,
boolean includeAllEmpty,
String[] includeAllEmptyKey) |
static ColumnPredicate |
ConfigurableColumnPredicate.of(Map<String,Object> bindings,
String[] includeColumns,
String includeColumnsKey,
String[] excludeColumns,
String excludeColumnsKey,
String[] includeEmptyColumns,
String includeEmptyColumnsKey,
boolean includeAllEmpty,
String includeAllEmptyKey) |
static ColumnPredicate |
ConfigurableColumnPredicate.of(Predicate<String> isIncludeEmptyColumns) |
static ColumnPredicate |
ConfigurableColumnPredicate.of(Predicate<String> isIncludeColumns,
Predicate<String> isExcludeColumns,
Predicate<String> isIncludeEmptyColumns,
boolean includeAllEmpty) |
static ColumnPredicate |
ConfigurableColumnPredicate.of(String[] includeEmptyColumns) |
static ColumnPredicate |
ConfigurableColumnPredicate.of(String[] includeColumns,
String[] excludeColumns,
String[] includeEmptyColumns,
boolean includeAllEmpty) |
| 限定符和类型 | 方法和说明 |
|---|---|
S |
MergeStatement.withEntity(Object entity,
boolean updateWhenMatched,
boolean insertWhenNotMatched,
ColumnPredicate columnPredicate) |
S |
MergeStatement.withEntity(Object entity,
boolean updateWhenMatched,
boolean insertWhenNotMatched,
ColumnPredicate columnPredicate,
Set<String> keyColumns) |
S |
UpdateStatement.withEntity(Object entity,
ColumnPredicate columnPredicate) |
S |
MergeStatement.withEntity(Object entity,
ColumnPredicate columnPredicate) |
S |
InsertStatement.withEntity(Object entity,
ColumnPredicate columnPredicate) |
S |
MergeStatement.withEntity(Object entity,
ColumnPredicate columnPredicate,
Set<String> keyColumns) |
| 限定符和类型 | 方法和说明 |
|---|---|
S |
WhereSegment.byEntity(Object entity,
ColumnPredicate columnPredicate) |
Copyright © 2025 fossc. All rights reserved.