Skip to content

Commit

Permalink
HSEARCH-4635 Implement ScrollableResults#setFetchSize by throwing an …
Browse files Browse the repository at this point in the history
…error

This is necessary in order to support ORM 6.1.2.Final.
  • Loading branch information
yrodiere committed Jan 3, 2023
1 parent 51dd0b8 commit c8f0177
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Expand Up @@ -259,8 +259,6 @@ SearchException foundMultipleEntitiesForDocumentId(String entityName, String doc
@Message(id = ID_OFFSET + 56, value = "Ignoring unrecognized query hint [%s]")
void ignoringUnrecognizedQueryHint(String hintName);

// NOTE: This is used in -orm6 modules
@SuppressWarnings("unused")
@Message(id = ID_OFFSET + 57, value = "Cannot set the fetch size of Hibernate Search ScrollableResults after having created them."
+ " If you want to define the size of batches for entity loading, set loading options when defining the query instead,"
+ " for example with .loading(o -> o.fetchSize(50))."
Expand Down
Expand Up @@ -195,6 +195,11 @@ public boolean setRowNumber(int rowNumber) {
return scroll( rowNumber - currentIndexInScroll );
}

// We cannot use @Override here because this method only exists in ORM 6.1.2+
public void setFetchSize(int i) {
throw log.cannotSetFetchSize();
}

@Override
public boolean isClosed() {
return closed;
Expand Down

0 comments on commit c8f0177

Please sign in to comment.