use of org.hibernate.sql.exec.internal.JdbcCallFunctionReturnImpl in project hibernate-orm by hibernate.
the class FunctionReturnImpl method toJdbcFunctionReturn.
@Override
public JdbcCallFunctionReturn toJdbcFunctionReturn(SharedSessionContractImplementor persistenceContext) {
final BindableType<T> ormType;
final JdbcCallRefCursorExtractorImpl refCursorExtractor;
final JdbcCallParameterExtractorImpl<T> parameterExtractor;
if (getJdbcTypeCode() == Types.REF_CURSOR) {
refCursorExtractor = new JdbcCallRefCursorExtractorImpl(null, 1);
ormType = null;
parameterExtractor = null;
} else {
final TypeConfiguration typeConfiguration = persistenceContext.getFactory().getTypeConfiguration();
final JdbcType sqlTypeDescriptor = typeConfiguration.getJdbcTypeRegistry().getDescriptor(getJdbcTypeCode());
final BasicJavaType<?> javaTypeMapping = sqlTypeDescriptor.getJdbcRecommendedJavaTypeMapping(null, null, typeConfiguration);
// noinspection unchecked
ormType = (BindableType<T>) typeConfiguration.standardBasicTypeForJavaType(javaTypeMapping.getJavaTypeClass());
parameterExtractor = new JdbcCallParameterExtractorImpl<>(procedureCall.getProcedureName(), null, 1, ormType);
refCursorExtractor = null;
}
return new JdbcCallFunctionReturnImpl(ormType, parameterExtractor, refCursorExtractor);
}
Aggregations