/*
* Template-File src/main/takatuka/templates/EntityAbstractSearch.vm
*/
package de.ivu.elect.business.ergebnis.boundary;

import java.util.List;

import javax.inject.Inject;

import de.ivu.elect.business.ergebnis.entity.DHondtQuotientListenInGruppe;
import de.ivu.elect.jee.entity.EagerLoadingCollector;
import de.ivu.elect.jee.presentation.search.WildcardConverter;

public abstract class AbstractDHondtQuotientListenInGruppeSearch {

  @Inject
  protected transient DHondtQuotientListenInGruppeExtendedDAO dao;

  public AbstractDHondtQuotientListenInGruppeSearch() {
    super();
  }

  public List<DHondtQuotientListenInGruppe> getSearchResult(DHondtQuotientListenInGruppeSearchParameters searchParameters, EagerLoadingCollector<DHondtQuotientListenInGruppe> eagerLoadingCollector) {
    return eagerLoadingCollector.eagerLoad(querySearchResult(searchParameters));
  }

  protected abstract List<DHondtQuotientListenInGruppe> querySearchResult(DHondtQuotientListenInGruppeSearchParameters searchParameters);

  protected String convertSearchPattern(String patternInput) {
    return new WildcardConverter().addAndConvertToJpqlLikeExpression(patternInput);
  }
}
