English | 简体中文

api-docs / org.ktorm.jackson / KtormModule

KtormModule

class KtormModule : Module (source code)

Jackson Module implementation that supports serializing Ktorm’s entity objects in JSON format.

Entity classes in Ktorm are defined as interfaces, and entity objects are created by JDK dynamic proxy.
That’s why Jackson cannot serialize entity objects by default (because they are not normal Java classes).
This module provides the Jackson serialization support for Ktorm.

To enable this module, you need to call the ObjectMapper.registerModule method to register it to Jackson.
You can also call ObjectMapper.findAndRegisterModules to automatically find and register it using JDK
ServiceLoader facility. For more details, please see Jackson’s documentation.

See Also

Entity

ObjectMapper.registerModule

ObjectMapper.findAndRegisterModules

Constructors

NameSummary

<init>

KtormModule()

Jackson Module implementation that supports serializing Ktorm’s entity objects in JSON format.

Functions

NameSummary

getModuleName

fun getModuleName(): String

setupModule

fun setupModule(context: SetupContext): Unit

version

fun version(): Version

Extension Functions

NameSummary

eq

infix fun <T : Any> T.eq(
    expr: ColumnDeclaring<T>
): BinaryExpression<Boolean>

Equal operator, translated to = in SQL.

neq

infix fun <T : Any> T.neq(
    expr: ColumnDeclaring<T>
): BinaryExpression<Boolean>

Not-equal operator, translated to <> in SQL.

notEq

infix fun <T : Any> T.notEq(
    expr: ColumnDeclaring<T>
): BinaryExpression<Boolean>

Not-equal operator, translated to <> in SQL.