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
According to Spring Data JPA reference documentation query methods can return List, Stream, Streamable or CloseableIterator.
The first three types are handled correctly but the fourth type raises an error.
Caused by: jakarta.persistence.NonUniqueResultException: query did not return a unique result: 20
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:128)
at org.hibernate.query.spi.AbstractSelectionQuery.getSingleResult(AbstractSelectionQuery.java:482)
at org.springframework.data.jpa.repository.query.JpaQueryExecution$SingleEntityExecution.doExecute(JpaQueryExecution.java:223)
at org.springframework.data.jpa.repository.query.JpaQueryExecution.execute(JpaQueryExecution.java:92)
at org.springframework.data.jpa.repository.query.AbstractJpaQuery.doExecute(AbstractJpaQuery.java:148)
at org.springframework.data.jpa.repository.query.AbstractJpaQuery.execute(AbstractJpaQuery.java:136)
Spring Data JPA 3.1.0
The text was updated successfully, but these errors were encountered:
Sorry for the confusion. CloseableIterator isn't supported as repository return type nor was it ever intended. It is a documentation bug where CloseableIterator sneaked into a change where it wasn't supposed to be listed in the first place.
mp911de
changed the title
Unable to use CloseableIterator in query methodsCloseableIterator errornously listed a supported repository return type
May 30, 2023
Hi
According to Spring Data JPA reference documentation query methods can return List, Stream, Streamable or CloseableIterator.
The first three types are handled correctly but the fourth type raises an error.
We created repository:
And while trying to fetch the entities:
we receive an exception:
Spring Data JPA 3.1.0
The text was updated successfully, but these errors were encountered: