Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.skife.jdbi.v2;
  
  import java.util.HashMap;
  import java.util.List;
  import java.util.Map;
 
 public final class ConcreteStatementContext implements StatementContext
 {
     private final List<Cleanablecleanables = new ArrayList<Cleanable>();
     private final Map<StringObject>        attributes = new HashMap<StringObject>();
 
     private String            rawSql;
     private String            rewrittenSql;
     private String            locatedSql;
     private PreparedStatement statement;
     private Connection        connection;
     private Binding           binding;
     private Class<?>          sqlObjectType;
     private Method            sqlObjectMethod;
     private boolean           returningGeneratedKeys;
 
     ConcreteStatementContext(Map<StringObjectglobalAttributes)
     {
         .putAll(globalAttributes);
     }

    
Specify an attribute on the statement context

Parameters:
key name of the attribute
value value for the attribute
Returns:
previous value of this attribute
 
     public Object setAttribute(String keyObject value)
     {
         return .put(keyvalue);
     }

    
Obtain the value of an attribute

Parameters:
key The name of the attribute
Returns:
the value of the attribute
 
     public Object getAttribute(String key)
     {
         return this..get(key);
     }

    
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

Returns:
a map f attributes
 
     public Map<StringObjectgetAttributes()
     {
         return ;
     }
 
     void setRawSql(String rawSql)
     {
         this. = rawSql;
     }

    
Obtain the initial sql for the statement used to create the statement

Returns:
the initial sql
 
     public String getRawSql()
     {
         return ;
     }
 
     void setLocatedSql(String locatedSql)
     {
         this. = locatedSql;
     }
 
     void setRewrittenSql(String rewrittenSql)
     {
         this. = rewrittenSql;
     }

    
Obtain the located and rewritten sql

Not available until until statement execution time

Returns:
the sql as it will be executed against the database
 
     public String getRewrittenSql()
    {
        return ;
    }

    
Obtain the located sql

Not available until until statement execution time

Returns:
the sql which will be passed to the statement rewriter
    public String getLocatedSql()
    {
        return ;
    }
    void setStatement(PreparedStatement stmt)
    {
         = stmt;
    }

    
Obtain the actual prepared statement being used.

Not available until execution time

Returns:
Obtain the actual prepared statement being used.
    {
        return ;
    }
    void setConnection(Connection connection)
    {
        this. = connection;
    }

    
Obtain the JDBC connection being used for this statement

Returns:
the JDBC connection
    public Connection getConnection()
    {
        return ;
    }
    public void setBinding(Binding b)
    {
        this. = b;
    }
    public Binding getBinding()
    {
        return ;
    }
    public final void setSqlObjectType(Class<?> sqlObjectType)
    {
        this. = sqlObjectType;
    }
    public Class<?> getSqlObjectType()
    {
        return ;
    }
    public final void setSqlObjectMethod(Method sqlObjectMethod)
    {
        this. = sqlObjectMethod;
    }
    public Method getSqlObjectMethod()
    {
        return ;
    }
    public void setReturningGeneratedKeys(boolean b)
    {
        this. = b;
    }
    public boolean isReturningGeneratedKeys()
    {
        return ;
    }
    public void addCleanable(Cleanable cleanable)
    {
        this..add(cleanable);
    }
    public List<CleanablegetCleanables()
    {
        return ;
    }
New to GrepCode? Check out our FAQ X