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

import java.util.List;

import javax.inject.Inject;

import de.ivu.elect.business.gruppeimgebiet.entity.GruppeImGebiet;
import de.ivu.elect.jee.entity.EagerLoadingCollector;
import de.ivu.elect.jee.presentation.search.WildcardConverter;

public abstract class AbstractGruppeImGebietSearch {

  @Inject
  protected transient GruppeImGebietExtendedDAO dao;

  public AbstractGruppeImGebietSearch() {
    super();
  }

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

  protected abstract List<GruppeImGebiet> querySearchResult(GruppeImGebietSearchParameters searchParameters);

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