From f6082468e49c17e67f0c91950e98e8babfb70e2b Mon Sep 17 00:00:00 2001 From: bog-walk <82039410+bog-walk@users.noreply.github.com> Date: Wed, 4 Dec 2024 17:50:11 -0500 Subject: [PATCH] chore: Fix docs/snippets exposed-dao project build fail (#2323) * chore: Fix docs/snippets exposed-dao project build fail EntityWithBase64.kt file was causing compile errors due to unresolved objects that did not have import statements. * chore: Fix docs/snippets exposed-dao project build fail - Replace experimental kotlin.io.encoding.Base64 with stable java.util.Base64 --- .../main/kotlin/org/example/entities/EntityWithBase64.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/documentation-website/Writerside/snippets/exposed-dao/src/main/kotlin/org/example/entities/EntityWithBase64.kt b/documentation-website/Writerside/snippets/exposed-dao/src/main/kotlin/org/example/entities/EntityWithBase64.kt index 7c0277d027..c1890d75d8 100644 --- a/documentation-website/Writerside/snippets/exposed-dao/src/main/kotlin/org/example/entities/EntityWithBase64.kt +++ b/documentation-website/Writerside/snippets/exposed-dao/src/main/kotlin/org/example/entities/EntityWithBase64.kt @@ -4,6 +4,7 @@ import org.jetbrains.exposed.dao.IntEntity import org.jetbrains.exposed.dao.IntEntityClass import org.jetbrains.exposed.dao.id.EntityID import org.jetbrains.exposed.dao.id.IntIdTable +import java.util.Base64 object TableWithText : IntIdTable() { val text = varchar("text", length = 2048) @@ -12,10 +13,10 @@ object TableWithText : IntIdTable() { class EntityWithBase64(id: EntityID) : IntEntity(id) { var base64: String by TableWithText.text .memoizedTransform( - wrap = { Base64.encode(it.toByteArray()) }, - unwrap = { Base64.decode(it).toString() } + wrap = { Base64.getEncoder().encodeToString(it.toByteArray()) }, + unwrap = { Base64.getDecoder().decode(it).toString() } ) companion object : - IntEntityClass(TableWithText) + IntEntityClass(TableWithText) }