Class ProcedureAction
java.lang.Object
org.apache.cayenne.access.jdbc.BaseSQLAction
org.apache.cayenne.access.jdbc.ProcedureAction
- All Implemented Interfaces:
SQLAction
- Direct Known Subclasses:
SQLServerProcedureAction
A SQLAction that runs a stored procedure. Note that ProcedureAction has
internal state and is not thread-safe.
- Since:
- 1.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intHolds a number of ResultSets processed by the action.protected ProcedureQueryFields inherited from class BaseSQLAction
dataNode -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ProcedureTranslatorcreateTranslator(Connection connection) Returns the ProcedureTranslator to use for this ProcedureAction.protected RowDescriptordescribeResultSet(ResultSet resultSet, int setIndex) Creates a RowDescriptor for result set.protected ProcedureReturns stored procedure for an internal query.protected voidinitStatement(CallableStatement statement) Initializes statement with query parametersvoidperformAction(Connection connection, OperationObserver observer) Executes a query using a strategy defined by the implementation.protected voidreadProcedureOutParameters(CallableStatement statement, OperationObserver delegate) Helper method that reads OUT parameters of a CallableStatement.Methods inherited from class BaseSQLAction
getInMemoryOffset, readResultSetModifier and TypeMethodDescriptionprotected intgetInMemoryOffset(int queryOffset) Returns a value of the offset that will be used to rewind the ResultSet within the SQL action before reading the result rows.protected voidreadResultSet(ResultSet resultSet, RowDescriptor descriptor, Query query, OperationObserver delegate) Helper method to process a ResultSet.
-
Field Details
-
query
-
processedResultSets
protected int processedResultSetsHolds a number of ResultSets processed by the action. This value is reset to zero on every "performAction" call.
-
-
Constructor Details
-
ProcedureAction
- Since:
- 4.0
-
-
Method Details
-
performAction
public void performAction(Connection connection, OperationObserver observer) throws SQLException, Exception Description copied from interface:SQLActionExecutes a query using a strategy defined by the implementation.- Throws:
SQLExceptionException
-
createTranslator
Returns the ProcedureTranslator to use for this ProcedureAction.- Parameters:
connection- JDBC connection
-
describeResultSet
Creates a RowDescriptor for result set.- Parameters:
resultSet- JDBC ResultSetsetIndex- a zero-based index of the ResultSet in the query results.- Throws:
SQLException
-
getProcedure
Returns stored procedure for an internal query. -
readProcedureOutParameters
protected void readProcedureOutParameters(CallableStatement statement, OperationObserver delegate) throws SQLException, Exception Helper method that reads OUT parameters of a CallableStatement.- Throws:
SQLExceptionException
-
initStatement
Initializes statement with query parameters- Throws:
Exception
-