Class SelectTransformer

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

public class SelectTransformer extends Object
  • Constructor Details

    • SelectTransformer

      public SelectTransformer()
  • Method Details

    • addFieldsToSelect

      public static String addFieldsToSelect(String select)
      The constraints in the WHERE clause might reference fields that are not retrieved in the SELECT. Therefore, we need to add them, otherwise it would not be possible to calculate any heuristics
      Parameters:
      select - the string containing the SQL SELECT command
      Returns:
      the modified SQL SELECT
    • removeOperations

      public static String removeOperations(String select)
      For example, when we have "select count(*)" we are not interested in the count, but the actual involved fields, so we want to transform it into "select *" by removing the count() operation.
      Parameters:
      select - SQL command to transform
      Returns:
      a transformed SQL select
    • removeConstraints

      public static String removeConstraints(String select)
    • addLimitForHandlingRowCount

      public static String addLimitForHandlingRowCount(String select, boolean doRemoveOtherConstraints, int limitedRowCount)
      add LIMIT for select in order to control row count
      Parameters:
      select - specifies SELECT sql
      doRemoveOtherConstraints - specified whether to remove other constraints
      limitedRowCount - specifies the limit
      Returns:
      select statement with LIMIT clause