From 1a79156a7ed538b76780b36b2e690717338d8f7f Mon Sep 17 00:00:00 2001 From: guanxu <1510424541@qq.com> Date: Wed, 22 Oct 2025 16:17:33 +0800 Subject: [PATCH 1/3] feat(memory): Add Oracle and Sqlite support for JDBC chat memory(#4698) - Add Oracle and Sqlite JdbcChatMemoryRepositoryDialect classes. - Modify the JdbcChatMemoryRepositoryDialect interface to support identifying the correct dialect for Oracle and SQLite by their database product names. - Add Oracle and Sqlite JdbcChatMemoryRepository integration test classes. Signed-off-by: guanxu <1510424541@qq.com> --- .../pom.xml | 20 ++++++++ .../jdbc/JdbcChatMemoryRepositoryDialect.java | 2 + .../OracleChatMemoryRepositoryDialect.java | 47 +++++++++++++++++++ .../SqliteChatMemoryRepositoryDialect.java | 47 +++++++++++++++++++ .../memory/repository/jdbc/schema-oracle.sql | 9 ++++ .../memory/repository/jdbc/schema-sqlite.sql | 10 ++++ .../AbstractJdbcChatMemoryRepositoryIT.java | 5 +- .../JdbcChatMemoryRepositoryOracleIT.java | 33 +++++++++++++ .../JdbcChatMemoryRepositorySqliteIT.java | 35 ++++++++++++++ 9 files changed, 205 insertions(+), 3 deletions(-) create mode 100644 memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/java/org/springframework/ai/chat/memory/repository/jdbc/OracleChatMemoryRepositoryDialect.java create mode 100644 memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/java/org/springframework/ai/chat/memory/repository/jdbc/SqliteChatMemoryRepositoryDialect.java create mode 100644 memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/resources/org/springframework/ai/chat/memory/repository/jdbc/schema-oracle.sql create mode 100644 memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/resources/org/springframework/ai/chat/memory/repository/jdbc/schema-sqlite.sql create mode 100644 memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/test/java/org/springframework/ai/chat/memory/repository/jdbc/JdbcChatMemoryRepositoryOracleIT.java create mode 100644 memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/test/java/org/springframework/ai/chat/memory/repository/jdbc/JdbcChatMemoryRepositorySqliteIT.java diff --git a/memory/repository/spring-ai-model-chat-memory-repository-jdbc/pom.xml b/memory/repository/spring-ai-model-chat-memory-repository-jdbc/pom.xml index e2271ea6dc0..1761e2e145e 100644 --- a/memory/repository/spring-ai-model-chat-memory-repository-jdbc/pom.xml +++ b/memory/repository/spring-ai-model-chat-memory-repository-jdbc/pom.xml @@ -85,6 +85,20 @@ true + + com.oracle.database.jdbc + ojdbc8 + test + true + + + + org.xerial + sqlite-jdbc + test + true + + org.springframework.boot spring-boot-starter-test @@ -121,6 +135,12 @@ test + + org.testcontainers + oracle-xe + test + + org.testcontainers junit-jupiter diff --git a/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/java/org/springframework/ai/chat/memory/repository/jdbc/JdbcChatMemoryRepositoryDialect.java b/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/java/org/springframework/ai/chat/memory/repository/jdbc/JdbcChatMemoryRepositoryDialect.java index 62658ac700e..d768bb502af 100644 --- a/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/java/org/springframework/ai/chat/memory/repository/jdbc/JdbcChatMemoryRepositoryDialect.java +++ b/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/java/org/springframework/ai/chat/memory/repository/jdbc/JdbcChatMemoryRepositoryDialect.java @@ -78,6 +78,8 @@ static JdbcChatMemoryRepositoryDialect from(DataSource dataSource) { case "MySQL", "MariaDB" -> new MysqlChatMemoryRepositoryDialect(); case "Microsoft SQL Server" -> new SqlServerChatMemoryRepositoryDialect(); case "HSQL Database Engine" -> new HsqldbChatMemoryRepositoryDialect(); + case "Oracle" -> new OracleChatMemoryRepositoryDialect(); + case "SQLite" -> new SqliteChatMemoryRepositoryDialect(); default -> // Add more as needed new PostgresChatMemoryRepositoryDialect(); }; diff --git a/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/java/org/springframework/ai/chat/memory/repository/jdbc/OracleChatMemoryRepositoryDialect.java b/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/java/org/springframework/ai/chat/memory/repository/jdbc/OracleChatMemoryRepositoryDialect.java new file mode 100644 index 00000000000..9825ea28088 --- /dev/null +++ b/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/java/org/springframework/ai/chat/memory/repository/jdbc/OracleChatMemoryRepositoryDialect.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024-2025 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.ai.chat.memory.repository.jdbc; + +/** + * Oracle dialect for chat memory repository. + * + * @author guan xu + * @since 1.1.0 + */ +public class OracleChatMemoryRepositoryDialect implements JdbcChatMemoryRepositoryDialect { + + @Override + public String getSelectMessagesSql() { + return "SELECT content, type FROM SPRING_AI_CHAT_MEMORY WHERE conversation_id = ? ORDER BY timestamp"; + } + + @Override + public String getInsertMessageSql() { + return "INSERT INTO SPRING_AI_CHAT_MEMORY (conversation_id, content, type, timestamp) VALUES (?, ?, ?, ?)"; + } + + @Override + public String getSelectConversationIdsSql() { + return "SELECT DISTINCT conversation_id FROM SPRING_AI_CHAT_MEMORY"; + } + + @Override + public String getDeleteMessagesSql() { + return "DELETE FROM SPRING_AI_CHAT_MEMORY WHERE conversation_id = ?"; + } + +} diff --git a/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/java/org/springframework/ai/chat/memory/repository/jdbc/SqliteChatMemoryRepositoryDialect.java b/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/java/org/springframework/ai/chat/memory/repository/jdbc/SqliteChatMemoryRepositoryDialect.java new file mode 100644 index 00000000000..8cc43f1a533 --- /dev/null +++ b/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/java/org/springframework/ai/chat/memory/repository/jdbc/SqliteChatMemoryRepositoryDialect.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024-2025 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.ai.chat.memory.repository.jdbc; + +/** + * Sqlite dialect for chat memory repository. + * + * @author guan xu + * @since 1.1.0 + */ +public class SqliteChatMemoryRepositoryDialect implements JdbcChatMemoryRepositoryDialect { + + @Override + public String getSelectMessagesSql() { + return "SELECT content, type FROM SPRING_AI_CHAT_MEMORY WHERE conversation_id = ? ORDER BY timestamp"; + } + + @Override + public String getInsertMessageSql() { + return "INSERT INTO SPRING_AI_CHAT_MEMORY (conversation_id, content, type, timestamp) VALUES (?, ?, ?, ?)"; + } + + @Override + public String getSelectConversationIdsSql() { + return "SELECT DISTINCT conversation_id FROM SPRING_AI_CHAT_MEMORY"; + } + + @Override + public String getDeleteMessagesSql() { + return "DELETE FROM SPRING_AI_CHAT_MEMORY WHERE conversation_id = ?"; + } + +} diff --git a/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/resources/org/springframework/ai/chat/memory/repository/jdbc/schema-oracle.sql b/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/resources/org/springframework/ai/chat/memory/repository/jdbc/schema-oracle.sql new file mode 100644 index 00000000000..a79b83634da --- /dev/null +++ b/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/resources/org/springframework/ai/chat/memory/repository/jdbc/schema-oracle.sql @@ -0,0 +1,9 @@ +CREATE TABLE SPRING_AI_CHAT_MEMORY ( + conversation_id VARCHAR2(36) NOT NULL, + content CLOB NOT NULL, + type VARCHAR2(10) NOT NULL CHECK (type IN ('USER', 'ASSISTANT', 'SYSTEM', 'TOOL')), + timestamp TIMESTAMP NOT NULL +); + +CREATE INDEX SPRING_AI_CHAT_MEMORY_CONVERSATION_ID_TIMESTAMP_IDX + ON SPRING_AI_CHAT_MEMORY(conversation_id, timestamp); \ No newline at end of file diff --git a/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/resources/org/springframework/ai/chat/memory/repository/jdbc/schema-sqlite.sql b/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/resources/org/springframework/ai/chat/memory/repository/jdbc/schema-sqlite.sql new file mode 100644 index 00000000000..aa3bad939b1 --- /dev/null +++ b/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/resources/org/springframework/ai/chat/memory/repository/jdbc/schema-sqlite.sql @@ -0,0 +1,10 @@ +CREATE TABLE IF NOT EXISTS SPRING_AI_CHAT_MEMORY ( + conversation_id TEXT NOT NULL, + content TEXT NOT NULL, + type TEXT NOT NULL, + timestamp INTEGER NOT NULL, + CHECK (type IN ('USER', 'ASSISTANT', 'SYSTEM', 'TOOL')) +); + +CREATE INDEX IF NOT EXISTS SPRING_AI_CHAT_MEMORY_CONVERSATION_ID_TIMESTAMP_IDX +ON SPRING_AI_CHAT_MEMORY(conversation_id, timestamp); diff --git a/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/test/java/org/springframework/ai/chat/memory/repository/jdbc/AbstractJdbcChatMemoryRepositoryIT.java b/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/test/java/org/springframework/ai/chat/memory/repository/jdbc/AbstractJdbcChatMemoryRepositoryIT.java index c26dd69049d..2988f289fda 100644 --- a/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/test/java/org/springframework/ai/chat/memory/repository/jdbc/AbstractJdbcChatMemoryRepositoryIT.java +++ b/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/test/java/org/springframework/ai/chat/memory/repository/jdbc/AbstractJdbcChatMemoryRepositoryIT.java @@ -16,7 +16,6 @@ package org.springframework.ai.chat.memory.repository.jdbc; -import java.sql.Timestamp; import java.util.List; import java.util.UUID; import java.util.stream.Collectors; @@ -84,7 +83,7 @@ void saveMessagesSingleMessage(String content, MessageType messageType) { assertThat(result.get("conversation_id")).isEqualTo(conversationId); assertThat(result.get("content")).isEqualTo(message.getText()); assertThat(result.get("type")).isEqualTo(messageType.name()); - assertThat(result.get("timestamp")).isInstanceOf(Timestamp.class); + assertThat(result.get("timestamp")).isNotNull(); } @Test @@ -114,7 +113,7 @@ void saveMessagesMultipleMessages() { assertThat(result.get("conversation_id")).isEqualTo(conversationId); assertThat(result.get("content")).isEqualTo(message.getText()); assertThat(result.get("type")).isEqualTo(message.getMessageType().name()); - assertThat(result.get("timestamp")).isInstanceOf(Timestamp.class); + assertThat(result.get("timestamp")).isNotNull(); } var count = this.chatMemoryRepository.findByConversationId(conversationId).size(); diff --git a/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/test/java/org/springframework/ai/chat/memory/repository/jdbc/JdbcChatMemoryRepositoryOracleIT.java b/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/test/java/org/springframework/ai/chat/memory/repository/jdbc/JdbcChatMemoryRepositoryOracleIT.java new file mode 100644 index 00000000000..8d652a248ea --- /dev/null +++ b/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/test/java/org/springframework/ai/chat/memory/repository/jdbc/JdbcChatMemoryRepositoryOracleIT.java @@ -0,0 +1,33 @@ +/* + * Copyright 2023-2025 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.ai.chat.memory.repository.jdbc; + +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.context.jdbc.Sql; + +/** + * Integration tests for {@link JdbcChatMemoryRepository} with Oracle. + * + * @author guan xu + */ +@SpringBootTest +@TestPropertySource(properties = { "spring.datasource.url=jdbc:tc:oracle:21-slim-faststart:///" }) +@Sql(scripts = "classpath:org/springframework/ai/chat/memory/repository/jdbc/schema-oracle.sql") +class JdbcChatMemoryRepositoryOracleIT extends AbstractJdbcChatMemoryRepositoryIT { + +} diff --git a/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/test/java/org/springframework/ai/chat/memory/repository/jdbc/JdbcChatMemoryRepositorySqliteIT.java b/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/test/java/org/springframework/ai/chat/memory/repository/jdbc/JdbcChatMemoryRepositorySqliteIT.java new file mode 100644 index 00000000000..81417980a44 --- /dev/null +++ b/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/test/java/org/springframework/ai/chat/memory/repository/jdbc/JdbcChatMemoryRepositorySqliteIT.java @@ -0,0 +1,35 @@ +/* + * Copyright 2023-2025 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.ai.chat.memory.repository.jdbc; + +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.context.jdbc.Sql; + +/** + * Integration tests for {@link JdbcChatMemoryRepository} with Sqlite. + * + * @author guan xu + */ +@SpringBootTest +@TestPropertySource(properties = { "spring.datasource.url=jdbc:sqlite::memory:", + "spring.datasource.driver-class-name=org.sqlite.JDBC", + "spring.ai.chat.memory.repository.jdbc.initialize-schema=always" }) +@Sql(scripts = "classpath:org/springframework/ai/chat/memory/repository/jdbc/schema-sqlite.sql") +class JdbcChatMemoryRepositorySqliteIT extends AbstractJdbcChatMemoryRepositoryIT { + +} From b5215bbc43498a0854802547079006ab5218d1a2 Mon Sep 17 00:00:00 2001 From: guanxu <1510424541@qq.com> Date: Wed, 22 Oct 2025 21:58:28 +0800 Subject: [PATCH 2/3] Remove duplicate code Signed-off-by: guanxu <1510424541@qq.com> --- .../jdbc/JdbcChatMemoryRepositoryDialect.java | 1 - .../OracleChatMemoryRepositoryDialect.java | 47 ------------------- .../memory/repository/jdbc/schema-oracle.sql | 9 ---- .../JdbcChatMemoryRepositoryOracleIT.java | 33 ------------- 4 files changed, 90 deletions(-) delete mode 100644 memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/java/org/springframework/ai/chat/memory/repository/jdbc/OracleChatMemoryRepositoryDialect.java delete mode 100644 memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/resources/org/springframework/ai/chat/memory/repository/jdbc/schema-oracle.sql delete mode 100644 memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/test/java/org/springframework/ai/chat/memory/repository/jdbc/JdbcChatMemoryRepositoryOracleIT.java diff --git a/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/java/org/springframework/ai/chat/memory/repository/jdbc/JdbcChatMemoryRepositoryDialect.java b/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/java/org/springframework/ai/chat/memory/repository/jdbc/JdbcChatMemoryRepositoryDialect.java index d768bb502af..27ed4c873c2 100644 --- a/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/java/org/springframework/ai/chat/memory/repository/jdbc/JdbcChatMemoryRepositoryDialect.java +++ b/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/java/org/springframework/ai/chat/memory/repository/jdbc/JdbcChatMemoryRepositoryDialect.java @@ -78,7 +78,6 @@ static JdbcChatMemoryRepositoryDialect from(DataSource dataSource) { case "MySQL", "MariaDB" -> new MysqlChatMemoryRepositoryDialect(); case "Microsoft SQL Server" -> new SqlServerChatMemoryRepositoryDialect(); case "HSQL Database Engine" -> new HsqldbChatMemoryRepositoryDialect(); - case "Oracle" -> new OracleChatMemoryRepositoryDialect(); case "SQLite" -> new SqliteChatMemoryRepositoryDialect(); default -> // Add more as needed new PostgresChatMemoryRepositoryDialect(); diff --git a/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/java/org/springframework/ai/chat/memory/repository/jdbc/OracleChatMemoryRepositoryDialect.java b/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/java/org/springframework/ai/chat/memory/repository/jdbc/OracleChatMemoryRepositoryDialect.java deleted file mode 100644 index 9825ea28088..00000000000 --- a/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/java/org/springframework/ai/chat/memory/repository/jdbc/OracleChatMemoryRepositoryDialect.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2024-2025 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.ai.chat.memory.repository.jdbc; - -/** - * Oracle dialect for chat memory repository. - * - * @author guan xu - * @since 1.1.0 - */ -public class OracleChatMemoryRepositoryDialect implements JdbcChatMemoryRepositoryDialect { - - @Override - public String getSelectMessagesSql() { - return "SELECT content, type FROM SPRING_AI_CHAT_MEMORY WHERE conversation_id = ? ORDER BY timestamp"; - } - - @Override - public String getInsertMessageSql() { - return "INSERT INTO SPRING_AI_CHAT_MEMORY (conversation_id, content, type, timestamp) VALUES (?, ?, ?, ?)"; - } - - @Override - public String getSelectConversationIdsSql() { - return "SELECT DISTINCT conversation_id FROM SPRING_AI_CHAT_MEMORY"; - } - - @Override - public String getDeleteMessagesSql() { - return "DELETE FROM SPRING_AI_CHAT_MEMORY WHERE conversation_id = ?"; - } - -} diff --git a/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/resources/org/springframework/ai/chat/memory/repository/jdbc/schema-oracle.sql b/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/resources/org/springframework/ai/chat/memory/repository/jdbc/schema-oracle.sql deleted file mode 100644 index a79b83634da..00000000000 --- a/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/resources/org/springframework/ai/chat/memory/repository/jdbc/schema-oracle.sql +++ /dev/null @@ -1,9 +0,0 @@ -CREATE TABLE SPRING_AI_CHAT_MEMORY ( - conversation_id VARCHAR2(36) NOT NULL, - content CLOB NOT NULL, - type VARCHAR2(10) NOT NULL CHECK (type IN ('USER', 'ASSISTANT', 'SYSTEM', 'TOOL')), - timestamp TIMESTAMP NOT NULL -); - -CREATE INDEX SPRING_AI_CHAT_MEMORY_CONVERSATION_ID_TIMESTAMP_IDX - ON SPRING_AI_CHAT_MEMORY(conversation_id, timestamp); \ No newline at end of file diff --git a/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/test/java/org/springframework/ai/chat/memory/repository/jdbc/JdbcChatMemoryRepositoryOracleIT.java b/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/test/java/org/springframework/ai/chat/memory/repository/jdbc/JdbcChatMemoryRepositoryOracleIT.java deleted file mode 100644 index 8d652a248ea..00000000000 --- a/memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/test/java/org/springframework/ai/chat/memory/repository/jdbc/JdbcChatMemoryRepositoryOracleIT.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2023-2025 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.ai.chat.memory.repository.jdbc; - -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.TestPropertySource; -import org.springframework.test.context.jdbc.Sql; - -/** - * Integration tests for {@link JdbcChatMemoryRepository} with Oracle. - * - * @author guan xu - */ -@SpringBootTest -@TestPropertySource(properties = { "spring.datasource.url=jdbc:tc:oracle:21-slim-faststart:///" }) -@Sql(scripts = "classpath:org/springframework/ai/chat/memory/repository/jdbc/schema-oracle.sql") -class JdbcChatMemoryRepositoryOracleIT extends AbstractJdbcChatMemoryRepositoryIT { - -} From 90d67421f84e58cb035681f351bb585f3ba4a784 Mon Sep 17 00:00:00 2001 From: guanxu <1510424541@qq.com> Date: Wed, 22 Oct 2025 22:10:10 +0800 Subject: [PATCH 3/3] Remove duplicate code Signed-off-by: guanxu <1510424541@qq.com> --- .../pom.xml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/memory/repository/spring-ai-model-chat-memory-repository-jdbc/pom.xml b/memory/repository/spring-ai-model-chat-memory-repository-jdbc/pom.xml index 1761e2e145e..651dd3aa0c0 100644 --- a/memory/repository/spring-ai-model-chat-memory-repository-jdbc/pom.xml +++ b/memory/repository/spring-ai-model-chat-memory-repository-jdbc/pom.xml @@ -85,13 +85,6 @@ true - - com.oracle.database.jdbc - ojdbc8 - test - true - - org.xerial sqlite-jdbc @@ -135,12 +128,6 @@ test - - org.testcontainers - oracle-xe - test - - org.testcontainers junit-jupiter