abstract class DataAccessUtils
Miscellaneous utility methods for DAO implementations. Useful with any data access technology.
Author
Juergen Hoeller
Since
1.0.2
DataAccessUtils()
Miscellaneous utility methods for DAO implementations. Useful with any data access technology. |
open static fun intResult(results: MutableCollection<*>): Int
Return a unique int result from the given Collection. Throws an exception if 0 or more than 1 result objects found, of if the unique result object is not convertible to an int. |
|
open static fun longResult(results: MutableCollection<*>): Long
Return a unique long result from the given Collection. Throws an exception if 0 or more than 1 result objects found, of if the unique result object is not convertible to a long. |
|
open static fun <T : Any> nullableSingleResult(results: MutableCollection<T>): T
Return a single result object from the given Collection. Throws an exception if 0 or more than 1 element found. |
|
open static fun <T : Any> objectResult(results: MutableCollection<*>, requiredType: Class<T>): T
Return a unique result object from the given Collection. Throws an exception if 0 or more than 1 result objects found, of if the unique result object is not convertible to the specified required type. |
|
open static fun <T : Any> requiredSingleResult(results: MutableCollection<T>): T
Return a single result object from the given Collection. Throws an exception if 0 or more than 1 element found. |
|
open static fun <T : Any> requiredUniqueResult(results: MutableCollection<T>): T
Return a unique result object from the given Collection. Throws an exception if 0 or more than 1 instance found. |
|
open static fun <T : Any> singleResult(results: MutableCollection<T>): T
Return a single result object from the given Collection. Returns |
|
open static fun translateIfNecessary(rawException: RuntimeException, pet: PersistenceExceptionTranslator): RuntimeException
Return a translated exception if this is appropriate, otherwise return the given exception as-is. |
|
open static fun <T : Any> uniqueResult(results: MutableCollection<T>): T
Return a unique result object from the given Collection. Returns |