com.vaadin.data.util.sqlcontainer.query.generator
Class StatementHelper

java.lang.Object
  extended by com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper
All Implemented Interfaces:
java.io.Serializable

public class StatementHelper
extends java.lang.Object
implements java.io.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
StatementHelper()
           
 
Method Summary
 void addParameterValue(java.lang.Object parameter)
           
 void addParameterValue(java.lang.Object parameter, java.lang.Class<?> type)
           
 java.lang.String getQueryString()
           
protected  boolean handleUnrecognizedTypeNullValue(int i, java.sql.PreparedStatement pstmt, java.util.Map<java.lang.Integer,java.lang.Class<?>> dataTypes)
          Handle unrecognized null values.
 void setParameterValuesToStatement(java.sql.PreparedStatement pstmt)
           
 void setQueryString(java.lang.String queryString)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatementHelper

public StatementHelper()
Method Detail

setQueryString

public void setQueryString(java.lang.String queryString)

getQueryString

public java.lang.String getQueryString()

addParameterValue

public void addParameterValue(java.lang.Object parameter)

addParameterValue

public void addParameterValue(java.lang.Object parameter,
                              java.lang.Class<?> type)

setParameterValuesToStatement

public void setParameterValuesToStatement(java.sql.PreparedStatement pstmt)
                                   throws java.sql.SQLException
Throws:
java.sql.SQLException

handleUnrecognizedTypeNullValue

protected boolean handleUnrecognizedTypeNullValue(int i,
                                                  java.sql.PreparedStatement pstmt,
                                                  java.util.Map<java.lang.Integer,java.lang.Class<?>> dataTypes)
                                           throws java.sql.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 the StatementHelper.

Parameters:
i -
pstmt -
dataTypes2 -
Returns:
true if handled, false otherwise
Throws:
java.sql.SQLException
See Also:
http://dev.vaadin.com/ticket/9148}


Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.