Class QueryResultTransformer

java.lang.Object
org.evomaster.client.java.sql.internal.QueryResultTransformer

public class QueryResultTransformer extends Object
This class is used to covert InsertionDto to QueryResult and DataRow in order to calculate sql heuristics based on InsertionDto
  • Constructor Details

    • QueryResultTransformer

      public QueryResultTransformer()
  • Method Details

    • convertInsertionDtosToQueryResults

      public static QueryResult[] convertInsertionDtosToQueryResults(List<InsertionDto> insertionDtos, Map<SqlTableId,Set<SqlColumnId>> columns, DbInfoDto schemaDto)
      Parameters:
      insertionDtos - specifies InsertionDto which indicates data we have been inserted into database or mocked
      columns - specifies WHERE clause using a map from table name to involved column names
      schemaDto - specifies info about schema that is used to parse printable value specified in InsertionDto to Object value
      Returns:
      extracted an array of QueryResult.
    • cartesianProduct

      public static <T> List<List<T>> cartesianProduct(List<List<T>> values)
      implement Cartesian Product e.g., (a,b) * (c,d) = (a,c), (a,d), (b,c), (b,d)
      Type Parameters:
      T - type of values
      Parameters:
      values - specified a list of sets for n-fold Cartesian Product
      Returns:
      results of Cartesian Product of the given sets
    • translateInsertionDtos

      public static QueryResultSet translateInsertionDtos(List<InsertionDto> insertionDtos, Map<SqlTableId,Set<SqlColumnId>> columns, DbInfoDto schema)