Let Kotlin repository generics extend Any.
The move to Kotlin 2.x introduces warnings in the Kotlin extensions for type arguments tha are not within their bounds (i.e. `Thing<T>` should be `Thing<T : Any>`). This commit fixes these cases and removes the warnings. Signed-off-by: Chris Bono <chris.bono@broadcom.com> Closes #3309
This commit is contained in:
@@ -24,4 +24,4 @@ package org.springframework.data.repository
|
||||
* @author Oscar Hernandez
|
||||
* @since 2.1.4
|
||||
*/
|
||||
fun <T, ID: Any> CrudRepository<T, ID>.findByIdOrNull(id: ID): T? = findById(id).orElse(null)
|
||||
fun <T: Any, ID: Any> CrudRepository<T, ID>.findByIdOrNull(id: ID): T? = findById(id).orElse(null)
|
||||
|
||||
@@ -37,7 +37,7 @@ import reactor.core.publisher.Mono
|
||||
* @see Flow
|
||||
*/
|
||||
@NoRepositoryBean
|
||||
interface CoroutineCrudRepository<T, ID> : Repository<T, ID> {
|
||||
interface CoroutineCrudRepository<T: Any, ID: Any> : Repository<T, ID> {
|
||||
|
||||
/**
|
||||
* Saves a given entity. Use the returned instance for further operations as the save operation might have changed the
|
||||
|
||||
@@ -34,7 +34,7 @@ import org.springframework.data.repository.Repository
|
||||
* @see CoroutineCrudRepository
|
||||
*/
|
||||
@NoRepositoryBean
|
||||
interface CoroutineSortingRepository<T, ID> : Repository<T, ID> {
|
||||
interface CoroutineSortingRepository<T: Any, ID: Any> : Repository<T, ID> {
|
||||
|
||||
/**
|
||||
* Returns all entities sorted by the given options.
|
||||
|
||||
Reference in New Issue
Block a user