public class ValidationStatement extends SQLStatement
Limitations: the query must expect to receive an empty result set or a result set with a single column and a single row.
SQLStatement.Parameter
Modifier and Type | Field and Description |
---|---|
static Object |
EMPTY_RESULT
Empty Result.
|
Constructor and Description |
---|
ValidationStatement()
Constructor.
|
ValidationStatement(String sql,
String description,
Object expectedValue)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
hashCode() |
String |
validate(ResultSet result)
Validate the result.
|
applyParameters, getDescription, getLog, getParameters, getSource, getSql, hasParameters, setBoolean, setDescription, setDouble, setInteger, setLong, setParameter, setSource, setSql, setString, setTimestamp, setXMLString, toString
public static final Object EMPTY_RESULT
public ValidationStatement()
public ValidationStatement(String sql, String description, Object expectedValue)
sql
- the SQL to run.description
- the description of the test.expectedValue
- the expected value or EMPTY_RESULT
if the result set should be empty.public boolean equals(Object o)
equals
in class SQLStatement
public int hashCode()
hashCode
in class SQLStatement
@Nullable public String validate(ResultSet result) throws SQLException
result
- the result from running the SQL.SQLException
- on error.