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

import java.util.List;

import javax.inject.Inject;

import de.ivu.elect.business.statistik.entity.StatistikKennzeichen;
import de.ivu.elect.jee.entity.EagerLoadingCollector;
import de.ivu.elect.jee.presentation.search.WildcardConverter;

public abstract class AbstractStatistikKennzeichenSearch {

  @Inject
  protected transient StatistikKennzeichenExtendedDAO dao;

  public AbstractStatistikKennzeichenSearch() {
    super();
  }

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

  protected abstract List<StatistikKennzeichen> querySearchResult(StatistikKennzeichenSearchParameters searchParameters);

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