ca.krasnay.sqlbuilder
Class InsertBuilder

java.lang.Object
  extended by ca.krasnay.sqlbuilder.AbstractSqlBuilder
      extended by ca.krasnay.sqlbuilder.InsertBuilder
All Implemented Interfaces:
Serializable

public class InsertBuilder
extends AbstractSqlBuilder
implements Serializable

Builder for building SQL insert statements.

Author:
John Krasnay
See Also:
Serialized Form

Constructor Summary
InsertBuilder(String table)
          Constructor.
 
Method Summary
 InsertBuilder set(String column, String value)
          Inserts a column name, value pair into the SQL.
 String toString()
           
 
Methods inherited from class ca.krasnay.sqlbuilder.AbstractSqlBuilder
appendList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InsertBuilder

public InsertBuilder(String table)
Constructor.

Parameters:
table - Name of the table into which we'll be inserting.
Method Detail

set

public InsertBuilder set(String column,
                         String value)
Inserts a column name, value pair into the SQL.

Parameters:
column - Name of the table column.
value - Value to substitute in. InsertBuilder does *no* interpretation of this. If you want a string constant inserted, you must provide the single quotes and escape the internal quotes. It is more common to use a question mark or a token in the style of ParameterizedPreparedStatementCreator, e.g. ":foo".

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2014. All rights reserved.