org.apache.cayenne.access.trans
Class ProcedureTranslator

java.lang.Object
  extended by org.apache.cayenne.access.trans.ProcedureTranslator
Direct Known Subclasses:
HSQLDBProcedureTranslator

public class ProcedureTranslator
extends Object

Stored procedure query translator.


Field Summary
protected  DbAdapter adapter
           
protected  List<ProcedureParameter> callParams
           
protected  Connection connection
           
protected  EntityResolver entityResolver
           
protected  ProcedureQuery query
           
protected  List<Object> values
           
 
Constructor Summary
ProcedureTranslator()
           
 
Method Summary
protected  String createSqlString()
          Creates an SQL String for the stored procedure call.
 PreparedStatement createStatement()
          Creates and binds a PreparedStatement to execute query SQL via JDBC.
 Procedure getProcedure()
           
 ProcedureQuery getProcedureQuery()
           
protected  void initStatement(CallableStatement stmt)
          Set IN and OUT parameters.
protected  void initValues()
           
 void setAdapter(DbAdapter adapter)
           
 void setConnection(Connection connection)
           
 void setEntityResolver(EntityResolver entityResolver)
           
protected  void setInParam(CallableStatement stmt, ProcedureParameter param, Object val, int pos)
          Sets a single IN parameter of the CallableStatement.
protected  void setOutParam(CallableStatement stmt, ProcedureParameter param, int pos)
          Sets a single OUT parameter of the CallableStatement.
 void setQuery(ProcedureQuery query)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

query

protected ProcedureQuery query

connection

protected Connection connection

adapter

protected DbAdapter adapter

entityResolver

protected EntityResolver entityResolver

callParams

protected List<ProcedureParameter> callParams

values

protected List<Object> values
Constructor Detail

ProcedureTranslator

public ProcedureTranslator()
Method Detail

setQuery

public void setQuery(ProcedureQuery query)

setConnection

public void setConnection(Connection connection)

setAdapter

public void setAdapter(DbAdapter adapter)

setEntityResolver

public void setEntityResolver(EntityResolver entityResolver)
Since:
1.2

createSqlString

protected String createSqlString()
Creates an SQL String for the stored procedure call.


createStatement

public PreparedStatement createStatement()
                                  throws Exception
Creates and binds a PreparedStatement to execute query SQL via JDBC.

Throws:
Exception

getProcedure

public Procedure getProcedure()

getProcedureQuery

public ProcedureQuery getProcedureQuery()

initStatement

protected void initStatement(CallableStatement stmt)
                      throws Exception
Set IN and OUT parameters.

Throws:
Exception

initValues

protected void initValues()

setInParam

protected void setInParam(CallableStatement stmt,
                          ProcedureParameter param,
                          Object val,
                          int pos)
                   throws Exception
Sets a single IN parameter of the CallableStatement.

Throws:
Exception

setOutParam

protected void setOutParam(CallableStatement stmt,
                           ProcedureParameter param,
                           int pos)
                    throws Exception
Sets a single OUT parameter of the CallableStatement.

Throws:
Exception


Copyright © 2001-2011 Apache Cayenne. All Rights Reserved.