public class AnsiSqlDialect extends Object implements Dialect
| Constructor and Description |
|---|
AnsiSqlDialect() |
| Modifier and Type | Method and Description |
|---|---|
String |
dialectName()
方言名
|
Wrapper |
getWrapper() |
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(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包含更新的查找条件信息。 |
void |
setWrapper(Wrapper wrapper)
设置包装器
|
protected SqlBuilder |
wrapPageSql(SqlBuilder find,
Page page)
根据不同数据库在查询SQL语句基础上包装其分页的语句
各自数据库通过重写此方法实现最小改动情况下修改分页语句 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpsForCount, psForCount, psForUpsertprotected Wrapper wrapper
public Wrapper getWrapper()
getWrapper in interface Dialectpublic void setWrapper(Wrapper wrapper)
DialectsetWrapper in interface Dialectwrapper - 包装器public PreparedStatement psForInsert(Connection conn, Entity entity) throws SQLException
DialectpsForInsert in interface Dialectconn - 数据库连接对象entity - 数据实体类(包含表名)SQLException - SQL执行异常public PreparedStatement psForInsertBatch(Connection conn, Entity... entities) throws SQLException
DialectEntity转换为带有占位符的SQL语句及参数列表psForInsertBatch in interface Dialectconn - 数据库连接对象entities - 数据实体,实体的结构必须全部一致,否则插入结果将不可预知SQLException - SQL执行异常public PreparedStatement psForDelete(Connection conn, Query query) throws SQLException
DialectPreparedStatementQuery转换为带有占位符的SQL语句及参数列表Query中包含了删除所需的表名、查询条件等信息,可借助SqlBuilder完成SQL语句生成。psForDelete in interface Dialectconn - 数据库连接对象query - 查找条件(包含表名)SQLException - SQL执行异常public PreparedStatement psForUpdate(Connection conn, Entity entity, Query query) throws SQLException
DialectPreparedStatementEntity配合Query转换为带有占位符的SQL语句及参数列表Entity中包含需要更新的数据信息,Query包含更新的查找条件信息。psForUpdate in interface Dialectconn - 数据库连接对象entity - 数据实体类(包含表名)query - 查找条件(包含表名)SQLException - SQL执行异常public PreparedStatement psForFind(Connection conn, Query query) throws SQLException
DialectPreparedStatementQuery转换为带有占位符的SQL语句及参数列表Query中包含了查询所需的表名、查询条件等信息,可借助SqlBuilder完成SQL语句生成。psForFind in interface Dialectconn - 数据库连接对象query - 查询条件(包含表名)SQLException - SQL执行异常public PreparedStatement psForPage(Connection conn, Query query) throws SQLException
DialectPreparedStatementQuery转换为带有占位符的SQL语句及参数列表Query中包含了分页查询所需的表名、查询条件、分页等信息,可借助SqlBuilder完成SQL语句生成。psForPage in interface Dialectconn - 数据库连接对象query - 查询条件(包含表名)SQLException - SQL执行异常public PreparedStatement psForPage(Connection conn, SqlBuilder sqlBuilder, Page page) throws SQLException
DialectpsForPage in interface Dialectconn - 数据库连接对象sqlBuilder - SQL构建器,可以使用SqlBuilder.of(CharSequence) 包装普通SQLpage - 分页对象SQLException - SQL执行异常protected SqlBuilder wrapPageSql(SqlBuilder find, Page page)
find - 标准查询语句page - 分页对象public String dialectName()
DialectdialectName in interface DialectCopyright © 2025. All rights reserved.