Skip to content

Commit 40b10d6

Browse files
committedOct 18, 2019
Add support for kingbase.
1 parent 91a922a commit 40b10d6

File tree

14 files changed

+464
-0
lines changed

14 files changed

+464
-0
lines changed
 

‎build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ ext {
7171
"postgresql" : "org.postgresql:postgresql:9.4.1212",
7272
"oracle" : fileTree(dir: 'libs', includes: ['ojdbc-11.2.0.3-jdk16.jar']),
7373
"dm" : fileTree(dir: 'libs', includes: ["jdbcDriver-18.jar"]),
74+
"kingbase" : fileTree(dir: 'libs', includes: ["kingbase8-8.2.0.jar"]),
7475
"h2" : "com.h2database:h2:1.4.197",
7576
"mysql" : "mysql:mysql-connector-java:8.0.15",
7677
"sqlite" : "org.xerial:sqlite-jdbc:3.27.2.1",

‎libs/kingbase8-8.2.0.jar

786 KB
Binary file not shown.

‎mybatis-plus-annotation/src/main/java/com/baomidou/mybatisplus/annotation/DbType.java

+4
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ public enum DbType {
7878
* xugu
7979
*/
8080
XU_GU("xugu", "虚谷数据库", "com.baomidou.mybatisplus.extension.plugins.pagination.dialects.XuGuDialect"),
81+
/**
82+
* Kingbase
83+
*/
84+
KINGBASE_ES("kingbasees", "人大金仓数据库", "com.baomidou.mybatisplus.extension.plugins.pagination.dialects.KingbaseDialect"),
8185
/**
8286
* UNKONWN DB
8387
*/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Copyright (c) 2011-2020, baomidou (jobob@qq.com).
3+
* <p>
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* the License at
7+
* <p>
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
* <p>
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*/
16+
package com.baomidou.mybatisplus.extension.incrementer;
17+
18+
import com.baomidou.mybatisplus.core.incrementer.IKeyGenerator;
19+
20+
/**
21+
* Kingbase Sequence
22+
*
23+
* @author kingbase
24+
* @since 2019-10-17
25+
*/
26+
public class KingbaseKeyGenerator implements IKeyGenerator {
27+
28+
@Override
29+
public String executeSql(String incrementerName) {
30+
return "select nextval('" + incrementerName + "')";
31+
}
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright (c) 2011-2020, baomidou (jobob@qq.com).
3+
* <p>
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* the License at
7+
* <p>
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
* <p>
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*/
16+
package com.baomidou.mybatisplus.extension.plugins.pagination.dialects;
17+
18+
/**
19+
* Kingbase 数据库分页语句组装实现
20+
*
21+
* @author kingbase
22+
* @since 2019-10-12
23+
*/
24+
public class KingbaseDialect extends PostgreDialect {
25+
}

‎mybatis-plus-extension/src/main/java/com/baomidou/mybatisplus/extension/toolkit/JdbcUtils.java

+2
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ public static DbType getDbType(String jdbcUrl) {
6363
return DbType.DM;
6464
} else if (jdbcUrl.contains(":xugu:")) {
6565
return DbType.XU_GU;
66+
} else if (jdbcUrl.contains(":kingbase:") || jdbcUrl.contains(":kingbase8:")) {
67+
return DbType.KINGBASE_ES;
6668
} else {
6769
logger.warn("The jdbcUrl is " + jdbcUrl + ", Mybatis Plus Cannot Read Database type or The Database's Not Supported!");
6870
return DbType.OTHER;

‎mybatis-plus-generator/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ dependencies {
99
testCompile "${lib.postgresql}"
1010
testCompile lib.oracle as ConfigurableFileTree
1111
testCompile lib.dm as ConfigurableFileTree
12+
testCompile lib.kingbase as ConfigurableFileTree
1213
testCompile "${lib.h2}"
1314
testCompile "${lib.mysql}"
1415
testCompile "${lib.sqlite}"

‎mybatis-plus-generator/src/main/java/com/baomidou/mybatisplus/generator/config/DataSourceConfig.java

+8
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ public IDbQuery getDbQuery() {
9696
case DM:
9797
dbQuery = new DMQuery();
9898
break;
99+
case KINGBASE_ES:
100+
dbQuery = new KingbaseESQuery();
101+
break;
99102
default:
100103
// 默认 MYSQL
101104
dbQuery = new MySqlQuery();
@@ -147,6 +150,8 @@ private DbType getDbType(String str) {
147150
return DbType.MARIADB;
148151
} else if (str.contains("h2")) {
149152
return DbType.H2;
153+
} else if (str.contains("kingbase") || str.contains("kingbase8")) {
154+
return DbType.KINGBASE_ES;
150155
} else {
151156
return null;
152157
}
@@ -176,6 +181,9 @@ public ITypeConvert getTypeConvert() {
176181
case MARIADB:
177182
typeConvert = new MySqlTypeConvert();
178183
break;
184+
case KINGBASE_ES:
185+
typeConvert = new KingbaseESTypeConvert();
186+
break;
179187
default:
180188
// 默认 MYSQL
181189
typeConvert = new MySqlTypeConvert();

‎mybatis-plus-generator/src/main/java/com/baomidou/mybatisplus/generator/config/builder/ConfigBuilder.java

+11
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,15 @@ private List<TableInfo> getTablesInfo(StrategyConfig config) {
421421
}
422422
tablesSql = String.format(tablesSql, schema);
423423
}
424+
if (DbType.KINGBASE_ES == dbQuery.dbType()) {
425+
String schema = dataSourceConfig.getSchemaName();
426+
if (schema == null) {
427+
//kingbase 默认 schema=PUBLIC
428+
schema = "PUBLIC";
429+
dataSourceConfig.setSchemaName(schema);
430+
}
431+
tablesSql = String.format(tablesSql, schema);
432+
}
424433
if (DbType.DB2 == dbQuery.dbType()) {
425434
String schema = dataSourceConfig.getSchemaName();
426435
if (schema == null) {
@@ -551,6 +560,8 @@ private TableInfo convertTableFields(TableInfo tableInfo, StrategyConfig config)
551560
Set<String> h2PkColumns = new HashSet<>();
552561
if (DbType.POSTGRE_SQL == dbType) {
553562
tableFieldsSql = String.format(tableFieldsSql, dataSourceConfig.getSchemaName(), tableName);
563+
} else if (DbType.KINGBASE_ES == dbType) {
564+
tableFieldsSql = String.format(tableFieldsSql, dataSourceConfig.getSchemaName(), tableName);
554565
} else if (DbType.DB2 == dbType) {
555566
tableFieldsSql = String.format(tableFieldsSql, dataSourceConfig.getSchemaName(), tableName);
556567
} else if (DbType.ORACLE == dbType) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/*
2+
* Copyright (c) 2011-2020, baomidou (jobob@qq.com).
3+
* <p>
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* the License at
7+
* <p>
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
* <p>
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*/
16+
package com.baomidou.mybatisplus.generator.config.converts;
17+
18+
import com.baomidou.mybatisplus.generator.config.GlobalConfig;
19+
import com.baomidou.mybatisplus.generator.config.ITypeConvert;
20+
import com.baomidou.mybatisplus.generator.config.rules.DbColumnType;
21+
import com.baomidou.mybatisplus.generator.config.rules.IColumnType;
22+
23+
/**
24+
* KingbaseES 字段类型转换
25+
*
26+
* @author kingbase
27+
* @since 2019-10-12
28+
*/
29+
public class KingbaseESTypeConvert implements ITypeConvert {
30+
31+
@Override
32+
public IColumnType processTypeConvert(GlobalConfig globalConfig, String fieldType) {
33+
String t = fieldType.toLowerCase();
34+
if (t.contains("char")) {
35+
return DbColumnType.STRING;
36+
} else if (t.contains("bigint")) {
37+
return DbColumnType.LONG;
38+
} else if (t.contains("int")) {
39+
return DbColumnType.INTEGER;
40+
} else if (t.contains("date") || t.contains("time")) {
41+
switch (globalConfig.getDateType()) {
42+
case ONLY_DATE:
43+
return DbColumnType.DATE;
44+
case SQL_PACK:
45+
switch (t) {
46+
case "date":
47+
return DbColumnType.DATE_SQL;
48+
case "time":
49+
return DbColumnType.TIME;
50+
default:
51+
return DbColumnType.TIMESTAMP;
52+
}
53+
case TIME_PACK:
54+
switch (t) {
55+
case "date":
56+
return DbColumnType.LOCAL_DATE;
57+
case "time":
58+
return DbColumnType.LOCAL_TIME;
59+
default:
60+
return DbColumnType.LOCAL_DATE_TIME;
61+
}
62+
default:
63+
return DbColumnType.DATE;
64+
}
65+
} else if (t.contains("text")) {
66+
return DbColumnType.STRING;
67+
} else if (t.contains("bit")) {
68+
return DbColumnType.BOOLEAN;
69+
} else if (t.contains("decimal")) {
70+
return DbColumnType.BIG_DECIMAL;
71+
} else if (t.contains("clob")) {
72+
return DbColumnType.CLOB;
73+
} else if (t.contains("blob")) {
74+
return DbColumnType.BYTE_ARRAY;
75+
} else if (t.contains("float")) {
76+
return DbColumnType.FLOAT;
77+
} else if (t.contains("double")) {
78+
return DbColumnType.DOUBLE;
79+
} else if (t.contains("json") || t.contains("enum")) {
80+
return DbColumnType.STRING;
81+
} else if (t.contains("boolean")) {
82+
return DbColumnType.BOOLEAN;
83+
} else if (t.contains("numeric")) {
84+
return DbColumnType.BIG_DECIMAL;
85+
}
86+
return DbColumnType.STRING;
87+
}
88+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
/*
2+
* Copyright (c) 2011-2020, baomidou (jobob@qq.com).
3+
* <p>
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* the License at
7+
* <p>
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
* <p>
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*/
16+
package com.baomidou.mybatisplus.generator.config.querys;
17+
18+
import com.baomidou.mybatisplus.annotation.DbType;
19+
20+
/**
21+
* KingbaseES 表数据查询
22+
*
23+
* @author kingbase
24+
* @since 2019-10-12
25+
*/
26+
public class KingbaseESQuery extends AbstractDbQuery {
27+
28+
29+
@Override
30+
public DbType dbType() {
31+
return DbType.KINGBASE_ES;
32+
}
33+
34+
35+
@Override
36+
public String tablesSql() {
37+
return "SELECT A.tablename, obj_description(relfilenode, 'sys_class') AS comments FROM sys_tables A, sys_class B WHERE A.schemaname='%s' AND A.tablename = B.relname";
38+
}
39+
40+
41+
@Override
42+
public String tableFieldsSql() {
43+
return "SELECT A.attname AS name, format_type(A.atttypid, A.atttypmod) AS type,col_description(A.attrelid, A.attnum) AS comment, (CASE C.contype WHEN 'p' THEN 'PRI' ELSE '' END) AS key " +
44+
"FROM sys_attribute A LEFT JOIN sys_constraint C ON A.attnum = C.conkey[1] AND A.attrelid = C.conrelid " +
45+
"WHERE A.attrelid = '%s.%s'::regclass AND A.attnum > 0 AND NOT A.attisdropped ORDER BY A.attnum";
46+
}
47+
48+
49+
@Override
50+
public String tableName() {
51+
return "tablename";
52+
}
53+
54+
55+
@Override
56+
public String tableComment() {
57+
return "comments";
58+
}
59+
60+
61+
@Override
62+
public String fieldName() {
63+
return "name";
64+
}
65+
66+
67+
@Override
68+
public String fieldType() {
69+
return "type";
70+
}
71+
72+
73+
@Override
74+
public String fieldComment() {
75+
return "comment";
76+
}
77+
78+
79+
@Override
80+
public String fieldKey() {
81+
return "key";
82+
}
83+
84+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
/*
2+
* Copyright (c) 2011-2020, baomidou (jobob@qq.com).
3+
* <p>
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* the License at
7+
* <p>
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
* <p>
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*/
16+
package com.baomidou.mybatisplus.test.generator;
17+
18+
import java.util.ArrayList;
19+
import java.util.HashMap;
20+
import java.util.List;
21+
import java.util.Map;
22+
23+
import com.baomidou.mybatisplus.annotation.DbType;
24+
import com.baomidou.mybatisplus.annotation.IdType;
25+
import com.baomidou.mybatisplus.core.toolkit.StringPool;
26+
import com.baomidou.mybatisplus.generator.AutoGenerator;
27+
import com.baomidou.mybatisplus.generator.InjectionConfig;
28+
import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
29+
import com.baomidou.mybatisplus.generator.config.FileOutConfig;
30+
import com.baomidou.mybatisplus.generator.config.GlobalConfig;
31+
import com.baomidou.mybatisplus.generator.config.PackageConfig;
32+
import com.baomidou.mybatisplus.generator.config.StrategyConfig;
33+
import com.baomidou.mybatisplus.generator.config.converts.OracleTypeConvert;
34+
import com.baomidou.mybatisplus.generator.config.po.TableInfo;
35+
import com.baomidou.mybatisplus.generator.config.rules.IColumnType;
36+
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
37+
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
38+
39+
/**
40+
* KingbaseESGenerator
41+
*
42+
* @author kingbase
43+
* @since 2019/10/12
44+
*/
45+
public class KingbaseESGenerator extends GeneratorTest {
46+
47+
public static void main(String[] args) {
48+
int result = scanner();
49+
AutoGenerator mpg = new AutoGenerator();
50+
51+
// 全局配置
52+
GlobalConfig gc = new GlobalConfig();
53+
gc.setOutputDir("D://");
54+
gc.setFileOverride(true);
55+
gc.setActiveRecord(true);// 开启 activeRecord 模式
56+
gc.setEnableCache(false);// XML 二级缓存
57+
gc.setBaseResultMap(true);// XML ResultMap
58+
gc.setBaseColumnList(false);// XML columList
59+
//gc.setKotlin(true); // 是否生成 kotlin 代码
60+
//gc.setSwagger2(true); // 是否生成 Swagger2 注解
61+
gc.setAuthor("kingbase");
62+
gc.setIdType(IdType.AUTO);
63+
64+
// 自定义文件命名,注意 %s 会自动填充表实体属性!
65+
// gc.setEntityName("%sEntity");
66+
// gc.setMapperName("%sDao");
67+
// gc.setXmlName("%sDao");
68+
// gc.setServiceName("MP%sService");
69+
// gc.setServiceImplName("%sServiceDiy");
70+
// gc.setControllerName("%sAction");
71+
mpg.setGlobalConfig(gc);
72+
73+
// 数据源配置
74+
DataSourceConfig dsc = new DataSourceConfig();
75+
dsc.setSchemaName("PUBLIC");// 指定 SCHEMA
76+
dsc.setDbType(DbType.KINGBASE_ES);
77+
dsc.setTypeConvert(new OracleTypeConvert() {
78+
// 自定义数据库表字段类型转换【可选】
79+
@Override
80+
public IColumnType processTypeConvert(GlobalConfig globalConfig, String fieldType) {
81+
System.out.println("转换类型:" + fieldType);
82+
return super.processTypeConvert(globalConfig, fieldType);
83+
}
84+
});
85+
// 自定义数据库信息查询
86+
dsc.setDbQuery(new MyKingbaseESQuery());
87+
dsc.setDriverName("com.kingbase8.Driver");
88+
dsc.setUsername("SYSTEM");
89+
dsc.setPassword("123456");
90+
dsc.setUrl("jdbc:kingbase8://localhost:54321/mybatis-plus");
91+
mpg.setDataSource(dsc);
92+
93+
// 策略配置
94+
StrategyConfig strategy = new StrategyConfig();
95+
// strategy.setCapitalMode(true);// 全局大写命名
96+
// strategy.setDbColumnUnderline(true);// 全局下划线命名
97+
strategy.setTablePrefix("BMD_", "MP_");// 表前缀
98+
strategy.setFieldPrefix("A_");
99+
strategy.setNaming(NamingStrategy.underline_to_camel);// 表名生成策略
100+
strategy.setColumnNaming(NamingStrategy.underline_to_camel);// 允许字段策略独立设置,默认为 naming 策略
101+
strategy.setInclude("T_USER", "^MP.*", "OK"); // 需要生成的表,支持正则表达式
102+
// strategy.setExclude("test"); // 排除生成的表,支持正则表达式
103+
// 自定义实体父类
104+
// strategy.setSuperEntityClass("com.baomidou.demo.TestEntity");
105+
// 自定义实体,公共字段
106+
// strategy.setSuperEntityColumns(new String[] { "test_id", "age" });
107+
// 自定义 mapper 父类
108+
// strategy.setSuperMapperClass("com.baomidou.demo.TestMapper");
109+
// 自定义 service 父类
110+
// strategy.setSuperServiceClass("com.baomidou.demo.TestService");
111+
// 自定义 service 实现类父类
112+
// strategy.setSuperServiceImplClass("com.baomidou.demo.TestServiceImpl");
113+
// 自定义 controller 父类
114+
// strategy.setSuperControllerClass("com.baomidou.demo.TestController");
115+
// 【实体】是否生成字段常量(默认 false)
116+
// public static final String ID = "test_id";
117+
// strategy.setEntityColumnConstant(true);
118+
// 【实体】是否为构建者模型(默认 false)
119+
// public User setName(String name) {this.name = name; return this;}
120+
// strategy.setEntityBuliderModel(true);
121+
mpg.setStrategy(strategy);
122+
123+
// 包配置
124+
PackageConfig pc = new PackageConfig();
125+
pc.setModuleName("test");
126+
pc.setParent("com.baomidou");// 自定义包路径
127+
pc.setController("controller");// 这里是控制器包名,默认 web
128+
mpg.setPackageInfo(pc);
129+
130+
// 注入自定义配置,可以在 VM 中使用 cfg.abc 设置的值
131+
InjectionConfig cfg = new InjectionConfig() {
132+
@Override
133+
public void initMap() {
134+
Map<String, Object> map = new HashMap<>();
135+
map.put("abc", this.getConfig().getGlobalConfig().getAuthor() + "-mp");
136+
this.setMap(map);
137+
}
138+
};
139+
List<FileOutConfig> focList = new ArrayList<>();
140+
focList.add(new FileOutConfig("/templates/dto.java" + ((1 == result) ? ".ftl" : ".vm")) {
141+
@Override
142+
public String outputFile(TableInfo tableInfo) {
143+
// 自定义输入文件名称
144+
return "D://test/my_" + tableInfo.getEntityName() + StringPool.DOT_JAVA;
145+
}
146+
});
147+
cfg.setFileOutConfigList(focList);
148+
mpg.setCfg(cfg);
149+
150+
// 自定义模板配置,模板可以参考源码 /mybatis-plus/src/main/resources/template 使用 copy
151+
// 至您项目 src/main/resources/template 目录下,模板名称也可自定义如下配置:
152+
// TemplateConfig tc = new TemplateConfig();
153+
// tc.setController("...");
154+
// tc.setEntity("...");
155+
// tc.setMapper("...");
156+
// tc.setXml("...");
157+
// tc.setService("...");
158+
// tc.setServiceImpl("...");
159+
// mpg.setTemplate(tc);
160+
161+
// 执行生成
162+
if (1 == result) {
163+
mpg.setTemplateEngine(new FreemarkerTemplateEngine());
164+
}
165+
mpg.execute();
166+
// 打印注入设置
167+
System.err.println(mpg.getCfg().getMap().get("abc"));
168+
}
169+
170+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright (c) 2011-2020, baomidou (jobob@qq.com).
3+
* <p>
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* the License at
7+
* <p>
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
* <p>
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*/
16+
package com.baomidou.mybatisplus.test.generator;
17+
18+
import com.baomidou.mybatisplus.generator.config.querys.KingbaseESQuery;
19+
20+
public class MyKingbaseESQuery extends KingbaseESQuery {
21+
22+
23+
@Override
24+
public String tableFieldsSql() {
25+
// 固定 abc def 内容,实际可以查询字段大小等信息
26+
return "SELECT 1 AS abc, 2 AS def, A.attname AS name, format_type(A.atttypid, A.atttypmod) AS type,col_description(A.attrelid, A.attnum) AS comment, (CASE C.contype WHEN 'p' THEN 'PRI' ELSE '' END) AS key " +
27+
"FROM sys_attribute A LEFT JOIN sys_constraint C ON A.attnum = C.conkey[1] AND A.attrelid = C.conrelid " +
28+
"WHERE A.attrelid = '%s.%s'::regclass AND A.attnum > 0 AND NOT A.attisdropped ORDER BY A.attnum";
29+
}
30+
31+
32+
@Override
33+
public String[] fieldCustom() {
34+
// 返回自定义查询字段
35+
return new String[]{"abc", "def"};
36+
}
37+
}

‎mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/DbTypeTest.java

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class DbTypeTest {
4343
DIALECT_MAP.put(DbType.SQLITE, SQLiteDialect.class);
4444
DIALECT_MAP.put(DbType.HSQL, HSQLDialect.class);
4545
DIALECT_MAP.put(DbType.XU_GU, XuGuDialect.class);
46+
DIALECT_MAP.put(DbType.KINGBASE_ES, KingbaseDialect.class);
4647
DIALECT_MAP.put(DbType.OTHER, UnknownDialect.class);
4748
}
4849

0 commit comments

Comments
 (0)
Please sign in to comment.