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

import java.util.List;

import javax.inject.Inject;

import de.ivu.elect.business.system.entity.SystemLog;
import de.ivu.elect.jee.entity.EagerLoadingCollector;
import de.ivu.elect.jee.presentation.search.WildcardConverter;

public abstract class AbstractSystemLogSearch {

  @Inject
  protected transient SystemLogExtendedDAO dao;

  public AbstractSystemLogSearch() {
    super();
  }

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

  protected abstract List<SystemLog> querySearchResult(SystemLogSearchParameters searchParameters);

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