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

import java.util.List;

import javax.inject.Inject;

import de.ivu.elect.business.datei.entity.DateiExport;
import de.ivu.elect.jee.entity.EagerLoadingCollector;
import de.ivu.elect.jee.presentation.search.WildcardConverter;

public abstract class AbstractDateiExportSearch {

  @Inject
  protected transient DateiExportExtendedDAO dao;

  public AbstractDateiExportSearch() {
    super();
  }

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

  protected abstract List<DateiExport> querySearchResult(DateiExportSearchParameters searchParameters);

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