feat: 指定生成实体类的数据源。

This commit is contained in:
Suomm 2023-07-13 19:24:38 +08:00
parent 0cceda2607
commit b72fbfddb6

View File

@ -223,6 +223,12 @@ public class Table {
tableAnnotation.append(", schema = \"").append(globalSchema).append("\""); tableAnnotation.append(", schema = \"").append(globalSchema).append("\"");
} }
// 添加 dataSource 配置因为代码生成器是一个数据源生成的所以这些实体类应该都是一个数据源
String dataSource = globalConfig.getEntityDataSource();
if (StringUtil.isNotBlank(dataSource)) {
tableAnnotation.append(", dataSource = \"").append(dataSource).append("\"");
}
if (tableConfig != null) { if (tableConfig != null) {
if (StringUtil.isNotBlank(tableConfig.getSchema())) { if (StringUtil.isNotBlank(tableConfig.getSchema())) {
tableAnnotation.append(", schema = \"").append(tableConfig.getSchema()).append("\""); tableAnnotation.append(", schema = \"").append(tableConfig.getSchema()).append("\"");