mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 00:58:24 +08:00
Merge branch 'main' of https://gitee.com/mybatis-flex/mybatis-flex
This commit is contained in:
commit
4263a6a742
@ -30,6 +30,7 @@ import java.sql.SQLException;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 代码生成器。
|
* 代码生成器。
|
||||||
@ -55,11 +56,18 @@ public class Generator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void generate() {
|
public void generate() {
|
||||||
try (Connection conn = dataSource.getConnection();) {
|
try (Connection conn = dataSource.getConnection()) {
|
||||||
|
|
||||||
dbMeta = conn.getMetaData();
|
dbMeta = conn.getMetaData();
|
||||||
List<Table> tables = buildTables(conn);
|
List<Table> tables = buildTables(conn);
|
||||||
|
|
||||||
|
if (tables.isEmpty()) {
|
||||||
|
System.err.printf("table %s not found.%n", globalConfig.getGenerateTables());
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
System.out.printf("find tables: %s%n", tables.stream().map(Table::getName).collect(Collectors.toSet()));
|
||||||
|
}
|
||||||
|
|
||||||
for (Table table : tables) {
|
for (Table table : tables) {
|
||||||
Collection<IGenerator> generators = GeneratorFactory.getGenerators();
|
Collection<IGenerator> generators = GeneratorFactory.getGenerators();
|
||||||
for (IGenerator generator : generators) {
|
for (IGenerator generator : generators) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user