feature: add vararg of Pair for function
This commit is contained in:
@@ -52,6 +52,12 @@ class Function(val definition: Function, override val connection: Connection): E
|
|||||||
): R? =
|
): R? =
|
||||||
select(object: TypeReference<R>() {}, values, block)
|
select(object: TypeReference<R>() {}, values, block)
|
||||||
|
|
||||||
|
inline fun <reified R: EntityI<*>> selectOne(
|
||||||
|
vararg values: Pair<String, Any?>,
|
||||||
|
noinline block: SelectOneCallback<R> = {}
|
||||||
|
): R? =
|
||||||
|
selectOne(values.toMap(), block)
|
||||||
|
|
||||||
/* Select Multiples */
|
/* Select Multiples */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -94,6 +100,12 @@ class Function(val definition: Function, override val connection: Connection): E
|
|||||||
): List<R> =
|
): List<R> =
|
||||||
select(object: TypeReference<List<R>>() {}, values, block)
|
select(object: TypeReference<List<R>>() {}, values, block)
|
||||||
|
|
||||||
|
inline fun <reified R: EntityI<*>> select(
|
||||||
|
vararg values: Pair<String, Any?>,
|
||||||
|
noinline block: SelectCallback<R> = {}
|
||||||
|
): List<R> =
|
||||||
|
select(values.toMap(), block)
|
||||||
|
|
||||||
/* Select Paginated */
|
/* Select Paginated */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -125,6 +137,14 @@ class Function(val definition: Function, override val connection: Connection): E
|
|||||||
): Paginated<R> =
|
): Paginated<R> =
|
||||||
select(page, limit, object: TypeReference<List<R>>() {}, values, block)
|
select(page, limit, object: TypeReference<List<R>>() {}, values, block)
|
||||||
|
|
||||||
|
inline fun <reified R: EntityI<*>> select(
|
||||||
|
page: Int,
|
||||||
|
limit: Int,
|
||||||
|
vararg values: Pair<String, Any?>,
|
||||||
|
noinline block: SelectPaginatedCallback<R> = {}
|
||||||
|
): Paginated<R> =
|
||||||
|
select(page, limit, object: TypeReference<List<R>>() {}, values.toMap(), block)
|
||||||
|
|
||||||
/* Execute function without traitements */
|
/* Execute function without traitements */
|
||||||
|
|
||||||
override fun exec(values: List<Any?>): QueryResult {
|
override fun exec(values: List<Any?>): QueryResult {
|
||||||
|
|||||||
Reference in New Issue
Block a user