Skip to content

Commit

Permalink
Merge pull request #312 from marko-bekhta/standalone-mapper-cleanup
Browse files Browse the repository at this point in the history
Some minor cleanups around the loading binder
  • Loading branch information
yrodiere authored Jul 31, 2024
2 parents 3544b4a + a5cddc7 commit 5a2133e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/main/java/io/quarkus/search/app/entity/Guide.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.Set;

import io.quarkus.search.app.hibernate.AnalysisConfigurer;
import io.quarkus.search.app.hibernate.GuideLoadingBinder;
import io.quarkus.search.app.hibernate.I18nFullTextField;
import io.quarkus.search.app.hibernate.I18nKeywordField;
import io.quarkus.search.app.hibernate.InputProvider;
Expand All @@ -27,7 +28,7 @@
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.KeywordField;
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.SearchEntity;

@SearchEntity(loadingBinder = @EntityLoadingBinderRef(name = "guideLoadingBinder"))
@SearchEntity(loadingBinder = @EntityLoadingBinderRef(type = GuideLoadingBinder.class))
@Indexed(routingBinder = @RoutingBinderRef(type = QuarkusVersionAndLanguageRoutingBinder.class))
public class Guide {
@DocumentId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

import java.util.List;

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Named;

import io.quarkus.search.app.entity.Guide;

import org.hibernate.search.mapper.pojo.standalone.loading.LoadingTypeGroup;
Expand All @@ -17,8 +14,6 @@
import org.hibernate.search.mapper.pojo.standalone.loading.binding.EntityLoadingBinder;
import org.hibernate.search.mapper.pojo.standalone.loading.binding.EntityLoadingBindingContext;

@ApplicationScoped
@Named("guideLoadingBinder")
public class GuideLoadingBinder implements EntityLoadingBinder {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public int size() {
return -1;
}

public synchronized List<Guide> nextBatch(int batchSize) {
public List<Guide> nextBatch(int batchSize) {
List<Guide> list = new ArrayList<>();
for (int i = 0; guides.hasNext() && i < batchSize; i++) {
list.add(guides.next());
Expand Down

0 comments on commit 5a2133e

Please sign in to comment.