public interface Dialect extends Serializable
| Modifier and Type | Method and Description |
|---|---|
String |
dialectName()
方言名
|
QuoteWrapper |
getWrapper() |
default PreparedStatement |
psForCount(Connection conn,
Query query)
构建用于查询行数的
PreparedStatement用户实现需按照数据库方言格式,将 Query转换为带有占位符的SQL语句及参数列表Query中包含了表名、查询条件等信息,可借助SqlBuilder完成SQL语句生成。 |
default PreparedStatement |
psForCount(Connection conn,
SqlBuilder sqlBuilder)
构建用于查询行数的
PreparedStatement用户实现需按照数据库方言格式,将 Query转换为带有占位符的SQL语句及参数列表Query中包含了表名、查询条件等信息,可借助SqlBuilder完成SQL语句生成。 |
PreparedStatement |
psForDelete(Connection conn,
Query query)
构建用于删除的
PreparedStatement用户实现需按照数据库方言格式,将 Query转换为带有占位符的SQL语句及参数列表Query中包含了删除所需的表名、查询条件等信息,可借助SqlBuilder完成SQL语句生成。 |
PreparedStatement |
psForFind(Connection conn,
Query query)
构建用于获取多条记录的
PreparedStatement用户实现需按照数据库方言格式,将 Query转换为带有占位符的SQL语句及参数列表Query中包含了查询所需的表名、查询条件等信息,可借助SqlBuilder完成SQL语句生成。 |
PreparedStatement |
psForInsert(boolean returnGeneratedKey,
Connection conn,
Entity entity)
|
PreparedStatement |
psForInsertBatch(Connection conn,
Entity... entities)
构建用于批量插入的PreparedStatement
用户实现需按照数据库方言格式,将 Entity转换为带有占位符的SQL语句及参数列表 |
PreparedStatement |
psForPage(Connection conn,
Query query)
构建用于分页查询的
PreparedStatement用户实现需按照数据库方言格式,将 Query转换为带有占位符的SQL语句及参数列表Query中包含了分页查询所需的表名、查询条件、分页等信息,可借助SqlBuilder完成SQL语句生成。 |
PreparedStatement |
psForPage(Connection conn,
SqlBuilder sqlBuilder,
Page page)
|
PreparedStatement |
psForUpdate(Connection conn,
Entity entity,
Query query)
构建用于更新的
PreparedStatement用户实现需按照数据库方言格式,将 Entity配合Query转换为带有占位符的SQL语句及参数列表其中 Entity中包含需要更新的数据信息,Query包含更新的查找条件信息。 |
PreparedStatement |
psForUpsert(Connection conn,
Entity entity,
String... keys)
|
void |
setWrapper(QuoteWrapper quoteWrapper)
设置包装器
|
String dialectName()
QuoteWrapper getWrapper()
void setWrapper(QuoteWrapper quoteWrapper)
quoteWrapper - 包装器PreparedStatement psForInsert(boolean returnGeneratedKey, Connection conn, Entity entity) throws DbException
returnGeneratedKey - 是否返回自增主键conn - 数据库连接对象entity - 数据实体类(包含表名)DbException - SQL执行异常PreparedStatement psForInsertBatch(Connection conn, Entity... entities) throws DbException
Entity转换为带有占位符的SQL语句及参数列表conn - 数据库连接对象entities - 数据实体,实体的结构必须全部一致,否则插入结果将不可预知DbException - SQL执行异常PreparedStatement psForDelete(Connection conn, Query query) throws DbException
PreparedStatementQuery转换为带有占位符的SQL语句及参数列表Query中包含了删除所需的表名、查询条件等信息,可借助SqlBuilder完成SQL语句生成。conn - 数据库连接对象query - 查找条件(包含表名)DbException - SQL执行异常PreparedStatement psForUpdate(Connection conn, Entity entity, Query query) throws DbException
PreparedStatementEntity配合Query转换为带有占位符的SQL语句及参数列表Entity中包含需要更新的数据信息,Query包含更新的查找条件信息。conn - 数据库连接对象entity - 数据实体类(包含表名)query - 查找条件(包含表名)DbException - SQL执行异常PreparedStatement psForUpsert(Connection conn, Entity entity, String... keys) throws DbException
conn - 数据库连接对象entity - 数据实体类(包含表名)keys - 查找字段,某些数据库此字段必须,如H2,某些数据库无需此字段,如MySQL(通过主键)DbException - SQL执行异常,或方言数据不支持此操作PreparedStatement psForFind(Connection conn, Query query) throws DbException
PreparedStatementQuery转换为带有占位符的SQL语句及参数列表Query中包含了查询所需的表名、查询条件等信息,可借助SqlBuilder完成SQL语句生成。conn - 数据库连接对象query - 查询条件(包含表名)DbException - SQL执行异常PreparedStatement psForPage(Connection conn, Query query) throws DbException
PreparedStatementQuery转换为带有占位符的SQL语句及参数列表Query中包含了分页查询所需的表名、查询条件、分页等信息,可借助SqlBuilder完成SQL语句生成。conn - 数据库连接对象query - 查询条件(包含表名)DbException - SQL执行异常PreparedStatement psForPage(Connection conn, SqlBuilder sqlBuilder, Page page) throws DbException
conn - 数据库连接对象sqlBuilder - SQL构建器,可以使用SqlBuilder.of(CharSequence) 包装普通SQLpage - 分页对象DbException - SQL执行异常default PreparedStatement psForCount(Connection conn, Query query) throws DbException
PreparedStatementQuery转换为带有占位符的SQL语句及参数列表Query中包含了表名、查询条件等信息,可借助SqlBuilder完成SQL语句生成。conn - 数据库连接对象query - 查询条件(包含表名)DbException - SQL执行异常default PreparedStatement psForCount(Connection conn, SqlBuilder sqlBuilder) throws DbException
PreparedStatementQuery转换为带有占位符的SQL语句及参数列表Query中包含了表名、查询条件等信息,可借助SqlBuilder完成SQL语句生成。conn - 数据库连接对象sqlBuilder - 查询语句,应该包含分页等信息DbException - SQL执行异常Copyright © 2025. All rights reserved.