|
|
|
@ -1,5 +1,5 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* Copyright 2002-2020 the original author or authors. |
|
|
|
* Copyright 2002-2021 the original author or authors. |
|
|
|
* |
|
|
|
* |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
@ -25,6 +25,7 @@ import org.springframework.dao.EmptyResultDataAccessException |
|
|
|
* |
|
|
|
* |
|
|
|
* @author Sebastien Deleuze |
|
|
|
* @author Sebastien Deleuze |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@Suppress("DEPRECATION") |
|
|
|
suspend fun <T> RowsFetchSpec<T>.awaitOne(): T { |
|
|
|
suspend fun <T> RowsFetchSpec<T>.awaitOne(): T { |
|
|
|
return one().awaitSingleOrNull() ?: throw EmptyResultDataAccessException(1) |
|
|
|
return one().awaitSingleOrNull() ?: throw EmptyResultDataAccessException(1) |
|
|
|
} |
|
|
|
} |
|
|
|
@ -34,6 +35,7 @@ suspend fun <T> RowsFetchSpec<T>.awaitOne(): T { |
|
|
|
* |
|
|
|
* |
|
|
|
* @author Sebastien Deleuze |
|
|
|
* @author Sebastien Deleuze |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@Suppress("DEPRECATION") |
|
|
|
suspend fun <T> RowsFetchSpec<T>.awaitOneOrNull(): T? = |
|
|
|
suspend fun <T> RowsFetchSpec<T>.awaitOneOrNull(): T? = |
|
|
|
one().awaitSingleOrNull() |
|
|
|
one().awaitSingleOrNull() |
|
|
|
|
|
|
|
|
|
|
|
@ -42,6 +44,7 @@ suspend fun <T> RowsFetchSpec<T>.awaitOneOrNull(): T? = |
|
|
|
* |
|
|
|
* |
|
|
|
* @author Sebastien Deleuze |
|
|
|
* @author Sebastien Deleuze |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@Suppress("DEPRECATION") |
|
|
|
suspend fun <T> RowsFetchSpec<T>.awaitSingle(): T { |
|
|
|
suspend fun <T> RowsFetchSpec<T>.awaitSingle(): T { |
|
|
|
return first().awaitSingleOrNull() ?: throw EmptyResultDataAccessException(1) |
|
|
|
return first().awaitSingleOrNull() ?: throw EmptyResultDataAccessException(1) |
|
|
|
} |
|
|
|
} |
|
|
|
@ -51,6 +54,7 @@ suspend fun <T> RowsFetchSpec<T>.awaitSingle(): T { |
|
|
|
* |
|
|
|
* |
|
|
|
* @author Sebastien Deleuze |
|
|
|
* @author Sebastien Deleuze |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@Suppress("DEPRECATION") |
|
|
|
suspend fun <T> RowsFetchSpec<T>.awaitSingleOrNull(): T? = |
|
|
|
suspend fun <T> RowsFetchSpec<T>.awaitSingleOrNull(): T? = |
|
|
|
first().awaitSingleOrNull() |
|
|
|
first().awaitSingleOrNull() |
|
|
|
|
|
|
|
|
|
|
|
|