committed by
Mark Paluch
parent
b4d2391cdb
commit
4ea94056cc
@@ -19,8 +19,9 @@ package org.springframework.data.repository
|
||||
* Retrieves an entity by its id.
|
||||
*
|
||||
* @param id the entity id.
|
||||
* @return the entity with the given id or `null` if none found
|
||||
* @return the entity with the given id or `null` if none found.
|
||||
* @author Sebastien Deleuze
|
||||
* @author Oscar Hernandez
|
||||
* @since 2.1.4
|
||||
*/
|
||||
fun <T, ID> CrudRepository<T, ID>.findByIdOrNull(id: ID): T? = findById(id!!).orElse(null)
|
||||
fun <T, ID: Any> CrudRepository<T, ID>.findByIdOrNull(id: ID): T? = findById(id).orElse(null)
|
||||
|
||||
Reference in New Issue
Block a user