org.skife.jdbi.v2
Class ConcreteStatementContext

java.lang.Object
  extended by org.skife.jdbi.v2.ConcreteStatementContext
All Implemented Interfaces:
StatementContext

public final class ConcreteStatementContext
extends Object
implements StatementContext


Method Summary
 Object getAttribute(String key)
          Obtain the value of an attribute
 Map<String,Object> getAttributes()
          Obtain all the attributes associated with this context as a map.
 Binding getBinding()
           
 Connection getConnection()
          Obtain the JDBC connection being used for this statement
 String getLocatedSql()
          Obtain the located sql

Not available until until statement execution time

 String getRawSql()
          Obtain the initial sql for the statement used to create the statement
 String getRewrittenSql()
          Obtain the located and rewritten sql

Not available until until statement execution time

 Method getSqlObjectMethod()
           
 Class<?> getSqlObjectType()
           
 PreparedStatement getStatement()
          Obtain the actual prepared statement being used.
 Object setAttribute(String key, Object value)
          Specify an attribute on the statement context
 void setBinding(Binding b)
           
 void setSqlObjectMethod(Method sqlObjectMethod)
           
 void setSqlObjectType(Class<?> sqlObjectType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAttribute

public Object getAttribute(String key)
Obtain the value of an attribute

Specified by:
getAttribute in interface StatementContext
Parameters:
key - The name of the attribute
Returns:
the value of the attribute

getAttributes

public Map<String,Object> getAttributes()
Obtain all the attributes associated with this context as a map. Changes to the map or to the attributes on the context will be reflected across both

Specified by:
getAttributes in interface StatementContext
Returns:
a map f attributes

getBinding

public Binding getBinding()
Specified by:
getBinding in interface StatementContext

getConnection

public Connection getConnection()
Obtain the JDBC connection being used for this statement

Specified by:
getConnection in interface StatementContext
Returns:
the JDBC connection

getLocatedSql

public String getLocatedSql()
Obtain the located sql

Not available until until statement execution time

Specified by:
getLocatedSql in interface StatementContext
Returns:
the sql which will be passed to the statement rewriter

getRawSql

public String getRawSql()
Obtain the initial sql for the statement used to create the statement

Specified by:
getRawSql in interface StatementContext
Returns:
the initial sql

getRewrittenSql

public String getRewrittenSql()
Obtain the located and rewritten sql

Not available until until statement execution time

Specified by:
getRewrittenSql in interface StatementContext
Returns:
the sql as it will be executed against the database

getSqlObjectMethod

public Method getSqlObjectMethod()
Specified by:
getSqlObjectMethod in interface StatementContext

getSqlObjectType

public Class<?> getSqlObjectType()
Specified by:
getSqlObjectType in interface StatementContext

getStatement

public PreparedStatement getStatement()
Obtain the actual prepared statement being used.

Not available until execution time

Specified by:
getStatement in interface StatementContext
Returns:
Obtain the actual prepared statement being used.

setAttribute

public Object setAttribute(String key,
                           Object value)
Specify an attribute on the statement context

Specified by:
setAttribute in interface StatementContext
Parameters:
key - name of the attribute
value - value for the attribute
Returns:
previous value of this attribute

setBinding

public void setBinding(Binding b)

setSqlObjectMethod

public final void setSqlObjectMethod(Method sqlObjectMethod)

setSqlObjectType

public final void setSqlObjectType(Class<?> sqlObjectType)


Copyright © 2011. All Rights Reserved.