diff --git a/kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/it/TestCases.java b/kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/it/TestCases.java index aaddf5b660cedf..b84e92c7806fb3 100644 --- a/kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/it/TestCases.java +++ b/kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/it/TestCases.java @@ -17,6 +17,7 @@ package org.apache.shardingsphere.sqlfederation.optimizer.it; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import lombok.Getter; @@ -32,5 +33,6 @@ public final class TestCases { @JacksonXmlProperty(localName = "test-case") + @JacksonXmlElementWrapper(useWrapping = false) private final Collection testCases = new LinkedList<>(); } diff --git a/kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/it/TestCasesLoader.java b/kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/it/TestCasesLoader.java index 54ea2a2a374949..c8413dfc7c4c51 100644 --- a/kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/it/TestCasesLoader.java +++ b/kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/it/TestCasesLoader.java @@ -34,7 +34,7 @@ public final class TestCasesLoader { private static final TestCasesLoader INSTANCE = new TestCasesLoader(); - private static final ObjectMapper XML_MAPPER = XmlMapper.builder().defaultUseWrapper(false).build(); + private static final ObjectMapper XML_MAPPER = XmlMapper.builder().build(); /** * Get singleton instance. diff --git a/mode/type/standalone/repository/provider/jdbc/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/sql/JDBCRepositorySQL.java b/mode/type/standalone/repository/provider/jdbc/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/sql/JDBCRepositorySQL.java index 06a934555d4144..056e865c437a82 100644 --- a/mode/type/standalone/repository/provider/jdbc/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/sql/JDBCRepositorySQL.java +++ b/mode/type/standalone/repository/provider/jdbc/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/sql/JDBCRepositorySQL.java @@ -17,6 +17,7 @@ package org.apache.shardingsphere.mode.repository.standalone.jdbc.sql; +import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import lombok.Getter; @@ -28,30 +29,38 @@ @Getter public final class JDBCRepositorySQL { + @JsonProperty(required = true) @JacksonXmlProperty(isAttribute = true) private String type; + @JsonProperty(required = true) @JacksonXmlProperty(localName = "driver-class-name", isAttribute = true) private String driverClassName; @JacksonXmlProperty(localName = "default", isAttribute = true) private boolean isDefault; + @JsonProperty(required = true) @JacksonXmlProperty(localName = "create-table") private String createTableSQL; + @JsonProperty(required = true) @JacksonXmlProperty(localName = "select-by-key") private String selectByKeySQL; + @JsonProperty(required = true) @JacksonXmlProperty(localName = "select-by-parent") private String selectByParentKeySQL; + @JsonProperty(required = true) @JacksonXmlProperty(localName = "insert") private String insertSQL; + @JsonProperty(required = true) @JacksonXmlProperty(localName = "update") private String updateSQL; + @JsonProperty(required = true) @JacksonXmlProperty(localName = "delete") private String deleteSQL; } diff --git a/mode/type/standalone/repository/provider/jdbc/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/sql/JDBCRepositorySQLLoader.java b/mode/type/standalone/repository/provider/jdbc/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/sql/JDBCRepositorySQLLoader.java index fa5f68bdbb5042..870aba4b7b1148 100644 --- a/mode/type/standalone/repository/provider/jdbc/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/sql/JDBCRepositorySQLLoader.java +++ b/mode/type/standalone/repository/provider/jdbc/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/sql/JDBCRepositorySQLLoader.java @@ -58,7 +58,7 @@ public final class JDBCRepositorySQLLoader { private static final Collection JAR_URL_PROTOCOLS = new HashSet<>(Arrays.asList("jar", "war", "zip", "wsjar", "vfszip")); - private static final ObjectMapper XML_MAPPER = XmlMapper.builder().defaultUseWrapper(false).build(); + private static final ObjectMapper XML_MAPPER = XmlMapper.builder().build(); /** * Load JDBC repository SQL.