use of org.hibernate.sql.exec.internal.JdbcCallParameterRegistrationImpl in project hibernate-orm by hibernate.
the class ProcedureParameterImpl method toJdbcParameterRegistration.
@Override
public JdbcCallParameterRegistration toJdbcParameterRegistration(int startIndex, ProcedureCallImplementor<?> procedureCall) {
final QueryParameterBinding<T> binding = procedureCall.getParameterBindings().getBinding(this);
final BindableType<T> typeToUse = BindingTypeHelper.INSTANCE.resolveTemporalPrecision(binding == null || binding.getExplicitTemporalPrecision() == null ? null : binding.getExplicitTemporalPrecision(), getHibernateType(), procedureCall.getSession().getFactory());
final String name;
if (procedureCall.getParameterStrategy() == ParameterStrategy.NAMED && canDoNameParameterBinding(typeToUse, procedureCall)) {
name = this.name;
} else {
name = null;
}
final JdbcParameterBinder parameterBinder;
final JdbcCallRefCursorExtractorImpl refCursorExtractor;
final JdbcCallParameterExtractorImpl<T> parameterExtractor;
switch(mode) {
case REF_CURSOR:
refCursorExtractor = new JdbcCallRefCursorExtractorImpl(name, startIndex);
parameterBinder = null;
parameterExtractor = null;
break;
case IN:
parameterBinder = getParameterBinder(typeToUse, name);
parameterExtractor = null;
refCursorExtractor = null;
break;
case INOUT:
parameterBinder = getParameterBinder(typeToUse, name);
parameterExtractor = new JdbcCallParameterExtractorImpl<>(procedureCall.getProcedureName(), name, startIndex, typeToUse);
refCursorExtractor = null;
break;
default:
parameterBinder = null;
parameterExtractor = new JdbcCallParameterExtractorImpl<>(procedureCall.getProcedureName(), name, startIndex, typeToUse);
refCursorExtractor = null;
break;
}
return new JdbcCallParameterRegistrationImpl(name, startIndex, mode, typeToUse, parameterBinder, parameterExtractor, refCursorExtractor);
}
Aggregations