Code example for ParameterizedSingleColumnRowMapper

0
import org.apache.commons.lang3.Validate; 
import org.springframework.jdbc.core.simple.ParameterizedSingleColumnRowMapper;
 
import static annis.sqlgen.SqlConstraints.sqlString; 
 
public class ListCorpusByNameDaoHelper extends ParameterizedSingleColumnRowMapper<Long>
{ 
 
  public String createSql(List<String> corpusNames)
  { 
    Validate.notEmpty(corpusNames, "Need at least one corpus name");
 
    // turn corpus names into sql strings (enclosed with ') 
    List<String> corpusNamesSqlStrings = new ArrayList<>();
    for (String corpus : corpusNames)
    { 
      corpusNamesSqlStrings.add(sqlString(corpus));
    } 
 
    // build sql query