Java 类org.springframework.jdbc.core.CallableStatementCreatorFactory 实例源码

项目:lams    文件:AbstractJdbcCall.java   
/**
 * Method to perform the actual compilation.  Subclasses can override this template method to perform
 * their own compilation.  Invoked after this base class's compilation is complete.
 */
protected void compileInternal() {
    this.callMetaDataContext.initializeMetaData(getJdbcTemplate().getDataSource());

    // iterate over the declared RowMappers and register the corresponding SqlParameter
    for (Map.Entry<String, RowMapper<?>> entry : this.declaredRowMappers.entrySet()) {
        SqlParameter resultSetParameter =
                this.callMetaDataContext.createReturnResultSetParameter(entry.getKey(), entry.getValue());
        this.declaredParameters.add(resultSetParameter);
    }
    this.callMetaDataContext.processParameters(this.declaredParameters);

    this.callString = this.callMetaDataContext.createCallString();
    if (logger.isDebugEnabled()) {
        logger.debug("Compiled stored procedure. Call string is [" + this.callString + "]");
    }

    this.callableStatementFactory =
            new CallableStatementCreatorFactory(getCallString(), this.callMetaDataContext.getCallParameters());
    this.callableStatementFactory.setNativeJdbcExtractor(getJdbcTemplate().getNativeJdbcExtractor());

    onCompileInternal();
}
项目:spring4-understanding    文件:AbstractJdbcCall.java   
/**
 * Delegate method to perform the actual compilation.
 * <p>Subclasses can override this template method to perform their own compilation.
 * Invoked after this base class's compilation is complete.
 */
protected void compileInternal() {
    this.callMetaDataContext.initializeMetaData(getJdbcTemplate().getDataSource());

    // Iterate over the declared RowMappers and register the corresponding SqlParameter
    for (Map.Entry<String, RowMapper<?>> entry : this.declaredRowMappers.entrySet()) {
        SqlParameter resultSetParameter =
                this.callMetaDataContext.createReturnResultSetParameter(entry.getKey(), entry.getValue());
        this.declaredParameters.add(resultSetParameter);
    }
    this.callMetaDataContext.processParameters(this.declaredParameters);

    this.callString = this.callMetaDataContext.createCallString();
    if (logger.isDebugEnabled()) {
        logger.debug("Compiled stored procedure. Call string is [" + this.callString + "]");
    }

    this.callableStatementFactory =
            new CallableStatementCreatorFactory(getCallString(), this.callMetaDataContext.getCallParameters());
    this.callableStatementFactory.setNativeJdbcExtractor(getJdbcTemplate().getNativeJdbcExtractor());

    onCompileInternal();
}
项目:class-guard    文件:AbstractJdbcCall.java   
/**
 * Method to perform the actual compilation.  Subclasses can override this template method to perform
 * their own compilation.  Invoked after this base class's compilation is complete.
 */
protected void compileInternal() {
    this.callMetaDataContext.initializeMetaData(getJdbcTemplate().getDataSource());

    // iterate over the declared RowMappers and register the corresponding SqlParameter
    for (Map.Entry<String, RowMapper> entry : this.declaredRowMappers.entrySet()) {
        SqlParameter resultSetParameter =
                this.callMetaDataContext.createReturnResultSetParameter(entry.getKey(), entry.getValue());
        this.declaredParameters.add(resultSetParameter);
    }
    this.callMetaDataContext.processParameters(this.declaredParameters);

    this.callString = this.callMetaDataContext.createCallString();
    if (logger.isDebugEnabled()) {
        logger.debug("Compiled stored procedure. Call string is [" + this.callString + "]");
    }

    this.callableStatementFactory =
            new CallableStatementCreatorFactory(getCallString(), this.callMetaDataContext.getCallParameters());
    this.callableStatementFactory.setNativeJdbcExtractor(getJdbcTemplate().getNativeJdbcExtractor());

    onCompileInternal();
}
项目:lams    文件:SqlCall.java   
/**
 * Overridden method to configure the CallableStatementCreatorFactory
 * based on our declared parameters.
 * @see RdbmsOperation#compileInternal()
 */
@Override
protected final void compileInternal() {
    if (isSqlReadyForUse()) {
        this.callString = getSql();
    }
    else {
        List<SqlParameter> parameters = getDeclaredParameters();
        int parameterCount = 0;
        if (isFunction()) {
            this.callString = "{? = call " + getSql() + "(";
            parameterCount = -1;
        }
        else {
            this.callString = "{call " + getSql() + "(";
        }
        for (SqlParameter parameter : parameters) {
            if (!(parameter.isResultsParameter())) {
                if (parameterCount > 0) {
                    this.callString += ", ";
                }
                if (parameterCount >= 0) {
                    this.callString += "?";
                }
                parameterCount++;
            }
        }
        this.callString += ")}";
    }
    if (logger.isDebugEnabled()) {
        logger.debug("Compiled stored procedure. Call string is [" + getCallString() + "]");
    }

    this.callableStatementFactory = new CallableStatementCreatorFactory(getCallString(), getDeclaredParameters());
    this.callableStatementFactory.setResultSetType(getResultSetType());
    this.callableStatementFactory.setUpdatableResults(isUpdatableResults());
    this.callableStatementFactory.setNativeJdbcExtractor(getJdbcTemplate().getNativeJdbcExtractor());

    onCompileInternal();
}
项目:spring4-understanding    文件:SqlCall.java   
/**
 * Overridden method to configure the CallableStatementCreatorFactory
 * based on our declared parameters.
 * @see RdbmsOperation#compileInternal()
 */
@Override
protected final void compileInternal() {
    if (isSqlReadyForUse()) {
        this.callString = getSql();
    }
    else {
        List<SqlParameter> parameters = getDeclaredParameters();
        int parameterCount = 0;
        if (isFunction()) {
            this.callString = "{? = call " + getSql() + "(";
            parameterCount = -1;
        }
        else {
            this.callString = "{call " + getSql() + "(";
        }
        for (SqlParameter parameter : parameters) {
            if (!(parameter.isResultsParameter())) {
                if (parameterCount > 0) {
                    this.callString += ", ";
                }
                if (parameterCount >= 0) {
                    this.callString += "?";
                }
                parameterCount++;
            }
        }
        this.callString += ")}";
    }
    if (logger.isDebugEnabled()) {
        logger.debug("Compiled stored procedure. Call string is [" + getCallString() + "]");
    }

    this.callableStatementFactory = new CallableStatementCreatorFactory(getCallString(), getDeclaredParameters());
    this.callableStatementFactory.setResultSetType(getResultSetType());
    this.callableStatementFactory.setUpdatableResults(isUpdatableResults());
    this.callableStatementFactory.setNativeJdbcExtractor(getJdbcTemplate().getNativeJdbcExtractor());

    onCompileInternal();
}
项目:class-guard    文件:SqlCall.java   
/**
 * Overridden method to configure the CallableStatementCreatorFactory
 * based on our declared parameters.
 * @see RdbmsOperation#compileInternal()
 */
@Override
protected final void compileInternal() {
    if (isSqlReadyForUse()) {
        this.callString = getSql();
    }
    else {
        List<SqlParameter> parameters = getDeclaredParameters();
        int parameterCount = 0;
        if (isFunction()) {
            this.callString = "{? = call " + getSql() + "(";
            parameterCount = -1;
        }
        else {
            this.callString = "{call " + getSql() + "(";
        }
        for (SqlParameter parameter : parameters) {
            if (!(parameter.isResultsParameter())) {
                if (parameterCount > 0) {
                    this.callString += ", ";
                }
                if (parameterCount >= 0) {
                    this.callString += "?";
                }
                parameterCount++;
            }
        }
        this.callString += ")}";
    }
    if (logger.isDebugEnabled()) {
        logger.debug("Compiled stored procedure. Call string is [" + getCallString() + "]");
    }

    this.callableStatementFactory = new CallableStatementCreatorFactory(getCallString(), getDeclaredParameters());
    this.callableStatementFactory.setResultSetType(getResultSetType());
    this.callableStatementFactory.setUpdatableResults(isUpdatableResults());
    this.callableStatementFactory.setNativeJdbcExtractor(getJdbcTemplate().getNativeJdbcExtractor());

    onCompileInternal();
}
项目:lams    文件:AbstractJdbcCall.java   
/**
 * Get the {@link CallableStatementCreatorFactory} being used
 */
protected CallableStatementCreatorFactory getCallableStatementFactory() {
    return this.callableStatementFactory;
}
项目:spring4-understanding    文件:AbstractJdbcCall.java   
/**
 * Get the {@link CallableStatementCreatorFactory} being used
 */
protected CallableStatementCreatorFactory getCallableStatementFactory() {
    return this.callableStatementFactory;
}
项目:Camel    文件:BatchCallableStatementCreatorFactory.java   
public BatchCallableStatementCreatorFactory(Template template) {
    this.template = template;
    this.sqlParameterList = createParams();
    this.callableStatementCreatorFactory = new CallableStatementCreatorFactory(formatSql(), createParams());
}
项目:class-guard    文件:AbstractJdbcCall.java   
/**
 * Get the {@link CallableStatementCreatorFactory} being used
 */
protected CallableStatementCreatorFactory getCallableStatementFactory() {
    return this.callableStatementFactory;
}