From 17e23ba30adfdf50b837108bf50bf5a5cba4c376 Mon Sep 17 00:00:00 2001 From: binking338 Date: Thu, 8 Aug 2024 15:45:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9mysql8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../java/org/netcorepal/cap4j/ddd/codegen/GenEntityMojo.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 27ad941..52d0e99 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ io.github.netcorepal cap4j-ddd-codegen-maven-plugin - 1.0.0-alpha + 1.0.0-alpha1 maven-plugin diff --git a/src/main/java/org/netcorepal/cap4j/ddd/codegen/GenEntityMojo.java b/src/main/java/org/netcorepal/cap4j/ddd/codegen/GenEntityMojo.java index 79c60c1..91e68fe 100644 --- a/src/main/java/org/netcorepal/cap4j/ddd/codegen/GenEntityMojo.java +++ b/src/main/java/org/netcorepal/cap4j/ddd/codegen/GenEntityMojo.java @@ -15,7 +15,6 @@ import java.io.File; import java.io.FileWriter; import java.io.IOException; -import java.math.BigInteger; import java.sql.*; import java.util.*; import java.util.stream.Collectors; @@ -313,7 +312,7 @@ public void execute() throws MojoExecutionException, MojoFailureException { for (Map table : tables) { List> tableColumns = columns.stream().filter(col -> col.get("TABLE_NAME").equals(table.get("TABLE_NAME"))) - .sorted((a, b) -> ((BigInteger) a.get("ORDINAL_POSITION")).subtract((BigInteger) b.get("ORDINAL_POSITION")).intValue()) + .sorted((a, b) -> (Integer.parseInt(a.get("ORDINAL_POSITION").toString()))- Integer.parseInt( b.get("ORDINAL_POSITION").toString())) .collect(Collectors.toList()); TableMap.put(MysqlSchemaUtils.getTableName(table), table); ColumnsMap.put(MysqlSchemaUtils.getTableName(table), tableColumns);