code: protected boolean existConflictingTopLevelCorpus(String topLevelCorpusName)
    {
      String sql = "SELECT count(name) as amount FROM corpus WHERE top_level=true AND name='"
        + topLevelCorpusName + "'";
      Integer numberOfCorpora = getJdbcTemplate().query(sql,
        new ResultSetExtractor<Integer>()
        {
          @Override
          public Integer extractData(ResultSet rs) throws SQLException,
          DataAccessException
          {
            if (rs.next())
            {
              return rs.getInt("amount");
            }
            else
            {
              return 0;
            }
          }
        });
  
      return numberOfCorpora > 0;
    }
docs: Checks, if there already exists a top level corpus.
  
  @param topLevelCorpusName The name of the corpus, which is checked.
  @return Is false, if the no top level coprpus exists.