You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both APIs FindById and findByIdAndPartitionKey should return Optional#empty() when a Entity hasn't been found, instead, a DocumentDBAccessException is thrown.
Below the documentation for findByIdAndPartitionKey in com.microsoft.azure.spring.data.cosmosdb.repository.DocumentDbRepository<T, ID>
/**
* Retrieves an entity by its id.
*
* @param id must not be {@literal null}.
* @param partitionKey partition key value of entity, must not be null.
* @return the entity with the given id or {@literal Optional#empty()} if none found
* @throws IllegalArgumentException if {@code id} is {@literal null}.
*/
Optional<T> findById(ID id, PartitionKey partitionKey);
This behavior will force to catch always the exception when an entity is not found.
DocumentDBAccessException may be thrown when other kind of errors occur.
The text was updated successfully, but these errors were encountered:
Version: 2.1.8
Both APIs FindById and findByIdAndPartitionKey should return Optional#empty() when a Entity hasn't been found, instead, a DocumentDBAccessException is thrown.
Below the documentation for findByIdAndPartitionKey in com.microsoft.azure.spring.data.cosmosdb.repository.DocumentDbRepository<T, ID>
This behavior will force to catch always the exception when an entity is not found.
DocumentDBAccessException may be thrown when other kind of errors occur.
The text was updated successfully, but these errors were encountered: