org.skife.jdbi.v2
Class ColonPrefixNamedParamStatementRewriter

java.lang.Object
  extended by org.skife.jdbi.v2.ColonPrefixNamedParamStatementRewriter
All Implemented Interfaces:
StatementRewriter

public class ColonPrefixNamedParamStatementRewriter
extends Object
implements StatementRewriter

Statement rewriter which replaces named parameter tokens of the form :tokenName

This is the default statement rewriter


Constructor Summary
ColonPrefixNamedParamStatementRewriter()
           
 
Method Summary
 RewrittenStatement rewrite(String sql, Binding params, StatementContext ctx)
          Munge up the SQL as desired.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColonPrefixNamedParamStatementRewriter

public ColonPrefixNamedParamStatementRewriter()
Method Detail

rewrite

public RewrittenStatement rewrite(String sql,
                                  Binding params,
                                  StatementContext ctx)
Munge up the SQL as desired. Responsible for figuring out ow to bind any arguments in to the resultant prepared statement.

Specified by:
rewrite in interface StatementRewriter
Parameters:
sql - The SQL to rewrite
params - contains the arguments which have been bound to this statement.
ctx - The statement context for the statement being executed
Returns:
somethign which can provde the actual SQL to prepare a statement from and which can bind the correct arguments to that prepared statement


Copyright © 2011. All Rights Reserved.