Class BaseDDLDialect
java.lang.Object
org.huiche.ddl.dialect.BaseDDLDialect
- All Implemented Interfaces:
DDLDialect
- Direct Known Subclasses:
DB2DDLDialect, DMDDLDialect, H2DDLDialect, HSQLDDLDialect, MySQLDDLDialect, OracleDDLDialect, PostgreSQLDDLDialect, SQLiteDDLDialect, SQLServerDDLDialect
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription自增语法片段compareColumn(TableDef table, ColumnDef java, ColumnDef db, ConnectionProvider connectionProvider) 比较列定义compareTable(TableDef java, TableDef db, ConnectionProvider connectionProvider) 比较表定义protected StringconcatType(ColumnDef column) 拼接类型SQL片段标识符转义解析表定义resolveTableByJdbc(ConnectionProvider connectionProvider) 从jdbc读取表定义resolveType(Class<?> javaType, int length, int scale, boolean autoIncrement, EnumBy enumBy, Map<Class<?>, TypeDef> typeMapping) 解析数据库类型翻译新增列语句translate(AddPrimaryKey statement) 翻译新增主键语句翻译新增唯一索引语句translate(AlterColumnComment statement) 翻译修改列注释语句translate(AlterColumnType statement) 翻译修改列语句translate(AlterDefault statement) 翻译设置默认值语句translate(AlterNullabe statement) 翻译新增列NOTNULL语句translate(AlterTableComment statement) 翻译修改表注释语句translate(CreateTable statement) 翻译建表语句translate(DropConstraint statement) 翻译删除约束语句translate(DropPrimaryKey statement) 翻译删除主键语句translate(ModifyColumn statement) 翻译修改列语句translateColumn(ColumnDef column) 翻译列定义protected StringtranslatePKinCreateTable(TableDef table) 翻译建表语句的主键Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface DDLDialect
addPrimaryKeyAddNotNull, addUniqueAddNotNull, bigintType, blobType, booleanType, charType, clobType, compareLengthOrScale, dateType, dbTypeMapping, decimalType, embeddedColumnComment, embeddedTableComment, fallbackType, intType, jsonType, requiresExplicitNotNullForPrimaryKey, resolveEnumType, smallintType, timestrampType, timeType, tinyintType, translate, varcharType
-
Field Details
-
LOG
LOG -
defaultTypeMapping
-
-
Constructor Details
-
BaseDDLDialect
-
-
Method Details
-
autoIncrementSyntaxSegment
Description copied from interface:DDLDialect自增语法片段- Specified by:
autoIncrementSyntaxSegmentin interfaceDDLDialect- Returns:
- 自增语法片段
-
compareColumn
public List<DDLStatement> compareColumn(TableDef table, ColumnDef java, ColumnDef db, ConnectionProvider connectionProvider) Description copied from interface:DDLDialect比较列定义- Specified by:
compareColumnin interfaceDDLDialect- Parameters:
table- 表java- java侧列定义db- 数据库侧列定义, 可能为nullconnectionProvider- 连接提供者- Returns:
- 差异语句
-
compareTable
public List<DDLStatement> compareTable(TableDef java, TableDef db, ConnectionProvider connectionProvider) Description copied from interface:DDLDialect比较表定义- Specified by:
compareTablein interfaceDDLDialect- Parameters:
java- java侧表定义db- 数据库侧表定义, 可能为nullconnectionProvider- 连接提供者- Returns:
- 差异语句
-
resolveTable
Description copied from interface:DDLDialect解析表定义- Specified by:
resolveTablein interfaceDDLDialect- Parameters:
clazz- 实体类enumBy- 枚举取值方式typeMapping- 类型映射- Returns:
- 表定义
-
resolveTableByJdbc
Description copied from interface:DDLDialect从jdbc读取表定义- Specified by:
resolveTableByJdbcin interfaceDDLDialect- Parameters:
connectionProvider- 连接提供者- Returns:
- 表定义
-
resolveType
public TypeDef resolveType(Class<?> javaType, int length, int scale, boolean autoIncrement, EnumBy enumBy, Map<Class<?>, TypeDef> typeMapping) Description copied from interface:DDLDialect解析数据库类型- Specified by:
resolveTypein interfaceDDLDialect- Parameters:
javaType- java类型length- 用户注解传入的长度scale- 用户注解传入的精度autoIncrement- 是否自增enumBy- 枚举读写取值方式typeMapping- 自定义类型映射- Returns:
- 解析后的类型定义
-
translate
Description copied from interface:DDLDialect翻译新增列语句- Specified by:
translatein interfaceDDLDialect- Parameters:
statement- 语句- Returns:
- 翻译后的SQL
-
translate
Description copied from interface:DDLDialect翻译新增列NOTNULL语句- Specified by:
translatein interfaceDDLDialect- Parameters:
statement- 语句- Returns:
- 翻译后的SQL
-
translate
Description copied from interface:DDLDialect翻译新增主键语句- Specified by:
translatein interfaceDDLDialect- Parameters:
statement- 语句- Returns:
- 翻译后的SQL
-
translate
Description copied from interface:DDLDialect翻译新增唯一索引语句- Specified by:
translatein interfaceDDLDialect- Parameters:
statement- 语句- Returns:
- 翻译后的SQL
-
translate
Description copied from interface:DDLDialect翻译修改表注释语句- Specified by:
translatein interfaceDDLDialect- Parameters:
statement- 语句- Returns:
- 翻译后的SQL
-
translate
Description copied from interface:DDLDialect翻译修改列语句- Specified by:
translatein interfaceDDLDialect- Parameters:
statement- 语句- Returns:
- 翻译后的SQL
-
translate
Description copied from interface:DDLDialect翻译修改列注释语句- Specified by:
translatein interfaceDDLDialect- Parameters:
statement- 语句- Returns:
- 翻译后的SQL
-
translate
Description copied from interface:DDLDialect翻译建表语句- Specified by:
translatein interfaceDDLDialect- Parameters:
statement- 语句- Returns:
- 翻译后的SQL
-
translate
Description copied from interface:DDLDialect翻译删除主键语句- Specified by:
translatein interfaceDDLDialect- Parameters:
statement- 语句- Returns:
- 翻译后的SQL
-
translate
Description copied from interface:DDLDialect翻译修改列语句- Specified by:
translatein interfaceDDLDialect- Parameters:
statement- 语句- Returns:
- 翻译后的SQL
-
translate
Description copied from interface:DDLDialect翻译设置默认值语句- Specified by:
translatein interfaceDDLDialect- Parameters:
statement- 语句- Returns:
- 翻译后的SQL
-
translate
Description copied from interface:DDLDialect翻译删除约束语句- Specified by:
translatein interfaceDDLDialect- Parameters:
statement- 语句- Returns:
- 翻译后的SQL
-
translateColumn
Description copied from interface:DDLDialect翻译列定义- Specified by:
translateColumnin interfaceDDLDialect- Parameters:
column- 列定义- Returns:
- 翻译后的SQL
-
concatType
-
quote
-
translatePKinCreateTable
-