public class DmlOperations extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static int |
DEFAULT_FETCH_SIZE |
protected static String |
QUERY_GROUP |
protected static String |
QUERY_SETTINGS |
protected QueryResolver<ParameterizedStatementDefinition> |
queryResolver |
| Constructor and Description |
|---|
DmlOperations() |
| Modifier and Type | Method and Description |
|---|---|
int |
delete(QueryDefinition query,
DbConnector connector,
DbConnection connection)
Deletes data in a database.
|
protected StatementResult |
executeUpdate(QueryDefinition query,
StatementAttributes statementAttributes,
AutoGeneratedKeyAttributes autoGeneratedKeyAttributes,
DbConnection connection,
Query resolvedQuery) |
protected AutoGeneratedKeyStrategy |
getAutoGeneratedKeysStrategy(AutoGeneratedKeyAttributes keyAttributes) |
protected QueryStatementFactory |
getStatementFactory(StatementAttributes statementAttributes,
boolean streaming,
QuerySettings settings) |
StatementResult |
insert(QueryDefinition query,
AutoGeneratedKeyAttributes autoGeneratedKeyAttributes,
DbConnector connector,
DbConnection connection)
Inserts data into a Database
|
protected Query |
resolveQuery(QueryDefinition query,
DbConnector connector,
DbConnection connection,
QueryType... validTypes) |
protected Query |
resolveQuery(StoredProcedureCall call,
DbConnector connector,
DbConnection connection,
QueryType... validTypes) |
org.mule.runtime.extension.api.runtime.operation.InterceptingCallback<Object> |
select(QueryDefinition query,
boolean streaming,
StatementAttributes statementAttributes,
DbConnector connector,
DbConnection connection)
Selects data from a database
|
org.mule.runtime.extension.api.runtime.operation.InterceptingCallback<Map<String,Object>> |
storedProcedure(StoredProcedureCall call,
boolean streaming,
StatementAttributes statementAttributes,
AutoGeneratedKeyAttributes autoGeneratedKeyAttributes,
DbConnector connector,
DbConnection connection)
Invokes a Stored Procedure on the database.
|
StatementResult |
update(QueryDefinition query,
AutoGeneratedKeyAttributes autoGeneratedKeyAttributes,
DbConnector connector,
DbConnection connection)
Updates data in a database.
|
protected void |
validateNoParameterTypeIsUnused(Query query,
List<ParameterType> parameterTypes) |
protected void |
validateQueryType(QueryTemplate queryTemplate,
List<QueryType> validTypes) |
protected static final int DEFAULT_FETCH_SIZE
protected static final String QUERY_GROUP
protected static final String QUERY_SETTINGS
protected final QueryResolver<ParameterizedStatementDefinition> queryResolver
@OutputResolver(output=SelectMetadataResolver.class) public org.mule.runtime.extension.api.runtime.operation.InterceptingCallback<Object> select(@ParameterGroup(value="Query") QueryDefinition query, @Optional(defaultValue="false") @Expression(value=NOT_SUPPORTED) boolean streaming, @ParameterGroup(value="Query Settings") StatementAttributes statementAttributes, @UseConfig DbConnector connector, @Connection DbConnection connection) throws SQLException
query - a QueryDefinition as a parameter groupstreaming - if enabled retrieves the result set in blocks so that memory is not exhausted in case of large data sets.
This works in tandem with the fetch size parameterstatementAttributes - a StatementAttributes as a parameter groupconnector - the acting connectorconnection - the acting connectionstreaming, it can be a List or Iterator of mapsSQLException - if an error is producedpublic StatementResult insert(@ParameterGroup(value="Query") QueryDefinition query, @ParameterGroup(value="Auto Generated Keys") AutoGeneratedKeyAttributes autoGeneratedKeyAttributes, @UseConfig DbConnector connector, @Connection DbConnection connection) throws SQLException
query - QueryDefinition as a parameter groupautoGeneratedKeyAttributes - an AutoGeneratedKeyAttributes as a parameter groupconnector - the acting connectorconnection - the acting connectionStatementResultSQLException - if an error is producedpublic StatementResult update(@ParameterGroup(value="Query") QueryDefinition query, @ParameterGroup(value="Auto Generated Keys") AutoGeneratedKeyAttributes autoGeneratedKeyAttributes, @UseConfig DbConnector connector, @Connection DbConnection connection) throws SQLException
query - QueryDefinition as a parameter groupautoGeneratedKeyAttributes - an AutoGeneratedKeyAttributes as a parameter groupconnector - the acting connectorconnection - the acting connectionStatementResultSQLException - if an error is producedpublic int delete(@ParameterGroup(value="Query")
QueryDefinition query,
@UseConfig
DbConnector connector,
@Connection
DbConnection connection)
throws SQLException
query - QueryDefinition as a parameter groupconnector - the acting connectorconnection - the acting connectionSQLException - if an error is produced@OutputResolver(output=StoredProcedureMetadataResolver.class) public org.mule.runtime.extension.api.runtime.operation.InterceptingCallback<Map<String,Object>> storedProcedure(@ParameterGroup(value="Query") StoredProcedureCall call, @Optional(defaultValue="false") @Expression(value=NOT_SUPPORTED) boolean streaming, @ParameterGroup(value="Query Settings") StatementAttributes statementAttributes, @ParameterGroup(value="Auto Generated Keys") AutoGeneratedKeyAttributes autoGeneratedKeyAttributes, @UseConfig DbConnector connector, @Connection DbConnection connection) throws SQLException
call - a StoredProcedureCall as a parameter groupstreaming - if enabled retrieves the result set in blocks so that memory is not exhausted in case of large data sets.
This works in tandem with the fetch size parameterstatementAttributes - a StatementAttributes as a parameter groupautoGeneratedKeyAttributes - an AutoGeneratedKeyAttributes as a parameter groupconnector - the acting connectorconnection - the acting connectionMap with the procedure's outputSQLException - if an error is producedprotected Query resolveQuery(StoredProcedureCall call, DbConnector connector, DbConnection connection, QueryType... validTypes)
protected QueryStatementFactory getStatementFactory(StatementAttributes statementAttributes, boolean streaming, QuerySettings settings)
protected StatementResult executeUpdate(QueryDefinition query, StatementAttributes statementAttributes, AutoGeneratedKeyAttributes autoGeneratedKeyAttributes, DbConnection connection, Query resolvedQuery) throws SQLException
SQLExceptionprotected Query resolveQuery(QueryDefinition query, DbConnector connector, DbConnection connection, QueryType... validTypes)
protected void validateQueryType(QueryTemplate queryTemplate, List<QueryType> validTypes)
protected void validateNoParameterTypeIsUnused(Query query, List<ParameterType> parameterTypes)
protected AutoGeneratedKeyStrategy getAutoGeneratedKeysStrategy(AutoGeneratedKeyAttributes keyAttributes)
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.