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) }