api-docs / org.ktorm.dsl / QueryRowSet
QueryRowSet
class QueryRowSet : CachedRowSet
(source code)Special implementation of ResultSet, used to hold the Query results for Ktorm.
Different from normal result sets, this class provides additional features:
- Available offline: It’s connection independent, it remains available after the connection closed, and it’s
not necessary to be closed after being used. Ktorm creates QueryRowSet objects with all data being retrieved from
the result set into memory, so we just need to wait for GC to collect them after they are not useful. - Indexed access operator: It overloads the indexed access operator, so we can use square brackets
[]
to obtain the value by giving a specific Column instance. It’s less error-prone by the benefit of the compiler’s static checking. Also, we can still use getXxx functions in the ResultSet to obtain our results by labels or column indices.
val query = database.from(Employees).select()
for (row in query.rowSet) {
println(row[Employees.name])
}
Properties
Name | Summary |
---|---|
val query: Query |
Functions
Name | Summary |
---|---|
Obtain the value of the specific Column instance. operator fun <C : Any> get( Obtain the value of the specific ColumnDeclaringExpression instance. | |
fun hasColumn(column: ColumnDeclaringExpression<*>): Boolean Check if the specific Column exists in this result set. |
Inherited Functions
Name | Summary |
---|---|
open fun afterLast(): Unit | |
open fun beforeFirst(): Unit | |
open fun | |
open fun clearWarnings(): Unit | |
open fun close(): Unit | |
open fun | |
open fun first(): Boolean | |
open fun getAsciiStream(columnIndex: Int): InputStream? open fun getAsciiStream(columnLabel: String): InputStream? | |
open fun open fun open fun getBigDecimal(columnIndex: Int): BigDecimal? open fun getBigDecimal(columnLabel: String): BigDecimal? | |
open fun getBinaryStream(columnIndex: Int): InputStream? open fun getBinaryStream(columnLabel: String): InputStream? | |
open fun getConcurrency(): Int | |
open fun | |
open fun getFetchDirection(): Int | |
open fun getFetchSize(): Int | |
open fun getHoldability(): Int | |
Retrieve the value of the designated column in the current row of this row set object as a java.time.Instant object in the Java programming language. | |
Retrieve the value of the designated column in the current row of this row set object as a java.time.LocalDate object in the Java programming language. | |
fun getLocalDateTime(columnIndex: Int): LocalDateTime? fun getLocalDateTime(columnLabel: String): LocalDateTime? Retrieve the value of the designated column in the current row of this row set object as a java.time.LocalDateTime object in the Java programming language. | |
Retrieve the value of the designated column in the current row of this row set object as a java.time.LocalTime object in the Java programming language. | |
open fun getMetaData(): ResultSetMetaData | |
open fun getRow(): Int | |
open fun getStatement(): Statement? | |
open fun getType(): Int | |
open fun open fun | |
open fun getWarnings(): SQLWarning? | |
open fun | |
open fun isAfterLast(): Boolean | |
open fun isBeforeFirst(): Boolean | |
open fun isClosed(): Boolean | |
open fun isFirst(): Boolean | |
open fun isLast(): Boolean | |
open fun last(): Boolean | |
open fun | |
open fun | |
open fun next(): Boolean | |
open fun previous(): Boolean | |
open fun | |
open fun | |
open fun | |
open fun | |
fun size(): Int Return the number of rows in this row set. | |
open fun open fun open fun open fun open fun open fun | |
open fun open fun | |
open fun open fun open fun open fun open fun open fun | |
open fun open fun open fun open fun | |
open fun open fun | |
open fun | |
open fun wasNull(): Boolean |
Extension Functions
Name | Summary |
---|---|
infix fun <T : Any> T.eq( Equal operator, translated to | |
Return an iterator over the rows of this ResultSet. | |
infix fun <T : Any> T.neq( Not-equal operator, translated to | |
infix fun <T : Any> T.notEq( Not-equal operator, translated to | |
fun <T : AutoCloseable?, R> T.use(block: (T) -> R): R Execute the given block function on this resource and then close it down correctly whether an exception is thrown or not. |