Class SelectTransformer
java.lang.Object
org.evomaster.client.java.sql.internal.SelectTransformer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringaddFieldsToSelect(String select) The constraints in the WHERE clause might reference fields that are not retrieved in the SELECT.static StringaddLimitForHandlingRowCount(String select, boolean doRemoveOtherConstraints, int limitedRowCount) add LIMIT for select in order to control row countstatic StringremoveConstraints(String select) static StringremoveOperations(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.
-
Constructor Details
-
SelectTransformer
public SelectTransformer()
-
-
Method Details
-
addFieldsToSelect
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
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
-
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 sqldoRemoveOtherConstraints- specified whether to remove other constraintslimitedRowCount- specifies the limit- Returns:
- select statement with LIMIT clause
-