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

import java.util.List;

import javax.inject.Inject;

import de.ivu.elect.business.kandidatenportal.entity.WvpWarnung;
import de.ivu.elect.jee.entity.EagerLoadingCollector;
import de.ivu.elect.jee.presentation.search.WildcardConverter;

public abstract class AbstractWvpWarnungSearch {

  @Inject
  protected transient WvpWarnungExtendedDAO dao;

  public AbstractWvpWarnungSearch() {
    super();
  }

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

  protected abstract List<WvpWarnung> querySearchResult(WvpWarnungSearchParameters searchParameters);

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