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

import java.util.List;

import javax.inject.Inject;

import de.ivu.elect.business.protokollierung.entity.LoeschProtokoll;
import de.ivu.elect.jee.entity.EagerLoadingCollector;
import de.ivu.elect.jee.presentation.search.WildcardConverter;

public abstract class AbstractLoeschProtokollSearch {

  @Inject
  protected transient LoeschProtokollExtendedDAO dao;

  public AbstractLoeschProtokollSearch() {
    super();
  }

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

  protected abstract List<LoeschProtokoll> querySearchResult(LoeschProtokollSearchParameters searchParameters);

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