Package-level declarations

Types

Link copied to clipboard

An object used to convert ResultSet to desired objects

Link copied to clipboard
annotation class RsColumn(val name: String = "", val isId: Boolean = false, val converter: KClass<out RsValueConverter> = RsNoOpConverter::class)

Map a property to a column.

Link copied to clipboard
annotation class RsConstructor

Specify which constructor to use. If constructor has no parameters, bean mode is used. Else, constructor mode is used.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FIELD])
annotation class RsIgnore

Specify a property to ignore. Used only in bean mode.

Link copied to clipboard

Mark a property as a nested property. A nested property's class contains its own columns and nested/to-one/to-many properties.

Link copied to clipboard

Does nothing

Link copied to clipboard
annotation class RsToMany(val elementConverter: KClass<out RsValueConverter> = RsNoOpConverter::class, val classToMap: KClass<out Any> = Any::class)

Mark a property as a to-many collection. Use this when mapping values from the result of a JOIN statement. Must be of type List or Set with only one generic type parameter.

Link copied to clipboard

Mark a property as a to-one property. A to-one property's class contains its own columns and nested/to-one/to-many properties. A to-one property's class have to have at least 1 column marked as ID. If id column(s) is null, then the value of the to-one property is null.

Link copied to clipboard

Functions

Link copied to clipboard
fun <T : Any> ResultSet.toList(clazz: KClass<T>): List<T>

Get columns' values of all rows as a list of DTOs of type clazz, then close ResultSet

Link copied to clipboard
fun <T : Any> ResultSet.toObject(clazz: KClass<T>): T?

Get columns' values of the first row as a DTO of type clazz, then close ResultSet

Link copied to clipboard
fun <T : Any> ResultSet.toScalar(): T?

Get value of the first column of the first row, then close ResultSet