ca.krasnay.sqlbuilder
Class AbstractSqlCreator

java.lang.Object
  extended by ca.krasnay.sqlbuilder.AbstractSqlCreator
All Implemented Interfaces:
Serializable, org.springframework.jdbc.core.PreparedStatementCreator
Direct Known Subclasses:
DeleteCreator, SelectCreator, UpdateCreator

public abstract class AbstractSqlCreator
extends Object
implements org.springframework.jdbc.core.PreparedStatementCreator, Serializable

Abstract base class of SQL creator classes.

Author:
John Krasnay
See Also:
Serialized Form

Constructor Summary
AbstractSqlCreator()
           
AbstractSqlCreator(AbstractSqlCreator other)
          Copy constructor.
 
Method Summary
 String allocateParameter()
          Allocate and return a new parameter that is unique within this SelectCreator.
 PreparedStatement createPreparedStatement(Connection conn)
           
protected abstract  AbstractSqlBuilder getBuilder()
          Returns the builder for this creator.
protected  ParameterizedPreparedStatementCreator getPreparedStatementCreator()
          Returns the prepared statement creator for this creator.
 AbstractSqlCreator setParameter(String name, Object value)
          Sets a parameter for the creator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractSqlCreator

public AbstractSqlCreator()

AbstractSqlCreator

public AbstractSqlCreator(AbstractSqlCreator other)
Copy constructor. Used by cloneable creators.

Parameters:
other - AbstractSqlCreator being cloned.
Method Detail

allocateParameter

public String allocateParameter()
Allocate and return a new parameter that is unique within this SelectCreator. The parameter is of the form "paramN", where N is an integer that is incremented each time this method is called.


createPreparedStatement

public PreparedStatement createPreparedStatement(Connection conn)
                                          throws SQLException
Specified by:
createPreparedStatement in interface org.springframework.jdbc.core.PreparedStatementCreator
Throws:
SQLException

getBuilder

protected abstract AbstractSqlBuilder getBuilder()
Returns the builder for this creator.


getPreparedStatementCreator

protected ParameterizedPreparedStatementCreator getPreparedStatementCreator()
Returns the prepared statement creator for this creator.


setParameter

public AbstractSqlCreator setParameter(String name,
                                       Object value)
Sets a parameter for the creator.



Copyright © 2014. All rights reserved.