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 Oct 6, 2022
1 parent b474f72 commit 909cee9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Expand Up @@ -257,8 +257,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 909cee9

Please sign in to comment.