public class MysqlDialect extends AnsiSqlDialect
dbConfig, quoteWrapper
Constructor and Description |
---|
MysqlDialect(DbConfig dbConfig)
构造
|
Modifier and Type | Method and Description |
---|---|
String |
dialectName()
方言名
|
PreparedStatement |
psForUpsert(Connection conn,
Entity entity,
String... keys)
构建用于upsert的
PreparedStatement MySQL通过主键方式实现Upsert,故keys无效,生成SQL语法为: INSERT INTO demo(a,b,c) values(? |
protected SqlBuilder |
wrapPageSql(SqlBuilder find,
Page page)
根据不同数据库在查询SQL语句基础上包装其分页的语句
各自数据库通过重写此方法实现最小改动情况下修改分页语句 |
getWrapper, psForDelete, psForFind, psForInsert, psForInsertBatch, psForPage, psForPage, psForUpdate, setWrapper
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
psForCount, psForCount
public MysqlDialect(DbConfig dbConfig)
dbConfig
- 数据库配置protected SqlBuilder wrapPageSql(SqlBuilder find, Page page)
AnsiSqlDialect
wrapPageSql
in class AnsiSqlDialect
find
- 标准查询语句page
- 分页对象public String dialectName()
Dialect
dialectName
in interface Dialect
dialectName
in class AnsiSqlDialect
public PreparedStatement psForUpsert(Connection conn, Entity entity, String... keys)
PreparedStatement
INSERT INTO demo(a,b,c) values(?, ?, ?) ON DUPLICATE KEY UPDATE a=values(a), b=values(b), c=values(c);
psForUpsert
in interface Dialect
psForUpsert
in class AnsiSqlDialect
conn
- 数据库连接对象entity
- 数据实体类(包含表名)keys
- 此参数无效Copyright © 2025. All rights reserved.