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 authored and marko-bekhta committed Sep 25, 2023
1 parent 736d651 commit 4ef04a2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
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,"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,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 4ef04a2

Please sign in to comment.