Skip to content

Commit

Permalink
Merge branch 'jdk17' into jdk17-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
lltx committed Aug 27, 2024
2 parents 468693c + 1d1b470 commit d4a190d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import cn.smallbun.screw.core.constant.DefaultConstants;
import lombok.Data;
import org.anyline.util.ConfigTable;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

Expand All @@ -14,7 +16,7 @@
@Data
@Configuration(proxyBeanMethods = false)
@ConfigurationProperties(prefix = PigCodeGenDefaultProperties.PREFIX)
public class PigCodeGenDefaultProperties {
public class PigCodeGenDefaultProperties implements InitializingBean {

public static final String PREFIX = "codegen";

Expand Down Expand Up @@ -73,4 +75,9 @@ public class PigCodeGenDefaultProperties {
*/
private String generatorType = "0";

@Override
public void afterPropertiesSet() throws Exception {
ConfigTable.KEEP_ADAPTER = 0;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import org.anyline.metadata.Column;
import org.anyline.metadata.Database;
import org.anyline.metadata.Table;
import org.anyline.proxy.CacheProxy;
import org.anyline.proxy.ServiceProxy;
import org.anyline.service.AnylineService;
import org.jetbrains.annotations.NotNull;
Expand Down Expand Up @@ -96,6 +97,7 @@ public String queryTableDdl(String dsName, String tableName) throws Exception {
public List<String> queryTableColumn(String dsName, String tableName) {
// 手动切换数据源
DynamicDataSourceContextHolder.push(dsName);
CacheProxy.clear();
return ServiceProxy.metadata().columns(tableName).values().stream().map(Column::getName).toList();
}

Expand All @@ -109,6 +111,7 @@ public List<String> queryTableColumn(String dsName, String tableName) {
public IPage queryTablePage(Page<Table> page, GenTable table) {
// 手动切换数据源
DynamicDataSourceContextHolder.push(table.getDsName());
CacheProxy.clear();
List<Table> tableList = ServiceProxy.metadata().tables().values().stream().filter(t -> {
if (StrUtil.isBlank(table.getTableName())) {
return true;
Expand All @@ -132,6 +135,7 @@ public IPage queryTablePage(Page<Table> page, GenTable table) {
public List<String> queryTableList(String dsName) {
// 手动切换数据源
DynamicDataSourceContextHolder.push(dsName);
CacheProxy.clear();
return ServiceProxy.metadata().tables().values().stream().map(Table::getName).toList();
}

Expand Down Expand Up @@ -170,6 +174,7 @@ protected GenTable tableImport(String dsName, String tableName) {
// 查询表是否存在
GenTable table = new GenTable();
// 从数据库获取表信息
CacheProxy.clear();
AnylineService service = ServiceProxy.service();
Table tableMetadata = service.metadata().table(tableName);
Database database = service.metadata().database();
Expand Down

0 comments on commit d4a190d

Please sign in to comment.