HHH-18280 - Support named procedure parameters down to the JDBC leve
This commit is contained in:
parent
e5b86f31f2
commit
5a111c8fbb
|
@ -6,6 +6,7 @@
|
||||||
*/
|
*/
|
||||||
package org.hibernate.orm.test.sql.storedproc;
|
package org.hibernate.orm.test.sql.storedproc;
|
||||||
|
|
||||||
|
import java.sql.CallableStatement;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.hibernate.boot.MetadataBuilder;
|
import org.hibernate.boot.MetadataBuilder;
|
||||||
|
@ -15,10 +16,14 @@ import org.hibernate.procedure.ProcedureOutputs;
|
||||||
import org.hibernate.result.Output;
|
import org.hibernate.result.Output;
|
||||||
import org.hibernate.result.ResultSetOutput;
|
import org.hibernate.result.ResultSetOutput;
|
||||||
|
|
||||||
|
import org.hibernate.testing.orm.junit.FailureExpected;
|
||||||
import org.hibernate.testing.orm.junit.RequiresDialect;
|
import org.hibernate.testing.orm.junit.RequiresDialect;
|
||||||
import org.hibernate.testing.orm.junit.BaseSessionFactoryFunctionalTest;
|
import org.hibernate.testing.orm.junit.BaseSessionFactoryFunctionalTest;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import jakarta.persistence.ParameterMode;
|
||||||
|
|
||||||
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.hibernate.testing.orm.junit.ExtraAssertions.assertTyping;
|
import static org.hibernate.testing.orm.junit.ExtraAssertions.assertTyping;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
|
@ -101,4 +106,18 @@ public class StoredProcedureTest extends BaseSessionFactoryFunctionalTest {
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@FailureExpected( reason = "We currently expect the registrations to happen positionally", jiraKey = "HHH-18280" )
|
||||||
|
public void testNamedParameters() {
|
||||||
|
inTransaction( (session) -> {
|
||||||
|
final ProcedureCall findUserRange = session.createStoredProcedureCall( "findUserRange" );
|
||||||
|
findUserRange.registerParameter( "end", int.class, ParameterMode.IN );
|
||||||
|
findUserRange.registerParameter( "start", int.class, ParameterMode.IN );
|
||||||
|
findUserRange.setParameter( "start", 1 );
|
||||||
|
findUserRange.setParameter( "end", 10 );
|
||||||
|
final List<?> resultList = findUserRange.getResultList();
|
||||||
|
assertThat( resultList ).hasSize( 9 );
|
||||||
|
} );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue