Class StatementHelper
- java.lang.Object
-
- com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper
-
- All Implemented Interfaces:
Serializable
public class StatementHelper extends Object implements Serializable
StatementHelper is a simple helper class that assists TableQuery and the query generators in filling a PreparedStatement. The actual statement is generated by the query generator methods, but the resulting statement and all the parameter values are stored in an instance of StatementHelper. This class will also fill the values with correct setters into the PreparedStatement on request.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description StatementHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addParameterValue(Object parameter)
void
addParameterValue(Object parameter, Class<?> type)
String
getQueryString()
protected boolean
handleUnrecognizedTypeNullValue(int i, PreparedStatement pstmt, Map<Integer,Class<?>> dataTypes)
Handle unrecognized null values.void
setParameterValuesToStatement(PreparedStatement pstmt)
void
setQueryString(String queryString)
-
-
-
Method Detail
-
setQueryString
public void setQueryString(String queryString)
-
getQueryString
public String getQueryString()
-
addParameterValue
public void addParameterValue(Object parameter)
-
setParameterValuesToStatement
public void setParameterValuesToStatement(PreparedStatement pstmt) throws SQLException
- Throws:
SQLException
-
handleUnrecognizedTypeNullValue
protected boolean handleUnrecognizedTypeNullValue(int i, PreparedStatement pstmt, Map<Integer,Class<?>> dataTypes) throws SQLException
Handle unrecognized null values. Override this to handle null values for platform specific data types that are not handled by the default implementation of theStatementHelper
.- Parameters:
i
-pstmt
-dataTypes2
-- Returns:
- true if handled, false otherwise
- Throws:
SQLException
-
-