Search in sources :

Example 1 with ProcedureParameterBinding

use of org.apache.cayenne.access.translator.ProcedureParameterBinding in project cayenne by apache.

the class ProcedureTranslator method setInParam.

/**
 * Sets a single IN parameter of the CallableStatement.
 */
protected void setInParam(CallableStatement stmt, ProcedureParameter param, Object val, int pos) throws Exception {
    ExtendedType extendedType = val != null ? adapter.getExtendedTypes().getRegisteredType(val.getClass()) : adapter.getExtendedTypes().getDefaultType();
    ProcedureParameterBinding binding = new ProcedureParameterBinding(param);
    binding.setStatementPosition(pos);
    binding.setValue(val);
    binding.setExtendedType(extendedType);
    adapter.bindParameter(stmt, binding);
}
Also used : ProcedureParameterBinding(org.apache.cayenne.access.translator.ProcedureParameterBinding) ExtendedType(org.apache.cayenne.access.types.ExtendedType)

Aggregations

ProcedureParameterBinding (org.apache.cayenne.access.translator.ProcedureParameterBinding)1 ExtendedType (org.apache.cayenne.access.types.ExtendedType)1