Annotation Interface Fetch
Hint to drivers to use the given fetch size for streaming repository methods.
- For JDBC: applied to methods returning
java.util.stream.Stream<T>, it will call PreparedStatement#setFetchSize(int).
- For R2DBC: applied to methods returning reactor.core.publisher.Flux<T>, it will call io.r2dbc.spi.Statement#fetchSize(int).
- For Hibernate: applied to methods returning java.util.stream.Stream<T>.
Implementations may ignore the hint if unsupported by the underlying driver.- Since:
- 5.0
- Author:
- radovanradic
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intWill be used in streaming operations if method is notFetchannotated. -
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionintThe desired fetch size to use for streaming operations.
-
Field Details
-
DEFAULT_FETCH_SIZE
static final int DEFAULT_FETCH_SIZEWill be used in streaming operations if method is notFetchannotated.- See Also:
-
-
Element Details
-
value
int valueThe desired fetch size to use for streaming operations.- Returns:
- the fetch size (must be > 0 to take effect)
-