From 6fdef14eec449f16b25bb80ae47f1b7cbbc02141 Mon Sep 17 00:00:00 2001 From: r-ca Date: Mon, 29 Jan 2024 02:16:03 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=BF=E3=82=A4=E3=83=88=E3=83=AB=E3=82=AD?= =?UTF-8?q?=E3=83=A3=E3=83=83=E3=82=B7=E3=83=A5=E6=9B=B4=E6=96=B0=E3=83=A1?= =?UTF-8?q?=E3=82=BD=E3=83=83=E3=83=89=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/one/nem/lacerta/data/LacertaLibrary.java | 2 ++ .../nem/lacerta/data/impl/LacertaLibraryImpl.java | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/data/src/main/java/one/nem/lacerta/data/LacertaLibrary.java b/data/src/main/java/one/nem/lacerta/data/LacertaLibrary.java index 446758e3..e1ce346e 100644 --- a/data/src/main/java/one/nem/lacerta/data/LacertaLibrary.java +++ b/data/src/main/java/one/nem/lacerta/data/LacertaLibrary.java @@ -53,6 +53,8 @@ public interface LacertaLibrary { CompletableFuture combineDocument(String parentId, String childId); + CompletableFuture updateTitleCache(String parentId, String childId, String titleCache); + CompletableFuture uncombineDocument(String parentId, String childId); // CompletableFuture combineDocument(String parentId, ArrayList childIdList); diff --git a/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryImpl.java b/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryImpl.java index b36998a1..f35dee8c 100644 --- a/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryImpl.java +++ b/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryImpl.java @@ -389,6 +389,21 @@ public class LacertaLibraryImpl implements LacertaLibrary { logger.debug("LacertaLibraryImpl", "Database Query: Inserted ToxiDocumentEntity"); } + @Override + public CompletableFuture updateTitleCache(String parentId, String documentId, String titleCache) { + return CompletableFuture.supplyAsync(() -> { + ToxiDocumentEntity toxiDocumentEntity = database.toxiDocumentDao().findByParentIdAndChildId(parentId, documentId); + if (toxiDocumentEntity == null) { + logger.warn("LacertaLibraryImpl", "ToxiDocumentEntity is not found."); + return null; + } + toxiDocumentEntity.titleCache = titleCache; + database.toxiDocumentDao().update(toxiDocumentEntity); + logger.debug("LacertaLibraryImpl", "Database Query: Updated ToxiDocumentEntity"); + return null; + }); + } + @Override public CompletableFuture uncombineDocument(String parentId, String childId) { return CompletableFuture.supplyAsync(() -> {