タイトルキャッシュ更新メソッド追加

This commit is contained in:
r-ca 2024-01-29 02:16:03 +09:00
parent dcfb22f6a0
commit 6fdef14eec
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9
2 changed files with 17 additions and 0 deletions

View File

@ -53,6 +53,8 @@ public interface LacertaLibrary {
CompletableFuture<Void> combineDocument(String parentId, String childId); CompletableFuture<Void> combineDocument(String parentId, String childId);
CompletableFuture<Void> updateTitleCache(String parentId, String childId, String titleCache);
CompletableFuture<Void> uncombineDocument(String parentId, String childId); CompletableFuture<Void> uncombineDocument(String parentId, String childId);
// CompletableFuture<Void> combineDocument(String parentId, ArrayList<String> childIdList); // CompletableFuture<Void> combineDocument(String parentId, ArrayList<String> childIdList);

View File

@ -389,6 +389,21 @@ public class LacertaLibraryImpl implements LacertaLibrary {
logger.debug("LacertaLibraryImpl", "Database Query: Inserted ToxiDocumentEntity"); logger.debug("LacertaLibraryImpl", "Database Query: Inserted ToxiDocumentEntity");
} }
@Override
public CompletableFuture<Void> 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 @Override
public CompletableFuture<Void> uncombineDocument(String parentId, String childId) { public CompletableFuture<Void> uncombineDocument(String parentId, String childId) {
return CompletableFuture.supplyAsync(() -> { return CompletableFuture.supplyAsync(() -> {