Class QueryResult

java.lang.Object
org.evomaster.client.java.sql.QueryResult

public class QueryResult extends Object
The results of a SQL Select query, in a easy to parse/manipulate data structure compared to java.sql.ResultSet.
  • Constructor Details

    • QueryResult

      public QueryResult(List<VariableDescriptor> variableDescriptorList)
    • QueryResult

      public QueryResult(List<String> columnNames, String tableName)
      WARNING: Constructor only needed for testing
      Parameters:
      columnNames - name of columns
      tableName - name of table the columns belongs to
    • QueryResult

      public QueryResult(ResultSet resultSet)
  • Method Details

    • addRow

      public void addRow(DataRow row)
    • addRow

      public void addRow(List<String> columnNames, String tableName, List<Object> row)
    • sameVariableNames

      public boolean sameVariableNames(List<String> columnNames, String tableName)
    • sameVariableNames

      public boolean sameVariableNames(DataRow row)
    • seeRows

      public List<DataRow> seeRows()
    • seeVariableDescriptors

      public List<VariableDescriptor> seeVariableDescriptors()
    • isEmpty

      public boolean isEmpty()
    • size

      public int size()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toDto

      public QueryResultDto toDto()
    • getTableName

      public String getTableName()
      Retrieves the table name of this queryResult.
      Returns:
      the table name of the first VariableDescriptor in the variableDescriptors list.
      Throws:
      IllegalStateException - if the variableDescriptors list is empty.